diff -u --recursive --new-file v2.2.5/linux/Documentation/Changes linux/Documentation/Changes --- v2.2.5/linux/Documentation/Changes Tue Mar 23 14:35:46 1999 +++ linux/Documentation/Changes Mon Apr 12 16:18:27 1999 @@ -258,6 +258,11 @@ The ISDN code in the stock 2.2 kernel may not work for you. If it doesn't, look in ftp://ftp.suse.com/pub/isdn4linux for updated versions. + In 2.0.x the kernel could be configured to drop source routed IP +packets via a compile time configuration option. In 2.2.x, this has +been replaced by a sysctl. See Documentation/networking/ip-sysctl.txt +for more information. + Memory ====== @@ -281,6 +286,20 @@ 128 meg limit on IA32 swap partition sizes has been eliminated. To use larger swap spaces, you need the new mkswap found in util-linux. You also need to upgrade util-linux to get the latest version of mount. + + Partitions on 2048 byte sectored media (certain magneto opticals +most prominently) were broken throughout the whole of 2.1 kernel +series, meaning that you will be unable to use 2.1-partitioned media on +Linux 2.2. This is not a 2.2 bug - 2.2 finally does the right thing! +[If you have to interchange media between Linux 2.1 and 2.2, your best +bet is to not use partitions at all but create the filesystem on the +raw device (e.g. /dev/sda) instead. This is also known as the +superfloppy format.] + + To properly create partitions on 2048 byte sectored media with Linux +2.2, be sure to use no less than fdisk version 2.9i and invoke fdisk +using '-b 2048' as an option. + RPM === diff -u --recursive --new-file v2.2.5/linux/Documentation/Configure.help linux/Documentation/Configure.help --- v2.2.5/linux/Documentation/Configure.help Mon Mar 29 11:09:11 1999 +++ linux/Documentation/Configure.help Mon Apr 12 09:58:57 1999 @@ -3956,8 +3956,8 @@ tagged command queuing and fast synchronous data transfers up to 80 MB/s with wide FAST-40 LVD devices and controllers. - The NCR53C860 and NCR53C875 support FAST-20 transfers. The NCR53C895 - supports FAST-40 transfers with Ultra2 LVD devices. + An additionnal driver named SYM53C8XX (a.k.a 896 driver) can also be + configured. See the help on the SYM53C8XX driver for more information. Note: there is another driver for the 53c8xx family of controllers ("NCR53c7,8xx SCSI support" above). If you want to use them both, @@ -3967,6 +3967,30 @@ Please read drivers/scsi/README.ncr53c8xx for more information. +SYM53C8XX SCSI support +CONFIG_SCSI_SYM53C8XX + The 896 driver for Linux (a.k.a. sym53c8xx) is derivated from the + ncr53c8xx driver and has been heavily reworked and enhanced to + fully support all the features of recent 53C8XX chips, notably the + hardware phase mismatch feature of the SYM53C896. + + For that to be achieved without additionnal complexity, support of + old 8XX chips has been dropped. If your system uses either a + 810 rev. < 16, a 815, or a 825 rev. < 16 PCI SCSI processor, you must + use the generic NCR53C8XX driver or configure both the NCR53C8XX and + the SYM53C8XX drivers either as module or linked to the kernel image. + + When both drivers are linked to the kernel, the SYM53C8XX driver is + called first at initialization and you can use the 'excl=ioaddr' + driver boot option to exclude attachement of adapters by the SYM53C8XX + driver. For instance, entering 'sym53c8xx=excl:0xb400,excl=0xc000' at + lilo prompt prevents adapters at io address 0xb400 and 0xc000 from + being attached by the SYM53C8XX driver, thus allowing the NCR53C8XX + driver to attach them. The 'excl' option is also supported by the + NCR53C8XX driver. + + Please read drivers/scsi/README.ncr53c8xx for more information. + synchronous data transfers frequency CONFIG_SCSI_NCR53C8XX_SYNC The SCSI Parallel Interface-2 Standard defines 4 classes of transfer @@ -4079,6 +4103,17 @@ The normal answer therefore is N. +include support for the NCR PQS/PDS SCSI card +CONFIG_SCSI_NCR53C8XX_PQS_PDS + This allows the driver to detect a special adapter produced by NCR + corporation called a PCI Quad SCSI or PCI Dual SCSI. You do not need + this if you do not have one of these adapters. However, since this + device is detected as a specific PCI device, this option is quite + safe. This option is only supported by the SYM53C8XX driver (not + by the NCR53C8XX driver). + + The common answer here is N, but answering Y is safe. + IBMMCA SCSI support CONFIG_SCSI_IBMMCA This is support for the IBM SCSI adapter found in many of the PS/2 @@ -7613,8 +7648,7 @@ set, which covers most West European languages such as Albanian, Catalan, Danish, Dutch, English, Faeroese, Finnish, French, German, Galician, Irish, Icelandic, Italian, Norwegian, Portuguese, Spanish, - Swedish, and Valencian. It is also the default for the US. If - unsure, say Y. + and Swedish. It is also the default for the US. If unsure, say Y. nls iso8859-2 CONFIG_NLS_ISO8859_2 @@ -7706,7 +7740,7 @@ set, which covers most West European languages such as Albanian, Catalan, Danish, Dutch, English, Estonian, Faeroese, Finnish, French, German, Galician, Irish, Icelandic, Italian, Norwegian, - Portuguese, Spanish, Swedish, and Valencian. Latin 9 is an update to + Portuguese, Spanish, and Swedish. Latin 9 is an update to Latin 1 (ISO 8859-1) that removes a handful of rarely used characters and instead adds support for Estonian, corrects the support for French and Finnish, and adds the new Euro character. If diff -u --recursive --new-file v2.2.5/linux/Documentation/fb/vesafb.txt linux/Documentation/fb/vesafb.txt --- v2.2.5/linux/Documentation/fb/vesafb.txt Tue Feb 23 15:21:31 1999 +++ linux/Documentation/fb/vesafb.txt Mon Apr 12 09:57:34 1999 @@ -88,25 +88,63 @@ with a broken console (and vesafb cannot do anything about this). +Refresh rates +============= + +There is no way to change the vesafb video mode and/or timings after +booting linux. If you are not happy with the 60 Hz refresh rate, you +have these options: + + * configure and load the DOS-Tools for your the graphics board (if + available) and boot linux with loadlin. + * use a native driver (matroxfb/atyfb) instead if vesafb. If none + is available, write a new one! + * VBE 3.0 might work too. I havn't neither a gfx board with VBE 3.0 + support nor the specs, so I havn't checked this yet. But maybe... + + Configuration ============= -You can pass kernel command line options to vesafb with -"video=vesa:option1". Multiple options should be separated -by comma. Accepted options: - -invers - no comment... -redraw - scroll by redrawing the affected part of the screen -ypan - enable display panning using the VESA protected mode - interface. This enables the Shift-PgUp scrollback - thing and greatly speeds up fullscreen scrolling. - It is slower than "redraw" when scrolling only a halve - screen. This is the default. -ywrap - If your gfx board supports wrap-around, use this one - instead of ypan. -nopal - Don't use the protected mode interface for palette - changes. vesafb will try the standard vga registers - instead. +The VESA BIOS provides protected mode interface for changing +some parameters. vesafb can use it for palette changes and +to pan the display. It is turned off by default becauce it +seems not to work with some BIOS versions, but there are options +to turn it on. + +You can pass options to vesafb using "video=vesa:option" on +the kernel command line. Multiple options should be separated +by comma, like this: "video=vesa:ypan,invers" + +Accepted options: + +invers no comment... + +ypan enable display panning using the VESA protected mode + interface. The visible screen is just a window of the + video memory, console scrolling is done by changing the + start of the window. + pro: * scrolling (fullscreen) is fast, becauce there is + no need to copy around data. + * You'll get scrollback (the Shift-PgUp thing), + the video memory can be used as scrollback buffer + kontra: * scrolling only parts of the screen causes some + ugly flicker effects (boot logo flickers for + example). + +ywrap Same as ypan, but assumes your gfx board can wrap-around + the video memory (i.e. starts reading from top if it + reaches the end of video memory). Faster than ypan. + +redraw scroll by redrawing the affected part of the screen, this + is the safe (and slow) default. + + +vgapal Use the standard vga registers for palette changes. + This is the default. +pmipal Use the protected mode interface for palette changes. + +mtrr setup memory type range registers for the vesafb framebuffer. Have fun! @@ -114,7 +152,7 @@ Gerd -- -Gerd Knorr +Gerd Knorr Minor (mostly typo) changes by Nico Schmoigl diff -u --recursive --new-file v2.2.5/linux/Documentation/filesystems/00-INDEX linux/Documentation/filesystems/00-INDEX --- v2.2.5/linux/Documentation/filesystems/00-INDEX Wed Jun 24 22:54:01 1998 +++ linux/Documentation/filesystems/00-INDEX Mon Apr 12 09:53:45 1999 @@ -20,6 +20,8 @@ - info on using filesystems with the SMB protocol (Windows 3.11 and NT) sysv-fs.txt - info on the SystemV/Coherent filesystem. +ufs.txt + - info on the ufs filesystem. umsdos.txt - info on the umsdos extensions to the msdos filesystem. vfat.txt diff -u --recursive --new-file v2.2.5/linux/Documentation/filesystems/ufs.txt linux/Documentation/filesystems/ufs.txt --- v2.2.5/linux/Documentation/filesystems/ufs.txt Wed Dec 31 16:00:00 1969 +++ linux/Documentation/filesystems/ufs.txt Fri Apr 16 08:20:23 1999 @@ -0,0 +1,49 @@ +USING UFS +========= + +mount -t ufs -o ufstype=type_of_ufs device dir + + +UFS OPTIONS +=========== + +ufstype=type_of_ufs + UFS is a file system widely used in different operating systems. + The problem are differencies among implementations. Features of + some implementations are undocumented, so its hard to recognize + type of ufs automatically. That's why user must specify type of + ufs manually by mount option ufstype. Possible values are: + + old old format of ufs + default value, supported os read-only + + 44bsd used in FreeBSD, NetBSD, OpenBSD + supported os read-write + + sun used in SunOS (Solaris) + supported as read-write + + sunx86 used in SunOS for Intel (Solarisx86) + supported as read-write + + nextstep + used in NextStep + supported as read-only + + openstep + used in OpenStep + supported as read-only + + +POSSIBLE PROBLEMS +================= + +There is still bug in reallocation of fragment, in file fs/ufs/balloc.c, +line 364. But it seem working on current buffer cache configuration. + + +BUG REPORTS +=========== + +Any ufs bug report you can send to daniel.pirkl@email.cz (do not send +partition tables bug reports.) diff -u --recursive --new-file v2.2.5/linux/Documentation/sound/PCM1-pro linux/Documentation/sound/PCM1-pro --- v2.2.5/linux/Documentation/sound/PCM1-pro Wed Dec 31 16:00:00 1969 +++ linux/Documentation/sound/PCM1-pro Mon Apr 12 16:18:27 1999 @@ -0,0 +1,17 @@ +In Documentation/sound/README.OSS was a remark saying noone was sure the +mixer on the PCM1-pro worked with the ACI driver. Well, it does. +I've been using the drivers for the MAD16 and the driver for the mixer +since kernel 2.0.32 with a MiroSound PCM1-pro and it works great. + +I've got it working with the following configuration: + +MAD16 audio I/O base = 530 +MAD16 audio IRQ = 7 +MAD16 Audio DMA = 1 +MAD16 MIDI I/O = 330 +MAD16 MIDI IRQ = 9 + +And I've enabled the ACI mixer (miro PCM12) . + + +Bas van der Linden. diff -u --recursive --new-file v2.2.5/linux/Documentation/sound/mwave linux/Documentation/sound/mwave --- v2.2.5/linux/Documentation/sound/mwave Thu Jul 16 18:09:22 1998 +++ linux/Documentation/sound/mwave Mon Apr 12 16:18:27 1999 @@ -1,14 +1,8 @@ How to try to survive an IBM Mwave under Linux SB drivers -* IBM refuses to provide documentation. If anyone can ever find out what - MWD50430.EXE actually does to load firmware then this comedy could go - away. - -* If you'd like to ask IBM why they don't release Mwave information. - phone IBM (425-556-8822) and ask them why they still haven't - released any documentation. - [http://204.200.238.31/cgi-bin/link.pl?co=i&cl=/ts/ibm/contact.html] ++ IBM have now released documentation of sorts and Torsten is busy + trying to make the Mwave work. This is not however a trivial task. ---------------------------------------------------------------------------- diff -u --recursive --new-file v2.2.5/linux/Documentation/sysctl/README linux/Documentation/sysctl/README --- v2.2.5/linux/Documentation/sysctl/README Fri Jan 8 22:35:59 1999 +++ linux/Documentation/sysctl/README Mon Apr 12 10:10:27 1999 @@ -1,5 +1,5 @@ -Documentation for /proc/sys/ kernel version 2.1.128 - (c) 1998, Rik van Riel +Documentation for /proc/sys/ kernel version 2.2.5 + (c) 1998, 1999, Rik van Riel 'Why', I hear you ask, 'would anyone even _want_ documentation for them sysctl files? If anybody really needs it, it's all in @@ -12,9 +12,6 @@ Furthermore, the programmers who built sysctl have built it to be actually used, not just for the fun of programming it :-) -If you prefer HTML, feel free to visit the Linux-MM homepage -... - ============================================================== Legal blurb: @@ -34,7 +31,7 @@ you're the last RTFMing person to screw up. In short, e-mail your suggestions, corrections and / or horror -stories to: +stories to: Rik van Riel. @@ -68,6 +65,7 @@ net/ networking stuff, for documentation look in: proc/ +sunrpc/ SUN Remote Procedure Call (NFS) vm/ memory management tuning buffer and cache management diff -u --recursive --new-file v2.2.5/linux/Documentation/sysctl/fs.txt linux/Documentation/sysctl/fs.txt --- v2.2.5/linux/Documentation/sysctl/fs.txt Thu Nov 19 09:56:27 1998 +++ linux/Documentation/sysctl/fs.txt Mon Apr 12 10:10:27 1999 @@ -1,12 +1,12 @@ -Documentation for /proc/sys/fs/* kernel version 2.1.128 - (c) 1998, Rik van Riel +Documentation for /proc/sys/fs/* kernel version 2.2.5 + (c) 1998, 1999, Rik van Riel For general info and legal blurb, please look in README. ============================================================== This file contains documentation for the sysctl files in -/proc/sys/fs/ and is valid for Linux kernel version 2.1. +/proc/sys/fs/ and is valid for Linux kernel version 2.2. The files in this directory can be used to tune and monitor miscellaneous and general things in the operation of the Linux @@ -23,6 +23,8 @@ - inode-max - inode-nr - inode-state +- super-max +- super-nr Documentation for the files in /proc/sys/fs/binfmt_misc is in Documentation/binfmt_misc.txt. @@ -113,4 +115,12 @@ system needs to prune the inode list instead of allocating more. +============================================================== + +super-max & super-nr: +These numbers control the maximum number of superblocks, and +thus the maximum number of mounted filesystems the kernel +can have. You only need to increase super-max if you need to +mount more filesystems than the current value in super-max +allows you to. diff -u --recursive --new-file v2.2.5/linux/Documentation/sysctl/kernel.txt linux/Documentation/sysctl/kernel.txt --- v2.2.5/linux/Documentation/sysctl/kernel.txt Fri Jan 1 12:58:14 1999 +++ linux/Documentation/sysctl/kernel.txt Mon Apr 12 10:10:27 1999 @@ -1,12 +1,12 @@ -Documentation for /proc/sys/kernel/* kernel version 2.1.128 - (c) 1998, Rik van Riel +Documentation for /proc/sys/kernel/* kernel version 2.2.5 + (c) 1998, 1999, Rik van Riel For general info and legal blurb, please look in README. ============================================================== This file contains documentation for the sysctl files in -/proc/sys/kernel/ and is valid for Linux kernel version 2.1. +/proc/sys/kernel/ and is valid for Linux kernel version 2.2. The files in this directory can be used to tune and monitor miscellaneous and general things in the operation of the Linux @@ -24,6 +24,7 @@ - htab-reclaim [ PPC only ] - java-appletviewer [ binfmt_java, obsolete ] - java-interpreter [ binfmt_java, obsolete ] +- l2cr [ PPC only ] - modprobe ==> Documentation/kmod.txt - osrelease - ostype @@ -32,6 +33,8 @@ - printk - real-root-dev ==> Documentation/initrd.txt - reboot-cmd [ SPARC only ] +- rtsig-nr +- rtsig-max - sg-big-buff [ generic SCSI device (sg) ] - shmmax [ sysv ipc ] - version @@ -90,6 +93,13 @@ ============================================================== +l2cr: (PPC only) + +This flag controls the L2 cache of G3 processor boards. If +0, the cache is disabled. Enabled if nonzero. + +============================================================== + osrelease, ostype & version: # cat osrelease @@ -152,6 +162,16 @@ ??? This seems to be a way to give an argument to the Sparc ROM/Flash boot loader. Maybe to tell it what to do after rebooting. ??? + +============================================================== + +rtsig-max & rtsig-nr: + +The file rtsig-max can be used to tune the maximum number +of POSIX realtime (queued) signals that can be outstanding +in the system. + +Rtsig-nr shows the number of RT signals currently queued. ============================================================== diff -u --recursive --new-file v2.2.5/linux/Documentation/sysctl/sunrpc.txt linux/Documentation/sysctl/sunrpc.txt --- v2.2.5/linux/Documentation/sysctl/sunrpc.txt Wed Dec 31 16:00:00 1969 +++ linux/Documentation/sysctl/sunrpc.txt Mon Apr 12 10:10:27 1999 @@ -0,0 +1,20 @@ +Documentation for /proc/sys/sunrpc/* kernel version 2.2.5 + (c) 1998, 1999, Rik van Riel + +For general info and legal blurb, please look in README. + +============================================================== + +This file contains the documentation for the sysctl files in +/proc/sys/sunrpc and is valid for Linux kernel version 2.2. + +The files in this directory can be used to (re)set the debug +flags of the SUN Remote Procedure Call (RPC) subsystem in +the Linux kernel. This stuff is used for NFS, KNFSD and +maybe a few other things as well. + +The files in there are used to control the debugging flags: +rpc_debug, nfs_debug, nfsd_debug and nlm_debug. + +These flags are for kernel hackers only. You should read the +source code in net/sunrpc/ for more information. diff -u --recursive --new-file v2.2.5/linux/Documentation/sysctl/vm.txt linux/Documentation/sysctl/vm.txt --- v2.2.5/linux/Documentation/sysctl/vm.txt Thu Nov 19 09:56:27 1998 +++ linux/Documentation/sysctl/vm.txt Mon Apr 12 10:10:27 1999 @@ -1,27 +1,30 @@ -Documentation for /proc/sys/vm/* kernel version 2.1.128 - (c) 1998, Rik van Riel +Documentation for /proc/sys/vm/* kernel version 2.2.5 + (c) 1998, 1999, Rik van Riel For general info and legal blurb, please look in README. ============================================================== This file contains the documentation for the sysctl files in -/proc/sys/vm and is valid for Linux kernel version 2.1. +/proc/sys/vm and is valid for Linux kernel version 2.2. The files in this directory can be used to tune the operation of the virtual memory (VM) subsystem of the Linux kernel, and one of the files (bdflush) also has a little influence on disk usage. +Default values and initialization routines for most of these +files can be found in mm/swap.c. + Currently, these files are in /proc/sys/vm: - bdflush - buffermem - freepages - kswapd - overcommit_memory +- page-cluster - pagecache - pagetable_cache -- swapctl ============================================================== @@ -100,12 +103,8 @@ The values are: min_percent -- this is the minimum percentage of memory that should be spent on buffer memory -borrow_percent -- when Linux is short on memory, and the - buffer cache uses more memory than this, - the MM subsystem will prune the buffercache - more heavily than other memory -max_percent -- this is the maximum amount of memory that - can be used for buffer memory +borrow_percent -- UNUSED +max_percent -- UNUSED ============================================================== freepages: @@ -162,40 +161,28 @@ overcommit_memory: -This file contains only one value. The following algorithm -is used to decide if there's enough memory. If the value -of overcommit_memory > 0, then there's always enough -memory :-). This is a useful feature, since programs often -malloc() huge amounts of memory 'just in case', while they -only use a small part of it. Leaving this value at 0 will -lead to the failure of such a huge malloc(), when in fact -the system has enough memory for the program to run... -On the other hand, enabling this feature can cause you to -run out of memory and thrash the system to death, so large -and/or important servers will want to set this value to 0. +This value contains a flag that enables memory overcommitment. +When this flag is 0, the kernel checks before each malloc() +to see if there's enough memory left. If the flag is nonzero, +the system pretends there's always enough memory. -From linux/mm/mmap.c: --------------------------------------------------------------- -static inline int vm_enough_memory(long pages) -{ - /* This stupid algorithm decides whether we have enough memory: - * while simple, it should work in most obvious cases. It's - * easily fooled, but this should catch most mistakes. - */ - long freepages; - - /* Sometimes we want to use more memory than we have. */ - if (sysctl_overcommit_memory) - return 1; - - freepages = buffermem >> PAGE_SHIFT; - freepages += page_cache_size; - freepages >>= 1; - freepages += nr_free_pages; - freepages += nr_swap_pages; - freepages -= num_physpages >> 4; - return freepages > pages; -} +This feature can be very useful because there are a lot of +programs that malloc() huge amounts of memory "just-in-case" +and don't much of it. + +Look at: mm/mmap.c::vm_enough_memory() for more information. + +============================================================== + +page-cluster: + +The Linux VM subsystem avoids excessive disk seeks by reading +multiple pages on a page fault. The number of pages it reads +is dependant on the amount of memory in your machine. + +The number of pages the kernel reads in at once is equal to +2 ^ page-cluster. Values above 2 ^ 5 don't make much sense +for swap because we only cluster swap data in 32-page groups. ============================================================== @@ -203,12 +190,17 @@ This file does exactly the same as buffermem, only this file controls the struct page_cache, and thus controls -the amount of memory allowed for memory mapping and generic -caching of files. +the amount of memory used for the page cache. -You don't want the minimum level to be too low, otherwise -your system might thrash when memory is tight or fragmentation -is high... +In 2.2, the page cache is used for 3 main purposes: +- caching read() data from files +- caching mmap()ed data and executable files +- swap cache + +When your system is both deep in swap and high on cache, +it probably means that a lot of the swaped data is being +cached, making for more efficient swapping than possible +with the 2.0 kernel. ============================================================== @@ -226,63 +218,4 @@ For large systems, the settings are probably OK. For normal systems they won't hurt a bit. For small systems (<16MB ram) it might be advantageous to set both values to 0. - -============================================================== - -swapctl: - -This file contains no less than 8 variables. -All of these values are used by kswapd, and the usage can be -found in linux/mm/vmscan.c. - -From linux/include/linux/swapctl.h: --------------------------------------------------------------- -typedef struct swap_control_v5 -{ - unsigned int sc_max_page_age; - unsigned int sc_page_advance; - unsigned int sc_page_decline; - unsigned int sc_page_initial_age; - unsigned int sc_age_cluster_fract; - unsigned int sc_age_cluster_min; - unsigned int sc_pageout_weight; - unsigned int sc_bufferout_weight; -} swap_control_v5; --------------------------------------------------------------- - -The first four variables are used to keep track of Linux's -page aging. Page aging is a bookkeeping method to keep track -of which pages of memory are used often, and which pages can -be swapped out without consequences. - -When a page is swapped in, it starts at sc_page_initial_age -(default 3) and when the page is scanned by kswapd, its age -is adjusted according to the following scheme: -- if the page was used since the last time we scanned, its - age is increased by sc_page_advance (default 3) up to a maximum - of sc_max_page_age (default 20) -- else (it wasn't used) its age is decreased by sc_page_decline - (default 1) -And when a page reaches age 0, it's ready to be swapped out. - -The next four variables can be used to control kswapd's -aggressiveness in swapping out pages. - -sc_age_cluster_fract is used to calculate how many pages from -a process are to be scanned by kswapd. The formula used is -sc_age_cluster_fract/1024 * RSS, so if you want kswapd to scan -the whole process, sc_age_cluster_fract needs to have a value -of 1024. The minimum number of pages kswapd will scan is -represented by sc_age_cluster_min, this is done so kswapd will -also scan small processes. - -The values of sc_pageout_weight and sc_bufferout_weight are -used to control how many tries kswapd will make in order -to swapout one page / buffer. These values can be used to -fine-tune the ratio between user pages and buffer/cache memory. -When you find that your Linux system is swapping out too many -process pages in order to satisfy buffer memory demands, you -might want to either increase sc_bufferout_weight, or decrease -the value of sc_pageout_weight. - diff -u --recursive --new-file v2.2.5/linux/MAINTAINERS linux/MAINTAINERS --- v2.2.5/linux/MAINTAINERS Tue Mar 23 14:35:46 1999 +++ linux/MAINTAINERS Fri Apr 16 11:57:44 1999 @@ -395,7 +395,7 @@ P: Dag Brattli M: Dag Brattli L: linux-irda@list.uit.no -W: http://www.cs.uit.no/~dagb/irda/ +W: http://www.cs.uit.no/linux-irda/ S: Maintained ISDN SUBSYSTEM @@ -641,6 +641,13 @@ P: Eberhard Moenkeberg M: emoenke@gwdg.de L: linux-kernel@vger.rutgers.edu +S: Maintained + +SCSI SG DRIVER +P: Doug Gilbert +M: dgilbert@interlog.com +L: linux-scsi@vger.rutgers.edu +W: http://www.torque.net/sg S: Maintained SCSI SUBSYSTEM diff -u --recursive --new-file v2.2.5/linux/Makefile linux/Makefile --- v2.2.5/linux/Makefile Mon Mar 29 11:09:11 1999 +++ linux/Makefile Fri Apr 16 08:20:23 1999 @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 2 -SUBLEVEL = 5 +SUBLEVEL = 6 EXTRAVERSION = ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) @@ -343,7 +343,8 @@ clean: archclean rm -f kernel/ksyms.lst include/linux/compile.h - rm -f core `find . -name '*.[oas]' ! -regex '.*lxdialog/.*' -print` + rm -f core `find . -name '*.[oas]' ! -regex '.*lxdialog/.*' \ + ! -regex '.*ksymoops/.*' -print` rm -f core `find . -type f -name 'core' -print` rm -f core `find . -name '.*.flags' -print` rm -f vmlinux System.map @@ -367,6 +368,7 @@ rm -f .version .config* config.in config.old rm -f scripts/tkparse scripts/kconfig.tk scripts/kconfig.tmp rm -f scripts/lxdialog/*.o scripts/lxdialog/lxdialog + rm -f scripts/ksymoops/*.o scripts/ksymoops/ksymoops rm -f .menuconfig.log rm -f include/asm rm -rf include/config @@ -379,8 +381,8 @@ distclean: mrproper rm -f core `find . \( -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 + -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ + -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS backup: mrproper cd .. && tar cf - linux/ | gzip -9 > backup.gz diff -u --recursive --new-file v2.2.5/linux/arch/alpha/lib/io.c linux/arch/alpha/lib/io.c --- v2.2.5/linux/arch/alpha/lib/io.c Wed Sep 9 14:51:04 1998 +++ linux/arch/alpha/lib/io.c Thu Apr 15 05:42:31 1999 @@ -405,15 +405,16 @@ * Copy data from "real" memory space to IO memory space. * This needs to be optimized. */ -void _memcpy_toio(unsigned long to, void * from, long count) +void _memcpy_toio(unsigned long to, const void * from, long count) { /* Optimize co-aligned transfers. Everything else gets handled a byte at a time. */ + /* FIXME -- align FROM. */ if (count >= 8 && (to & 7) == ((long)from & 7)) { count -= 8; do { - writeq(*(u64 *)from, to); + writeq(*(const u64 *)from, to); count -= 8; to += 8; from += 8; @@ -424,7 +425,7 @@ if (count >= 4 && (to & 3) == ((long)from & 3)) { count -= 4; do { - writel(*(u32 *)from, to); + writel(*(const u32 *)from, to); count -= 4; to += 4; from += 4; @@ -435,7 +436,7 @@ if (count >= 2 && (to & 1) == ((long)from & 1)) { count -= 2; do { - writew(*(u16 *)from, to); + writew(*(const u16 *)from, to); count -= 2; to += 2; from += 2; @@ -444,7 +445,7 @@ } while (count > 0) { - writeb(*(u8 *) from, to); + writeb(*(const u8 *) from, to); count--; to++; from++; diff -u --recursive --new-file v2.2.5/linux/arch/i386/defconfig linux/arch/i386/defconfig --- v2.2.5/linux/arch/i386/defconfig Wed Mar 10 15:29:45 1999 +++ linux/arch/i386/defconfig Mon Apr 12 13:12:57 1999 @@ -174,12 +174,14 @@ # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_NCR53C7xx is not set -CONFIG_SCSI_NCR53C8XX=y +# CONFIG_SCSI_NCR53C8XX is not set +CONFIG_SCSI_SYM53C8XX=y CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=4 CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32 CONFIG_SCSI_NCR53C8XX_SYNC=20 # CONFIG_SCSI_NCR53C8XX_PROFILE is not set # CONFIG_SCSI_NCR53C8XX_IOMAPPED is not set +# CONFIG_SCSI_NCR53C8XX_PQS_PDS is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PCI2000 is not set # CONFIG_SCSI_PCI2220I is not set diff -u --recursive --new-file v2.2.5/linux/arch/i386/kernel/io_apic.c linux/arch/i386/kernel/io_apic.c --- v2.2.5/linux/arch/i386/kernel/io_apic.c Tue Feb 23 15:21:32 1999 +++ linux/arch/i386/kernel/io_apic.c Thu Apr 15 08:59:42 1999 @@ -293,7 +293,8 @@ for (i = 0; i < mp_irq_entries; i++) { int lbus = mp_irqs[i].mpc_srcbus; - if ((mp_bus_id_to_type[lbus] == MP_BUS_ISA) && + if ((mp_bus_id_to_type[lbus] == MP_BUS_ISA || + mp_bus_id_to_type[lbus] == MP_BUS_EISA) && (mp_irqs[i].mpc_irqtype == type) && (mp_irqs[i].mpc_srcbusirq == 0x00)) @@ -326,20 +327,7 @@ } /* - * Unclear documentation on what a "conforming ISA interrupt" means. - * - * Should we, or should we not, take the ELCR register into account? - * It's part of the EISA specification, but maybe it should only be - * used if the interrupt is actually marked as EISA? - * - * Oh, well. Don't do it until somebody tells us what the right thing - * to do is.. - */ -#undef USE_ELCR_TRIGGER_LEVEL -#ifdef USE_ELCR_TRIGGER_LEVEL - -/* - * ISA Edge/Level control register, ELCR + * EISA Edge/Level control register, ELCR */ static int __init EISA_ELCR(unsigned int irq) { @@ -349,18 +337,22 @@ } printk("Broken MPtable reports ISA irq %d\n", irq); return 0; -} +} -#define default_ISA_trigger(idx) (EISA_ELCR(mp_irqs[idx].mpc_dstirq)) -#define default_ISA_polarity(idx) (0) +/* EISA interrupts are always polarity zero and can be edge or level + * trigger depending on the ELCR value. If an interrupt is listed as + * EISA conforming in the MP table, that means its trigger type must + * be read in from the ELCR */ -#else +#define default_EISA_trigger(idx) (EISA_ELCR(mp_irqs[idx].mpc_dstirq)) +#define default_EISA_polarity(idx) (0) + +/* ISA interrupts are always polarity zero edge triggered, even when + * listed as conforming in the MP table. */ #define default_ISA_trigger(idx) (0) #define default_ISA_polarity(idx) (0) -#endif - static int __init MPBIOS_polarity(int idx) { int bus = mp_irqs[idx].mpc_srcbus; @@ -380,6 +372,11 @@ polarity = default_ISA_polarity(idx); break; } + case MP_BUS_EISA: + { + polarity = default_EISA_polarity(idx); + break; + } case MP_BUS_PCI: /* PCI pin */ { polarity = 1; @@ -439,6 +436,11 @@ trigger = default_ISA_trigger(idx); break; } + case MP_BUS_EISA: + { + trigger = default_EISA_trigger(idx); + break; + } case MP_BUS_PCI: /* PCI pin, level */ { trigger = 1; @@ -503,6 +505,7 @@ switch (mp_bus_id_to_type[bus]) { case MP_BUS_ISA: /* ISA pin */ + case MP_BUS_EISA: { irq = mp_irqs[idx].mpc_srcbusirq; break; @@ -910,6 +913,8 @@ static void __init construct_default_ISA_mptable(void) { int i, pos = 0; + const int bus_type = (mpc_default_type == 2 || mpc_default_type == 3 || + mpc_default_type == 6) ? MP_BUS_EISA : MP_BUS_ISA; for (i = 0; i < 16; i++) { if (!IO_APIC_IRQ(i)) @@ -917,14 +922,14 @@ mp_irqs[pos].mpc_irqtype = mp_INT; mp_irqs[pos].mpc_irqflag = 0; /* default */ - mp_irqs[pos].mpc_srcbus = MP_BUS_ISA; + mp_irqs[pos].mpc_srcbus = 0; mp_irqs[pos].mpc_srcbusirq = i; mp_irqs[pos].mpc_dstapic = 0; mp_irqs[pos].mpc_dstirq = i; pos++; } mp_irq_entries = pos; - mp_bus_id_to_type[0] = MP_BUS_ISA; + mp_bus_id_to_type[0] = bus_type; /* * MP specification 1.4 defines some extra rules for default @@ -1178,13 +1183,23 @@ */ if (i < 16) disable_8259A_irq(i); - } else + } else { + if (!IO_APIC_IRQ(i)) + continue; + /* - * we have no business changing low ISA - * IRQs. + * Hmm.. We don't have an entry for this, + * so default to an old-fashioned 8259 + * interrupt if we can.. */ - if (IO_APIC_IRQ(i)) - irq_desc[i].handler = &no_irq_type; + if (i < 16) { + make_8259A_irq(i); + continue; + } + + /* Strange. Oh, well.. */ + irq_desc[i].handler = &no_irq_type; + } } init_IRQ_SMP(); } diff -u --recursive --new-file v2.2.5/linux/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c --- v2.2.5/linux/arch/i386/kernel/irq.c Tue Feb 23 15:21:32 1999 +++ linux/arch/i386/kernel/irq.c Thu Apr 15 09:03:06 1999 @@ -151,10 +151,7 @@ */ static unsigned int cached_irq_mask = 0xffff; -#define __byte(x,y) (((unsigned char *)&(y))[x]) -#define __word(x,y) (((unsigned short *)&(y))[x]) -#define __long(x,y) (((unsigned int *)&(y))[x]) - +#define __byte(x,y) (((unsigned char *)&(y))[x]) #define cached_21 (__byte(0,cached_irq_mask)) #define cached_A1 (__byte(1,cached_irq_mask)) @@ -207,7 +204,7 @@ void make_8259A_irq(unsigned int irq) { disable_irq(irq); - __long(0,io_apic_irqs) &= ~(1< @@ -49,12 +52,12 @@ * Other miscellaneous information follows. */ -typedef enum { - MCA_ADAPTER_NORMAL = 0, - MCA_ADAPTER_NONE = 1, - MCA_ADAPTER_DISABLED = 2, - MCA_ADAPTER_ERROR = 3 -} MCA_AdapterStatus; +typedef enum { + MCA_ADAPTER_NORMAL = 0, + MCA_ADAPTER_NONE = 1, + MCA_ADAPTER_DISABLED = 2, + MCA_ADAPTER_ERROR = 3 +} MCA_AdapterStatus; struct MCA_adapter { MCA_AdapterStatus status; /* is there a valid adapter? */ @@ -69,16 +72,17 @@ }; struct MCA_info { -/* one for each of the 8 possible slots, plus one for integrated SCSI - and one for integrated video. */ + /* one for each of the 8 possible slots, plus one for integrated SCSI + * and one for integrated video. + */ struct MCA_adapter slot[MCA_NUMADAPTERS]; -/* two potential addresses for integrated SCSI adapter - this will - * track which one we think it is - */ + /* two potential addresses for integrated SCSI adapter - this will + * track which one we think it is. + */ - unsigned char which_scsi; + unsigned char which_scsi; }; /* The mca_info structure pointer. If MCA bus is present, the function @@ -102,10 +106,10 @@ #ifdef CONFIG_PROC_FS -static void mca_do_proc_init( void ); -static int mca_default_procfn( char* buf, int slot ); +static void mca_do_proc_init(void); +static int mca_default_procfn(char* buf, int slot); -static ssize_t proc_mca_read( struct file*, char*, size_t, loff_t *); +static ssize_t proc_mca_read(struct file*, char*, size_t, loff_t *); static struct file_operations proc_mca_operations = { NULL, /* array_lseek */ @@ -146,13 +150,13 @@ /* Build the status info for the adapter */ -static void mca_configure_adapter_status( int slot ) { +static void mca_configure_adapter_status(int slot) { mca_info->slot[slot].status = MCA_ADAPTER_NONE; mca_info->slot[slot].id = mca_info->slot[slot].pos[0] + (mca_info->slot[slot].pos[1] << 8); - if( !mca_info->slot[slot].id ) { + if(!mca_info->slot[slot].id && slot < MCA_MAX_SLOT_NR) { /* id = 0x0000 usually indicates hardware failure, * however, ZP Gu (zpg@castle.net> reports that his 9556 @@ -162,7 +166,7 @@ mca_info->slot[slot].status = MCA_ADAPTER_ERROR; return; - } else if( mca_info->slot[slot].id != 0xffff ) { + } else if(mca_info->slot[slot].id != 0xffff) { /* 0xffff usually indicates that there's no adapter, * however, some integrated adapters may have 0xffff as @@ -174,21 +178,21 @@ mca_info->slot[slot].status = MCA_ADAPTER_NORMAL; } - if( (mca_info->slot[slot].id == 0xffff || - mca_info->slot[slot].id == 0x0000) && slot >= MCA_MAX_SLOT_NR ) { + if((mca_info->slot[slot].id == 0xffff || + mca_info->slot[slot].id == 0x0000) && slot >= MCA_MAX_SLOT_NR) { int j; - for( j = 2; j < 8; j++ ) { - if( mca_info->slot[slot].pos[j] != 0xff ) { + for(j = 2; j < 8; j++) { + if(mca_info->slot[slot].pos[j] != 0xff) { mca_info->slot[slot].status = MCA_ADAPTER_NORMAL; break; } } } - if( !(mca_info->slot[slot].pos[2] & MCA_ENABLED) ) { + if(!(mca_info->slot[slot].pos[2] & MCA_ENABLED)) { - /* enabled bit is in pos 2 */ + /* enabled bit is in POS 2 */ mca_info->slot[slot].status = MCA_ADAPTER_DISABLED; } @@ -198,22 +202,22 @@ __initfunc(void mca_init(void)) { - unsigned int i, j; + unsigned int i, j; unsigned long flags; /* WARNING: Be careful when making changes here. Putting an adapter - * and the motherboard simultaneously into setup mode may result in - * damage to chips (according to The Indispensible PC Hardware Book - * by Hans-Peter Messmer). Also, we disable system interrupts (so + * and the motherboard simultaneously into setup mode may result in + * damage to chips (according to The Indispensible PC Hardware Book + * by Hans-Peter Messmer). Also, we disable system interrupts (so * that we are not disturbed in the middle of this). */ /* Make sure the MCA bus is present */ - if (!MCA_bus) + if(!MCA_bus) return; - printk( "Micro Channel bus detected.\n" ); - save_flags( flags ); + printk("Micro Channel bus detected.\n"); + save_flags(flags); cli(); /* Allocate MCA_info structure (at address divisible by 8) */ @@ -225,67 +229,68 @@ outb_p(0, MCA_ADAPTER_SETUP_REG); /* Put motherboard into video setup mode, read integrated video - * pos registers, and turn motherboard setup off. + * POS registers, and turn motherboard setup off. */ outb_p(0xdf, MCA_MOTHERBOARD_SETUP_REG); mca_info->slot[MCA_INTEGVIDEO].name[0] = 0; - for (j=0; j<8; j++) { - mca_info->slot[MCA_INTEGVIDEO].pos[j] = inb_p(MCA_POS_REG(j)); + for(j=0; j<8; j++) { + mca_info->slot[MCA_INTEGVIDEO].pos[j] = inb_p(MCA_POS_REG(j)); } mca_configure_adapter_status(MCA_INTEGVIDEO); /* Put motherboard into scsi setup mode, read integrated scsi - * pos registers, and turn motherboard setup off. + * POS registers, and turn motherboard setup off. * - * It seems there are two possible SCSI registers. Martin says that + * It seems there are two possible SCSI registers. Martin says that * for the 56,57, 0xf7 is the one, but fails on the 76. * Alfredo (apena@vnet.ibm.com) says - * 0xfd works on his machine. We'll try both of them. I figure it's - * a good bet that only one could be valid at a time. This could + * 0xfd works on his machine. We'll try both of them. I figure it's + * a good bet that only one could be valid at a time. This could * screw up though if one is used for something else on the other * machine. */ outb_p(0xf7, MCA_MOTHERBOARD_SETUP_REG); mca_info->slot[MCA_INTEGSCSI].name[0] = 0; - for (j=0; j<8; j++) { - if( (mca_info->slot[MCA_INTEGSCSI].pos[j] = inb_p(MCA_POS_REG(j))) != 0xff ) + for(j=0; j<8; j++) { + if((mca_info->slot[MCA_INTEGSCSI].pos[j] = inb_p(MCA_POS_REG(j))) != 0xff) { - /* 0xff all across means no device. 0x00 means something's - * broken, but a device is probably there. However, if you get - * 0x00 from a motherboard register it won't matter what we - * find. For the record, on the 57SLC, the integrated SCSI - * adapter has 0xffff for the adapter ID, but nonzero for - * other registers. + /* 0xff all across means no device. 0x00 means + * something's broken, but a device is probably there. + * However, if you get 0x00 from a motherboard + * register it won't matter what we find. For the + * record, on the 57SLC, the integrated SCSI + * adapter has 0xffff for the adapter ID, but + * nonzero for other registers. */ mca_info->which_scsi = 0xf7; } } - if( !mca_info->which_scsi ) { + if(!mca_info->which_scsi) { /* Didn't find it at 0xf7, try somewhere else... */ mca_info->which_scsi = 0xfd; outb_p(0xfd, MCA_MOTHERBOARD_SETUP_REG); - for (j=0; j<8; j++) - mca_info->slot[MCA_INTEGSCSI].pos[j] = inb_p(MCA_POS_REG(j)); + for(j=0; j<8; j++) + mca_info->slot[MCA_INTEGSCSI].pos[j] = inb_p(MCA_POS_REG(j)); } mca_configure_adapter_status(MCA_INTEGSCSI); - /* turn off motherboard setup */ + /* Turn off motherboard setup */ outb_p(0xff, MCA_MOTHERBOARD_SETUP_REG); /* Now loop over MCA slots: put each adapter into setup mode, and - * read its pos registers. Then put adapter setup off. + * read its POS registers. Then put adapter setup off. */ - for (i=0; islot[i].pos[j]=inb_p(MCA_POS_REG(j)); + for(j=0; j<8; j++) { + mca_info->slot[i].pos[j]=inb_p(MCA_POS_REG(j)); } mca_info->slot[i].name[0] = 0; mca_info->slot[i].driver_loaded = 0; @@ -295,7 +300,7 @@ /* Enable interrupts and return memory start */ - restore_flags( flags ); + restore_flags(flags); request_region(0x60,0x01,"system control port B (MCA)"); request_region(0x90,0x01,"arbitration (MCA)"); @@ -312,89 +317,90 @@ /*--------------------------------------------------------------------*/ -static void mca_handle_nmi_slot( int slot, int check_flag ) +static void mca_handle_nmi_slot(int slot, int check_flag) { - if( slot < MCA_MAX_SLOT_NR ) { - printk( "NMI: caused by MCA adapter in slot %d (%s)\n", slot+1, - mca_info->slot[slot].name ); - } else if( slot == MCA_INTEGSCSI ) { - printk( "NMI: caused by MCA integrated SCSI adapter (%s)\n", - mca_info->slot[slot].name ); - } else if( slot == MCA_INTEGVIDEO ) { - printk( "NMI: caused by MCA integrated video adapter (%s)\n", - mca_info->slot[slot].name ); - } - - /* more info available in pos 6 and 7? */ - - if( check_flag ) { - unsigned char pos6, pos7; - - pos6 = mca_read_pos( slot, 6 ); - pos7 = mca_read_pos( slot, 7 ); - - printk( "NMI: POS 6 = 0x%x, POS 7 = 0x%x\n", pos6, pos7 ); - } - -} /* mca_handle_nmi_slot */ - -/*--------------------------------------------------------------------*/ + if(slot < MCA_MAX_SLOT_NR) { + printk("NMI: caused by MCA adapter in slot %d (%s)\n", slot+1, + mca_info->slot[slot].name); + } else if(slot == MCA_INTEGSCSI) { + printk("NMI: caused by MCA integrated SCSI adapter (%s)\n", + mca_info->slot[slot].name); + } else if(slot == MCA_INTEGVIDEO) { + printk("NMI: caused by MCA integrated video adapter (%s)\n", + mca_info->slot[slot].name); + } + + /* More info available in POS 6 and 7? */ + + if(check_flag) { + unsigned char pos6, pos7; + + pos6 = mca_read_pos(slot, 6); + pos7 = mca_read_pos(slot, 7); + + printk("NMI: POS 6 = 0x%x, POS 7 = 0x%x\n", pos6, pos7); + } + +} /* mca_handle_nmi_slot */ + +/*--------------------------------------------------------------------*/ -void mca_handle_nmi( void ) +void mca_handle_nmi(void) { int i; - unsigned char pos5; - - /* First try - scan the various adapters and see if a specific - * adapter was responsible for the error - */ - - for( i = 0; i < MCA_NUMADAPTERS; i += 1 ) { - - /* bit 7 of POS 5 is reset when this adapter has a hardware - * error. bit 7 it reset if there's error information - * available in pos 6 and 7. */ - - pos5 = mca_read_pos( i, 5 ); - - if( !(pos5 & 0x80) ) { - mca_handle_nmi_slot( i, !(pos5 & 0x40) ); - return; - } - } - - /* if I recall correctly, there's a whole bunch of other things that - * we can do to check for NMI problems, but that's all I know about + unsigned char pos5; + + /* First try - scan the various adapters and see if a specific + * adapter was responsible for the error. + */ + + for(i = 0; i < MCA_NUMADAPTERS; i++) { + + /* Bit 7 of POS 5 is reset when this adapter has a hardware + * error. Bit 7 it reset if there's error information + * available in POS 6 and 7. + */ + + pos5 = mca_read_pos(i, 5); + + if(!(pos5 & 0x80)) { + mca_handle_nmi_slot(i, !(pos5 & 0x40)); + return; + } + } + + /* If I recall correctly, there's a whole bunch of other things that + * we can do to check for NMI problems, but that's all I know about * at the moment. - */ + */ - printk( "NMI generated from unknown source!\n" ); -} /* mca_handle_nmi */ + printk("NMI generated from unknown source!\n"); +} /* mca_handle_nmi */ /*--------------------------------------------------------------------*/ -int mca_find_adapter( int id, int start ) +int mca_find_adapter(int id, int start) { - if( mca_info == 0 || id == 0 || id == 0xffff ) { + if(mca_info == 0 || id == 0 || id == 0xffff) { return MCA_NOTFOUND; } - for( ; start >= 0 && start < MCA_NUMADAPTERS; start += 1 ) { + for(; start >= 0 && start < MCA_NUMADAPTERS; start++) { - /* not sure about this. There's no point in returning + /* Not sure about this. There's no point in returning * adapters that aren't enabled, since they can't actually - * be used. However, they might be needed for statistical + * be used. However, they might be needed for statistical * purposes or something... But if that is the case, the * user is free to write a routine that manually iterates * through the adapters. */ - if( mca_info->slot[start].status == MCA_ADAPTER_DISABLED ) { + if(mca_info->slot[start].status == MCA_ADAPTER_DISABLED) { continue; } - if( id == mca_info->slot[start].id ) { + if(id == mca_info->slot[start].id) { return start; } } @@ -404,28 +410,28 @@ /*--------------------------------------------------------------------*/ -int mca_find_unused_adapter( int id, int start ) +int mca_find_unused_adapter(int id, int start) { - if( mca_info == 0 || id == 0 || id == 0xffff ) { + if(mca_info == 0 || id == 0 || id == 0xffff) { return MCA_NOTFOUND; } - for( ; start >= 0 && start < MCA_NUMADAPTERS; start += 1 ) { + for(; start >= 0 && start < MCA_NUMADAPTERS; start++) { - /* not sure about this. There's no point in returning + /* not sure about this. There's no point in returning * adapters that aren't enabled, since they can't actually - * be used. However, they might be needed for statistical + * be used. However, they might be needed for statistical * purposes or something... But if that is the case, the * user is free to write a routine that manually iterates * through the adapters. */ - if( mca_info->slot[start].status == MCA_ADAPTER_DISABLED || - mca_info->slot[start].driver_loaded ) { + if(mca_info->slot[start].status == MCA_ADAPTER_DISABLED || + mca_info->slot[start].driver_loaded) { continue; } - if( id == mca_info->slot[start].id ) { + if(id == mca_info->slot[start].id) { return start; } } @@ -435,68 +441,68 @@ /*--------------------------------------------------------------------*/ -unsigned char mca_read_stored_pos( int slot, int reg ) +unsigned char mca_read_stored_pos(int slot, int reg) { - if( slot < 0 || slot >= MCA_NUMADAPTERS || mca_info == 0 ) return 0; - if( reg < 0 || reg >= 8 ) return 0; + if(slot < 0 || slot >= MCA_NUMADAPTERS || mca_info == 0) return 0; + if(reg < 0 || reg >= 8) return 0; return mca_info->slot[slot].pos[reg]; } /* mca_read_stored_pos() */ /*--------------------------------------------------------------------*/ -unsigned char mca_read_pos( int slot, int reg ) +unsigned char mca_read_pos(int slot, int reg) { unsigned int byte = 0; unsigned long flags; - if( slot < 0 || slot >= MCA_NUMADAPTERS || mca_info == 0 ) return 0; - if( reg < 0 || reg >= 8 ) return 0; + if(slot < 0 || slot >= MCA_NUMADAPTERS || mca_info == 0) return 0; + if(reg < 0 || reg >= 8) return 0; - save_flags( flags ); + save_flags(flags); cli(); - /* make sure motherboard setup is off */ + /* Make sure motherboard setup is off */ outb_p(0xff, MCA_MOTHERBOARD_SETUP_REG); - /* read in the appropriate register */ + /* Read in the appropriate register */ - if( slot == MCA_INTEGSCSI && mca_info->which_scsi ) { + if(slot == MCA_INTEGSCSI && mca_info->which_scsi) { - /* disable adapter setup, enable motherboard setup */ + /* Disable adapter setup, enable motherboard setup */ outb_p(0, MCA_ADAPTER_SETUP_REG); outb_p(mca_info->which_scsi, MCA_MOTHERBOARD_SETUP_REG); byte = inb_p(MCA_POS_REG(reg)); outb_p(0xff, MCA_MOTHERBOARD_SETUP_REG); - } else if( slot == MCA_INTEGVIDEO ) { + } else if(slot == MCA_INTEGVIDEO) { - /* disable adapter setup, enable motherboard setup */ + /* Disable adapter setup, enable motherboard setup */ outb_p(0, MCA_ADAPTER_SETUP_REG); outb_p(0xdf, MCA_MOTHERBOARD_SETUP_REG); byte = inb_p(MCA_POS_REG(reg)); outb_p(0xff, MCA_MOTHERBOARD_SETUP_REG); - } else if( slot < MCA_MAX_SLOT_NR ) { + } else if(slot < MCA_MAX_SLOT_NR) { - /* make sure motherboard setup is off */ + /* Make sure motherboard setup is off */ outb_p(0xff, MCA_MOTHERBOARD_SETUP_REG); - /* read the appropriate register */ + /* Read the appropriate register */ outb_p(0x8|(slot&0xf), MCA_ADAPTER_SETUP_REG); byte = inb_p(MCA_POS_REG(reg)); outb_p(0, MCA_ADAPTER_SETUP_REG); } - /* make sure the stored values are consistent, while we're here */ + /* Make sure the stored values are consistent, while we're here */ mca_info->slot[slot].pos[reg] = byte; - restore_flags( flags ); + restore_flags(flags); return byte; } /* mca_read_pos() */ @@ -513,44 +519,47 @@ * screws up. */ -void mca_write_pos( int slot, int reg, unsigned char byte ) +void mca_write_pos(int slot, int reg, unsigned char byte) { unsigned long flags; - if( slot < 0 || slot >= MCA_MAX_SLOT_NR ) return; - if( reg < 0 || reg >= 8 ) return; - if (mca_info == 0 ) return; + if(slot < 0 || slot >= MCA_MAX_SLOT_NR) + return; + if(reg < 0 || reg >= 8) + return; + if(mca_info == 0) + return; - save_flags( flags ); + save_flags(flags); cli(); - /* make sure motherboard setup is off */ + /* Make sure motherboard setup is off */ outb_p(0xff, MCA_MOTHERBOARD_SETUP_REG); - /* read in the appropriate register */ + /* Read in the appropriate register */ outb_p(0x8|(slot&0xf), MCA_ADAPTER_SETUP_REG); - outb_p( byte, MCA_POS_REG(reg) ); + outb_p(byte, MCA_POS_REG(reg)); outb_p(0, MCA_ADAPTER_SETUP_REG); - restore_flags( flags ); + restore_flags(flags); - /* update the global register list, while we have the byte */ + /* Update the global register list, while we have the byte */ mca_info->slot[slot].pos[reg] = byte; } /* mca_write_pos() */ /*--------------------------------------------------------------------*/ -void mca_set_adapter_name( int slot, char* name ) +void mca_set_adapter_name(int slot, char* name) { - if( mca_info == 0 ) return; + if(mca_info == 0) return; - if( slot >= 0 && slot < MCA_NUMADAPTERS ) { - if( name != NULL ) { - strncpy( mca_info->slot[slot].name, name, - sizeof(mca_info->slot[slot].name)-1 ); + if(slot >= 0 && slot < MCA_NUMADAPTERS) { + if(name != NULL) { + strncpy(mca_info->slot[slot].name, name, + sizeof(mca_info->slot[slot].name)-1); mca_info->slot[slot].name[ sizeof(mca_info->slot[slot].name)-1] = 0; } else { @@ -559,61 +568,61 @@ } } -void mca_set_adapter_procfn( int slot, MCA_ProcFn procfn, void* dev) +void mca_set_adapter_procfn(int slot, MCA_ProcFn procfn, void* dev) { - if( mca_info == 0 ) return; + if(mca_info == 0) return; - if( slot >= 0 && slot < MCA_NUMADAPTERS ) { + if(slot >= 0 && slot < MCA_NUMADAPTERS) { mca_info->slot[slot].procfn = procfn; mca_info->slot[slot].dev = dev; } } -int mca_is_adapter_used( int slot ) +int mca_is_adapter_used(int slot) { return mca_info->slot[slot].driver_loaded; } -int mca_mark_as_used( int slot ) +int mca_mark_as_used(int slot) { if(mca_info->slot[slot].driver_loaded) return 1; mca_info->slot[slot].driver_loaded = 1; return 0; } -void mca_mark_as_unused( int slot ) +void mca_mark_as_unused(int slot) { mca_info->slot[slot].driver_loaded = 0; } -char *mca_get_adapter_name( int slot ) +char *mca_get_adapter_name(int slot) { - if( mca_info == 0 ) return 0; + if(mca_info == 0) return 0; - if( slot >= 0 && slot < MCA_NUMADAPTERS ) { + if(slot >= 0 && slot < MCA_NUMADAPTERS) { return mca_info->slot[slot].name; } return 0; } -int mca_isadapter( int slot ) +int mca_isadapter(int slot) { - if( mca_info == 0 ) return 0; + if(mca_info == 0) return 0; - if( slot >= 0 && slot < MCA_NUMADAPTERS ) { - return (( mca_info->slot[slot].status == MCA_ADAPTER_NORMAL ) - || (mca_info->slot[slot].status == MCA_ADAPTER_DISABLED ) ); + if(slot >= 0 && slot < MCA_NUMADAPTERS) { + return ((mca_info->slot[slot].status == MCA_ADAPTER_NORMAL) + || (mca_info->slot[slot].status == MCA_ADAPTER_DISABLED)); } return 0; } -int mca_isenabled( int slot ) +int mca_isenabled(int slot) { - if( mca_info == 0 ) return 0; + if(mca_info == 0) return 0; - if( slot >= 0 && slot < MCA_NUMADAPTERS ) { + if(slot >= 0 && slot < MCA_NUMADAPTERS) { return (mca_info->slot[slot].status == MCA_ADAPTER_NORMAL); } @@ -624,39 +633,37 @@ #ifdef CONFIG_PROC_FS -int get_mca_info(char *buf) +int get_mca_info(char *buf) { - int i, j, len = 0; + int i, j, len = 0; - if( MCA_bus && mca_info != 0 ) + if(MCA_bus && mca_info != 0) { - /* Format pos registers of eight MCA slots */ + /* Format POS registers of eight MCA slots */ - for (i=0; islot[i].pos[j]); - len += sprintf( buf+len, " %s\n", mca_info->slot[i].name ); - } + len += sprintf(buf+len, " %s\n", mca_info->slot[i].name); + } - /* Format pos registers of integrated video subsystem */ + /* Format POS registers of integrated video subsystem */ len += sprintf(buf+len, "Video : "); - for (j=0; j<8; j++) + for(j=0; j<8; j++) len += sprintf(buf+len, "%02x ", mca_info->slot[MCA_INTEGVIDEO].pos[j]); - len += sprintf( buf+len, " %s\n", mca_info->slot[MCA_INTEGVIDEO].name ); + len += sprintf(buf+len, " %s\n", mca_info->slot[MCA_INTEGVIDEO].name); - /* Format pos registers of integrated SCSI subsystem */ + /* Format POS registers of integrated SCSI subsystem */ len += sprintf(buf+len, "SCSI : "); - for (j=0; j<8; j++) + for(j=0; j<8; j++) len += sprintf(buf+len, "%02x ", mca_info->slot[MCA_INTEGSCSI].pos[j]); - len += sprintf( buf+len, " %s\n", mca_info->slot[MCA_INTEGSCSI].name ); - } - else - { - /* Leave it empty if MCA not detected - this should *never* + len += sprintf(buf+len, " %s\n", mca_info->slot[MCA_INTEGSCSI].name); + } else { + /* Leave it empty if MCA not detected - this should *never* * happen! */ } @@ -667,119 +674,119 @@ /*--------------------------------------------------------------------*/ -__initfunc(void mca_do_proc_init( void )) +__initfunc(void mca_do_proc_init(void)) { int i = 0; struct proc_dir_entry* node = 0; - if( mca_info == 0 ) return; /* should never happen */ + if(mca_info == 0) return; /* Should never happen */ - proc_register( &proc_mca, &(struct proc_dir_entry) { + proc_register(&proc_mca, &(struct proc_dir_entry) { PROC_MCA_REGISTERS, 3, "pos", S_IFREG|S_IRUGO, - 1, 0, 0, 0, &proc_mca_inode_operations,} ); + 1, 0, 0, 0, &proc_mca_inode_operations,}); - proc_register( &proc_mca, &(struct proc_dir_entry) { + proc_register(&proc_mca, &(struct proc_dir_entry) { PROC_MCA_MACHINE, 7, "machine", S_IFREG|S_IRUGO, - 1, 0, 0, 0, &proc_mca_inode_operations,} ); + 1, 0, 0, 0, &proc_mca_inode_operations,}); - /* initialize /proc/mca entries for existing adapters */ + /* Initialize /proc/mca entries for existing adapters */ - for( i = 0; i < MCA_NUMADAPTERS; i += 1 ) { + for(i = 0; i < MCA_NUMADAPTERS; i++) { mca_info->slot[i].procfn = 0; mca_info->slot[i].dev = 0; - if( ! mca_isadapter( i ) ) continue; + if(!mca_isadapter(i)) continue; node = kmalloc(sizeof(struct proc_dir_entry), GFP_ATOMIC); - if( i < MCA_MAX_SLOT_NR ) { + if(i < MCA_MAX_SLOT_NR) { node->low_ino = PROC_MCA_SLOT + i; - node->namelen = sprintf( mca_info->slot[i].procname, - "slot%d", i+1 ); - } else if( i == MCA_INTEGVIDEO ) { + node->namelen = sprintf(mca_info->slot[i].procname, + "slot%d", i+1); + } else if(i == MCA_INTEGVIDEO) { node->low_ino = PROC_MCA_VIDEO; - node->namelen = sprintf( mca_info->slot[i].procname, - "video" ); - } else if( i == MCA_INTEGSCSI ) { + node->namelen = sprintf(mca_info->slot[i].procname, + "video"); + } else if(i == MCA_INTEGSCSI) { node->low_ino = PROC_MCA_SCSI; - node->namelen = sprintf( mca_info->slot[i].procname, - "scsi" ); + node->namelen = sprintf(mca_info->slot[i].procname, + "scsi"); } node->name = mca_info->slot[i].procname; node->mode = S_IFREG | S_IRUGO; node->ops = &proc_mca_inode_operations; - proc_register( &proc_mca, node ); + proc_register(&proc_mca, node); } } /* mca_do_proc_init() */ /*--------------------------------------------------------------------*/ -int mca_default_procfn( char* buf, int slot ) +int mca_default_procfn(char* buf, int slot) { int len = 0, i; - /* this really shouldn't happen... */ + /* This really shouldn't happen... */ - if( mca_info == 0 ) { + if(mca_info == 0) { *buf = 0; return 0; } - /* print out the basic information */ + /* Print out the basic information */ - if( slot < MCA_MAX_SLOT_NR ) { - len += sprintf( buf+len, "Slot: %d\n", slot+1 ); - } else if( slot == MCA_INTEGSCSI ) { - len += sprintf( buf+len, "Integrated SCSI Adapter\n" ); - } else if( slot == MCA_INTEGVIDEO ) { - len += sprintf( buf+len, "Integrated Video Adapter\n" ); + if(slot < MCA_MAX_SLOT_NR) { + len += sprintf(buf+len, "Slot: %d\n", slot+1); + } else if(slot == MCA_INTEGSCSI) { + len += sprintf(buf+len, "Integrated SCSI Adapter\n"); + } else if(slot == MCA_INTEGVIDEO) { + len += sprintf(buf+len, "Integrated Video Adapter\n"); } - if( mca_info->slot[slot].name[0] ) { + if(mca_info->slot[slot].name[0]) { - /* drivers might register a name without /proc handler... */ + /* Drivers might register a name without /proc handler... */ - len += sprintf( buf+len, "Adapter Name: %s\n", - mca_info->slot[slot].name ); + len += sprintf(buf+len, "Adapter Name: %s\n", + mca_info->slot[slot].name); } else { - len += sprintf( buf+len, "Adapter Name: Unknown\n" ); + len += sprintf(buf+len, "Adapter Name: Unknown\n"); } - len += sprintf( buf+len, "Id: %02x%02x\n", - mca_info->slot[slot].pos[1], mca_info->slot[slot].pos[0] ); - len += sprintf( buf+len, "Enabled: %s\nPOS: ", - mca_isenabled(slot) ? "Yes" : "No" ); - len += sprintf( buf+len, "Driver Installed: %s\n", - mca_is_adapter_used(slot) ? "Yes" : "No" ); - for (i=0; i<8; i++) { + len += sprintf(buf+len, "Id: %02x%02x\n", + mca_info->slot[slot].pos[1], mca_info->slot[slot].pos[0]); + len += sprintf(buf+len, "Enabled: %s\nPOS: ", + mca_isenabled(slot) ? "Yes" : "No"); + for(i=0; i<8; i++) { len += sprintf(buf+len, "%02x ", mca_info->slot[slot].pos[i]); } + len += sprintf(buf+len, "\nDriver Installed: %s", + mca_is_adapter_used(slot) ? "Yes" : "No"); buf[len++] = '\n'; buf[len] = 0; return len; } /* mca_default_procfn() */ -static int get_mca_machine_info( char* buf ) +static int get_mca_machine_info(char* buf) { int len = 0; - len += sprintf( buf+len, "Model Id: 0x%x\n", machine_id ); - len += sprintf( buf+len, "Submodel Id: 0x%x\n", machine_submodel_id ); - len += sprintf( buf+len, "BIOS Revision: 0x%x\n", BIOS_revision ); + len += sprintf(buf+len, "Model Id: 0x%x\n", machine_id); + len += sprintf(buf+len, "Submodel Id: 0x%x\n", machine_submodel_id); + len += sprintf(buf+len, "BIOS Revision: 0x%x\n", BIOS_revision); return len; } -static int mca_fill( char* page, int pid, int type, char** start, +static int mca_fill(char* page, int pid, int type, char** start, loff_t *offset, int length) { int len = 0; int slot = 0; - switch( type ) { + switch(type) { case PROC_MCA_REGISTERS: - return get_mca_info( page ); + return get_mca_info(page); case PROC_MCA_MACHINE: - return get_mca_machine_info( page ); + return get_mca_machine_info(page); case PROC_MCA_VIDEO: slot = MCA_INTEGVIDEO; break; @@ -787,24 +794,24 @@ slot = MCA_INTEGSCSI; break; default: - if( type < PROC_MCA_SLOT || type >= PROC_MCA_LAST ) { + if(type < PROC_MCA_SLOT || type >= PROC_MCA_LAST) { return -EBADF; } slot = type - PROC_MCA_SLOT; break; } - /* if we made it here, we better have a valid slot */ + /* If we made it here, we better have a valid slot */ - /* get the standard info */ + /* Get the standard info */ - len = mca_default_procfn( page, slot ); + len = mca_default_procfn(page, slot); - /* do any device-specific processing, if there is any */ + /* Do any device-specific processing, if there is any */ - if( mca_info->slot[slot].procfn ) { - len += mca_info->slot[slot].procfn( page+len, slot, - mca_info->slot[slot].dev ); + if(mca_info->slot[slot].procfn) { + len += mca_info->slot[slot].procfn(page+len, slot, + mca_info->slot[slot].dev); } return len; @@ -814,7 +821,7 @@ #define PROC_BLOCK_SIZE (3*1024) -static ssize_t proc_mca_read( struct file* file, +static ssize_t proc_mca_read(struct file* file, char* buf, size_t count, loff_t *ppos) { unsigned long page; @@ -825,11 +832,11 @@ struct proc_dir_entry *dp; struct inode *inode = file->f_dentry->d_inode; - if (count < 0) + if(count < 0) return -EINVAL; - if (count > PROC_BLOCK_SIZE) + if(count > PROC_BLOCK_SIZE) count = PROC_BLOCK_SIZE; - if (!(page = __get_free_page(GFP_KERNEL))) + if(!(page = __get_free_page(GFP_KERNEL))) return -ENOMEM; type = inode->i_ino; pid = type >> 16; @@ -837,12 +844,12 @@ start = 0; dp = (struct proc_dir_entry *) inode->u.generic_ip; length = mca_fill((char *) page, pid, type, - &start, ppos, count); - if (length < 0) { + &start, ppos, count); + if(length < 0) { free_page(page); return length; } - if (start != 0) { + if(start != 0) { /* We have had block-adjusting processing! */ copy_to_user(buf, start, length); @@ -851,11 +858,11 @@ } else { /* Static 4kB (or whatever) block capacity */ - if (*ppos >= length) { + if(*ppos >= length) { free_page(page); return 0; } - if (count + *ppos > length) + if(count + *ppos > length) count = length - *ppos; end = count + *ppos; copy_to_user(buf, (char *) page + *ppos, count); diff -u --recursive --new-file v2.2.5/linux/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c --- v2.2.5/linux/arch/i386/kernel/smp.c Tue Mar 23 14:35:46 1999 +++ linux/arch/i386/kernel/smp.c Mon Mar 29 11:14:50 1999 @@ -345,11 +345,13 @@ SMP_PRINTK(("Bus #%d is %s\n", m->mpc_busid, str)); - if ((strncmp(m->mpc_bustype,"ISA",3) == 0) || - (strncmp(m->mpc_bustype,"EISA",4) == 0)) + if (strncmp(m->mpc_bustype,"ISA",3) == 0) mp_bus_id_to_type[m->mpc_busid] = MP_BUS_ISA; else + if (strncmp(m->mpc_bustype,"EISA",4) == 0) + mp_bus_id_to_type[m->mpc_busid] = + MP_BUS_EISA; if (strncmp(m->mpc_bustype,"PCI",3) == 0) { mp_bus_id_to_type[m->mpc_busid] = MP_BUS_PCI; diff -u --recursive --new-file v2.2.5/linux/arch/ppc/8xx_io/enet.c linux/arch/ppc/8xx_io/enet.c --- v2.2.5/linux/arch/ppc/8xx_io/enet.c Tue Mar 23 14:35:46 1999 +++ linux/arch/ppc/8xx_io/enet.c Fri Apr 16 08:20:23 1999 @@ -21,6 +21,7 @@ * small packets. * */ +#include #include #include #include diff -u --recursive --new-file v2.2.5/linux/arch/ppc/boot/head.S linux/arch/ppc/boot/head.S --- v2.2.5/linux/arch/ppc/boot/head.S Tue Mar 23 14:35:46 1999 +++ linux/arch/ppc/boot/head.S Fri Apr 16 08:20:23 1999 @@ -1,4 +1,3 @@ -#include #include "../kernel/ppc_defs.h" #include "../kernel/ppc_asm.tmpl" #include diff -u --recursive --new-file v2.2.5/linux/arch/ppc/lib/string.S linux/arch/ppc/lib/string.S --- v2.2.5/linux/arch/ppc/lib/string.S Tue Mar 23 14:35:46 1999 +++ linux/arch/ppc/lib/string.S Fri Apr 16 08:20:23 1999 @@ -8,7 +8,6 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ -#include #include "../kernel/ppc_asm.tmpl" #include #include diff -u --recursive --new-file v2.2.5/linux/arch/ppc/mbxboot/head.S linux/arch/ppc/mbxboot/head.S --- v2.2.5/linux/arch/ppc/mbxboot/head.S Tue Mar 23 14:35:46 1999 +++ linux/arch/ppc/mbxboot/head.S Fri Apr 16 08:20:23 1999 @@ -1,4 +1,3 @@ -#include #include "../kernel/ppc_defs.h" #include "../kernel/ppc_asm.tmpl" #include diff -u --recursive --new-file v2.2.5/linux/drivers/block/Makefile linux/drivers/block/Makefile --- v2.2.5/linux/drivers/block/Makefile Thu Sep 17 17:53:35 1998 +++ linux/drivers/block/Makefile Mon Apr 12 16:18:27 1999 @@ -220,6 +220,10 @@ ifeq ($(CONFIG_BLK_DEV_PS2),y) L_OBJS += ps2esdi.o +else + ifeq ($(CONFIG_BLK_DEV_PS2),m) + M_OBJS += ps2esdi.o + endif endif ifeq ($(CONFIG_BLK_DEV_XD),y) diff -u --recursive --new-file v2.2.5/linux/drivers/block/genhd.c linux/drivers/block/genhd.c --- v2.2.5/linux/drivers/block/genhd.c Tue Mar 23 14:35:47 1999 +++ linux/drivers/block/genhd.c Mon Apr 12 16:18:27 1999 @@ -776,11 +776,14 @@ #endif /* CONFIG_SUN_PARTITION */ #ifdef CONFIG_SGI_PARTITION +#include static int sgi_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector) { int i, csum; unsigned int *ui; + unsigned int start, blocks, cs; + int magic; struct buffer_head *bh; struct sgi_disklabel { int magic_mushroom; /* Big fat spliff... */ @@ -810,15 +813,18 @@ } label = (struct sgi_disklabel *) bh->b_data; p = &label->partitions[0]; - if(label->magic_mushroom != SGI_LABEL_MAGIC) { + magic = label->magic_mushroom; + if(be32_to_cpu(magic) != SGI_LABEL_MAGIC) { printk("Dev %s SGI disklabel: bad magic %08x\n", - kdevname(dev), label->magic_mushroom); + kdevname(dev), magic); brelse(bh); return 0; } ui = ((unsigned int *) (label + 1)) - 1; - for(csum = 0; ui >= ((unsigned int *) label);) - csum += *ui--; + for(csum = 0; ui >= ((unsigned int *) label);) { + cs = *ui--; + csum += be32_to_cpu(cs); + } if(csum) { printk("Dev %s SGI disklabel: csum bad, label corrupted\n", kdevname(dev)); @@ -831,9 +837,11 @@ * current_minor. */ for(i = 0; i < 16; i++, p++) { - if(!(p->num_blocks)) + blocks = be32_to_cpu(p->num_blocks); + start = be32_to_cpu(p->first_block); + if(!blocks) continue; - add_partition(hd, current_minor, p->first_block, p->num_blocks); + add_partition(hd, current_minor, start, blocks); current_minor++; } printk("\n"); diff -u --recursive --new-file v2.2.5/linux/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c --- v2.2.5/linux/drivers/block/ide-cd.c Tue Mar 23 14:35:47 1999 +++ linux/drivers/block/ide-cd.c Mon Apr 12 16:18:26 1999 @@ -3005,9 +3005,6 @@ CDROM_CONFIG_FLAGS (drive)->limit_nframes = 1; else if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2432")) CDROM_CONFIG_FLAGS (drive)->limit_nframes = 1; - else if (!strcmp (drive->id->model, "GCD-R580B")) - CDROM_CONFIG_FLAGS (drive)->limit_nframes = 1; - /* 124/SECTORS_PER_FRAME; ? */ } #if ! STANDARD_ATAPI diff -u --recursive --new-file v2.2.5/linux/drivers/cdrom/Config.in linux/drivers/cdrom/Config.in --- v2.2.5/linux/drivers/cdrom/Config.in Sun Dec 28 12:05:45 1997 +++ linux/drivers/cdrom/Config.in Mon Apr 12 16:18:28 1999 @@ -14,6 +14,10 @@ fi fi tristate 'Mitsumi (standard) [no XA/Multisession] CDROM support' CONFIG_MCD +if [ "$CONFIG_MCD" != "n" ]; then + int 'MCD IRQ' CONFIG_MCD_IRQ 11 + hex 'MCD I/O base' CONFIG_MCD_BASE 300 +fi tristate 'Mitsumi [XA/MultiSession] CDROM support' CONFIG_MCDX tristate 'Optics Storage DOLPHIN 8000AT CDROM support' CONFIG_OPTCD tristate 'Philips/LMS CM206 CDROM support' CONFIG_CM206 diff -u --recursive --new-file v2.2.5/linux/drivers/cdrom/mcd.c linux/drivers/cdrom/mcd.c --- v2.2.5/linux/drivers/cdrom/mcd.c Sun Nov 8 14:02:52 1998 +++ linux/drivers/cdrom/mcd.c Mon Apr 12 16:18:28 1999 @@ -67,6 +67,7 @@ a CD. November 1997 -- ported to the Uniform CD-ROM driver by Erik Andersen. + March 1999 -- made io base and irq CONFIG_ options (Tigran Aivazian). */ #include @@ -83,6 +84,7 @@ #include #include #include +#include /* #define REALLY_SLOW_IO */ #include @@ -155,8 +157,8 @@ int mitsumi_bug_93_wait = 0; #endif /* WORK_AROUND_MITSUMI_BUG_93 */ -static short mcd_port = MCD_BASE_ADDR; /* used as "mcd" by "insmod" */ -static int mcd_irq = MCD_INTR_NR; /* must directly follow mcd_port */ +static short mcd_port = CONFIG_MCD_BASE; /* used as "mcd" by "insmod" */ +static int mcd_irq = CONFIG_MCD_IRQ; /* must directly follow mcd_port */ MODULE_PARM(mcd, "1-2i"); static int McdTimeout, McdTries; diff -u --recursive --new-file v2.2.5/linux/drivers/cdrom/mcd.h linux/drivers/cdrom/mcd.h --- v2.2.5/linux/drivers/cdrom/mcd.h Tue Dec 2 11:41:44 1997 +++ linux/drivers/cdrom/mcd.h Mon Apr 12 16:18:28 1999 @@ -21,20 +21,6 @@ * */ -/* *** change this to set the I/O port address */ -#define MCD_BASE_ADDR 0x300 - -/* *** change this to set the interrupt number */ -#define MCD_INTR_NR 11 - -/* *** make the following line uncommented, if you're sure, - * *** all configuration is done */ - -/* #define I_WAS_HERE */ - - - - /* Increase this if you get lots of timeouts */ #define MCD_STATUS_DELAY 1000 @@ -121,8 +107,3 @@ struct msf trackTime; struct msf diskTime; }; - -#ifndef I_WAS_HERE -#warning You have not edited mcd.h -#warning Perhaps irq and i/o settings are wrong. -#endif diff -u --recursive --new-file v2.2.5/linux/drivers/cdrom/sjcd.c linux/drivers/cdrom/sjcd.c --- v2.2.5/linux/drivers/cdrom/sjcd.c Tue Dec 22 14:16:55 1998 +++ linux/drivers/cdrom/sjcd.c Mon Apr 12 16:18:32 1999 @@ -45,11 +45,14 @@ * Allow only to set io base address on command line: sjcd= * Changes to Documentation/cdrom/sjcd * Added cleanup after any error in the initialisation. + * 1.7 Added code to set the sector size tables to prevent the bug present in + * the previous version of this driver. Coded added by Anthony Barbachan + * from bugfix tip originally suggested by Alan Cox. * */ #define SJCD_VERSION_MAJOR 1 -#define SJCD_VERSION_MINOR 6 +#define SJCD_VERSION_MINOR 7 #ifdef MODULE #include @@ -1437,6 +1440,9 @@ NULL /* revalidate */ }; +static int blksize = 2048; +static int secsize = 2048; + /* * Following stuff is intended for initialization of the cdrom. It * first looks for presence of device. If the device is present, it @@ -1460,6 +1466,9 @@ #if defined( SJCD_TRACE ) printk("SJCD: sjcd=0x%x: ", sjcd_base); #endif + + hardsect_size[MAJOR_NR] = &secsize; + blksize_size[MAJOR_NR] = &blksize; if( register_blkdev( MAJOR_NR, "sjcd", &sjcd_fops ) != 0 ){ printk( "SJCD: Unable to get major %d for Sanyo CD-ROM\n", MAJOR_NR ); diff -u --recursive --new-file v2.2.5/linux/drivers/char/Config.in linux/drivers/char/Config.in --- v2.2.5/linux/drivers/char/Config.in Mon Mar 29 11:09:11 1999 +++ linux/drivers/char/Config.in Thu Apr 15 05:42:40 1999 @@ -123,6 +123,7 @@ if [ "$CONFIG_RADIO_AZTECH" = "y" ]; then hex ' Aztech/Packard Bell I/O port (0x350 or 0x358)' CONFIG_RADIO_AZTECH_PORT 350 fi + dep_tristate 'ADS Cadet AM/FM Tuner' CONFIG_RADIO_CADET $CONFIG_VIDEO_DEV dep_tristate 'Miro PCM20 Radio' CONFIG_RADIO_MIROPCM20 $CONFIG_VIDEO_DEV dep_tristate 'GemTek Radio Card support' CONFIG_RADIO_GEMTEK $CONFIG_VIDEO_DEV if [ "$CONFIG_RADIO_GEMTEK" = "y" ]; then diff -u --recursive --new-file v2.2.5/linux/drivers/char/Makefile linux/drivers/char/Makefile --- v2.2.5/linux/drivers/char/Makefile Mon Mar 29 11:09:11 1999 +++ linux/drivers/char/Makefile Thu Apr 15 05:42:40 1999 @@ -401,6 +401,14 @@ endif endif +ifeq ($(CONFIG_RADIO_CADET),y) +L_OBJS += radio-cadet.o +else + ifeq ($(CONFIG_RADIO_CADET),m) + M_OBJS += radio-cadet.o + endif +endif + ifeq ($(CONFIG_RADIO_MIROPCM20),y) L_OBJS += radio-miropcm20.o else @@ -459,6 +467,7 @@ ALL_SUB_DIRS += hfmodem MOD_SUB_DIRS += hfmodem endif + endif include $(TOPDIR)/Rules.make diff -u --recursive --new-file v2.2.5/linux/drivers/char/bttv.c linux/drivers/char/bttv.c --- v2.2.5/linux/drivers/char/bttv.c Mon Mar 29 11:09:11 1999 +++ linux/drivers/char/bttv.c Mon Apr 12 16:18:27 1999 @@ -541,6 +541,8 @@ { 3, 1, 0, 2, 7, { 2, 3, 1, 1}, { 0, 1, 2, 3, 4}}, /* Zoltrix TV-Max */ { 3, 1, 0, 2,15, { 2, 3, 1, 1}, { 0, 0, 0, 0, 0}}, + /* Pixelview PlayTV (bt878) */ + { 3, 4, 0, 2, 0x01e000, { 2, 0, 1, 1}, {0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 }}, }; #define TVCARDS (sizeof(tvcards)/sizeof(tvcard)) @@ -2388,7 +2390,7 @@ btv->user--; btv->radio = 0; - audio(btv, AUDIO_MUTE); + /*audio(btv, AUDIO_MUTE);*/ MOD_DEC_USE_COUNT; } @@ -2927,6 +2929,12 @@ btv->pll.pll_crystal=BT848_IFORM_XT0; } } + + if (btv->type == BTTV_PIXVIEWPLAYTV) { + btv->pll.pll_ifreq=28636363; + btv->pll.pll_crystal=BT848_IFORM_XT0; + } + if(btv->type==BTTV_AVERMEDIA98) { btv->pll.pll_ifreq=28636363; diff -u --recursive --new-file v2.2.5/linux/drivers/char/bttv.h linux/drivers/char/bttv.h --- v2.2.5/linux/drivers/char/bttv.h Tue Feb 23 15:21:33 1999 +++ linux/drivers/char/bttv.h Mon Apr 12 16:18:27 1999 @@ -208,6 +208,7 @@ #define BTTV_AVERMEDIA98 0x0d #define BTTV_VHX 0x0e #define BTTV_ZOLTRIX 0x0f +#define BTTV_PIXVIEWPLAYTV 0x10 #define AUDIO_TUNER 0x00 #define AUDIO_RADIO 0x01 diff -u --recursive --new-file v2.2.5/linux/drivers/char/cyclades.c linux/drivers/char/cyclades.c --- v2.2.5/linux/drivers/char/cyclades.c Wed Jan 20 23:14:05 1999 +++ linux/drivers/char/cyclades.c Mon Apr 12 10:09:47 1999 @@ -1,7 +1,7 @@ #define BLOCKMOVE #define Z_WAKE static char rcsid[] = -"$Revision: 2.2.1.10 $$Date: 1999/01/20 16:14:29 $"; +"$Revision: 2.2.2.1 $$Date: 1999/04/08 16:17:43 $"; /* * linux/drivers/char/cyclades.c @@ -31,6 +31,13 @@ * void cleanup_module(void); * * $Log: cyclades.c,v $ + * Revision 2.2.2.1 1999/04/08 16:17:43 ivan + * Fixed a bug in cy_wait_until_sent that was preventing the port to be + * closed properly after a SIGINT; + * Module usage counter scheme revisited; + * Added support to the upcoming Y PCI boards (i.e., support to additional + * PCI Device ID's). + * * Revision 2.2.1.10 1999/01/20 16:14:29 ivan * Removed all unnecessary page-alignement operations in ioremap calls * (ioremap is currently safe for these operations). @@ -525,9 +532,11 @@ #undef CY_DEBUG_COUNT #undef CY_DEBUG_DTR #undef CY_DEBUG_WAIT_UNTIL_SENT +#undef CY_DEBUG_INTERRUPTS #undef CY_16Y_HACK #undef CY_ENABLE_MONITORING #undef CY_PCI_DEBUG +#define CY_PROC #if 0 #define PAUSE __asm__("nop"); @@ -763,16 +772,20 @@ /* PCI related definitions */ -static unsigned short cy_pci_nboard = 0; -static unsigned short cy_isa_nboard = 0; -static unsigned short cy_nboard = 0; -static unsigned short cy_pci_dev_id[] = { - PCI_DEVICE_ID_CYCLOM_Y_Lo,/* PCI below 1Mb */ - PCI_DEVICE_ID_CYCLOM_Y_Hi,/* PCI above 1Mb */ - PCI_DEVICE_ID_CYCLOM_Z_Lo,/* PCI below 1Mb */ - PCI_DEVICE_ID_CYCLOM_Z_Hi,/* PCI above 1Mb */ - 0 /* end of table */ - }; +static unsigned short cy_pci_nboard = 0; +static unsigned short cy_isa_nboard = 0; +static unsigned short cy_nboard = 0; +static unsigned short cy_pci_dev_id[] = { + PCI_DEVICE_ID_CYCLOM_Y_Lo, /* PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_Y_Hi, /* PCI > 1Mb */ + PCI_DEVICE_ID_CYCLOM_4Y_Lo, /* 4Y PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_4Y_Hi, /* 4Y PCI > 1Mb */ + PCI_DEVICE_ID_CYCLOM_8Y_Lo, /* 8Y PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_8Y_Hi, /* 8Y PCI > 1Mb */ + PCI_DEVICE_ID_CYCLOM_Z_Lo, /* Z PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_Z_Hi, /* Z PCI > 1Mb */ + 0 /* end of table */ + }; static void cy_start(struct tty_struct *); @@ -2448,12 +2461,15 @@ int retval, line; unsigned long page; + MOD_INC_USE_COUNT; line = MINOR(tty->device) - tty->driver.minor_start; if ((line < 0) || (NR_PORTS <= line)){ + MOD_DEC_USE_COUNT; return -ENODEV; } info = &cy_port[line]; if (info->line < 0){ + MOD_DEC_USE_COUNT; return -ENODEV; } @@ -2479,6 +2495,8 @@ #ifdef CY_DEBUG_OTHER printk("cyc:cy_open ttyC%d\n", info->line); /* */ #endif + tty->driver_data = info; + info->tty = tty; if (serial_paranoia_check(info, tty->device, "cy_open")){ return -ENODEV; } @@ -2491,9 +2509,6 @@ printk("cyc:cy_open (%d): incrementing count to %d\n", current->pid, info->count); #endif - tty->driver_data = info; - info->tty = tty; - if (!tmp_buf) { page = get_free_page(GFP_KERNEL); if (!page) @@ -2521,8 +2536,6 @@ return retval; } - MOD_INC_USE_COUNT; - retval = block_til_ready(tty, filp, info); if (retval) { #ifdef CY_DEBUG_OPEN @@ -2563,6 +2576,10 @@ if (serial_paranoia_check(info, tty->device, "cy_wait_until_sent")) return; + if (info->xmit_fifo_size == 0) + return; /* Just in case.... */ + + orig_jiffies = jiffies; /* * Set the check interval to be 1/5 of the estimated time to @@ -2580,6 +2597,17 @@ timeout = 0; if (timeout) char_time = MIN(char_time, timeout); + /* + * If the transmitter hasn't cleared in twice the approximate + * amount of time to send the entire FIFO, it probably won't + * ever clear. This assumes the UART isn't doing flow + * control, which is currently the case. Hence, if it ever + * takes longer than info->timeout, this is probably due to a + * UART bug of some kind. So, we clamp the timeout parameter at + * 2*info->timeout. + */ + if (!timeout || timeout > 2*info->timeout) + timeout = 2*info->timeout; #ifdef CY_DEBUG_WAIT_UNTIL_SENT printk("In cy_wait_until_sent(%d) check=%lu...", timeout, char_time); printk("jiff=%lu...", jiffies); @@ -2601,7 +2629,7 @@ schedule_timeout(char_time); if (signal_pending(current)) break; - if (timeout && time_before(orig_jiffies + timeout, jiffies)) + if (timeout && time_after(jiffies, orig_jiffies + timeout)) break; } current->state = TASK_RUNNING; @@ -2631,13 +2659,9 @@ printk("cyc:cy_close ttyC%d\n", info->line); #endif - if (!info - || serial_paranoia_check(info, tty->device, "cy_close")){ + if (!info || serial_paranoia_check(info, tty->device, "cy_close")){ return; } -#ifdef CY_DEBUG_OPEN - printk("cyc:cy_close ttyC%d, count = %d\n", info->line, info->count); -#endif save_flags(flags); cli(); @@ -2648,6 +2672,9 @@ return; } +#ifdef CY_DEBUG_OPEN + printk("cyc:cy_close ttyC%d, count = %d\n", info->line, info->count); +#endif if ((tty->count == 1) && (info->count != 1)) { /* * Uh, oh. tty->count is 1, which means that the tty @@ -4579,6 +4606,8 @@ cy_pci_addr2 = pdev->base_address[2]; pci_read_config_byte(pdev, PCI_REVISION_ID, &cyy_rev_id); + device_id &= ~PCI_DEVICE_ID_MASK; + if ((device_id == PCI_DEVICE_ID_CYCLOM_Y_Lo) || (device_id == PCI_DEVICE_ID_CYCLOM_Y_Hi)){ #ifdef CY_PCI_DEBUG @@ -4942,6 +4971,7 @@ __DATE__, __TIME__); } /* show_version */ +#ifdef CY_PROC static int cyclades_get_proc_info(char *buf, char **start, off_t offset, int length, int *eof, void *data) @@ -4998,7 +5028,7 @@ len = 0; return len; } - +#endif /* The serial driver boot-time initialization code! Hardware I/O ports are mapped to character special devices on a @@ -5028,7 +5058,9 @@ unsigned long mailbox; unsigned short chip_number; int nports; +#ifdef CY_PROC struct proc_dir_entry *ent; +#endif show_version(); @@ -5269,8 +5301,10 @@ #endif } +#ifdef CY_PROC ent = create_proc_entry("cyclades", S_IFREG | S_IRUGO, 0); ent->read_proc = cyclades_get_proc_info; +#endif return 0; @@ -5314,7 +5348,7 @@ free_irq(cy_card[i].irq,NULL); } } -#ifdef CONFIG_PROC_FS +#ifdef CY_PROC remove_proc_entry("cyclades", 0); #endif diff -u --recursive --new-file v2.2.5/linux/drivers/char/dtlk.c linux/drivers/char/dtlk.c --- v2.2.5/linux/drivers/char/dtlk.c Wed Mar 10 15:29:45 1999 +++ linux/drivers/char/dtlk.c Fri Apr 16 08:20:23 1999 @@ -56,8 +56,6 @@ #endif #define KERNEL -#include - #include #include #include /* for verify_area */ diff -u --recursive --new-file v2.2.5/linux/drivers/char/isicom.c linux/drivers/char/isicom.c --- v2.2.5/linux/drivers/char/isicom.c Mon Dec 28 15:00:52 1998 +++ linux/drivers/char/isicom.c Mon Apr 12 16:18:27 1999 @@ -114,6 +114,7 @@ #ifdef ISICOM_DEBUG printk(KERN_DEBUG "ISILoad:Firmware loader Opened!!!\n"); #endif + MOD_INC_USE_COUNT; return 0; } @@ -122,6 +123,7 @@ #ifdef ISICOM_DEBUG printk(KERN_DEBUG "ISILoad:Firmware loader Close(Release)d\n",); #endif + MOD_DEC_USE_COUNT; return 0; } diff -u --recursive --new-file v2.2.5/linux/drivers/char/istallion.c linux/drivers/char/istallion.c --- v2.2.5/linux/drivers/char/istallion.c Mon Mar 29 11:09:11 1999 +++ linux/drivers/char/istallion.c Fri Apr 16 08:20:23 1999 @@ -26,6 +26,7 @@ /*****************************************************************************/ +#include #include #include #include diff -u --recursive --new-file v2.2.5/linux/drivers/char/mem.c linux/drivers/char/mem.c --- v2.2.5/linux/drivers/char/mem.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/char/mem.c Mon Apr 12 10:35:41 1999 @@ -138,8 +138,11 @@ static inline unsigned long pgprot_noncached(unsigned long prot) { #if defined(__i386__) + /* On PPro and successors, PCD alone doesn't always mean + uncached because of interactions with the MTRRs. PCD | PWT + means definitely uncached. */ if (boot_cpu_data.x86 > 3) - prot |= _PAGE_PCD; + prot |= _PAGE_PCD | _PAGE_PWT; #elif defined(__powerpc__) prot |= _PAGE_NO_CACHE | _PAGE_GUARDED; #elif defined(__mc68000__) @@ -155,6 +158,28 @@ return prot; } +/* + * Architectures vary in how they handle caching for addresses + * outside of main memory. + */ +static inline int noncached_address(unsigned long addr) +{ +#if defined(__i386__) + /* + * On the PPro and successors, the MTRRs are used to set + * memory types for physical addresses outside main memory, + * so blindly setting PCD or PWT on those pages is wrong. + * For Pentiums and earlier, the surround logic should disable + * caching for the high addresses through the KEN pin, but + * we maintain the tradition of paranoia in this code. + */ + return !(boot_cpu_data.x86_capability & X86_FEATURE_MTRR) + && addr >= __pa(high_memory); +#else + return addr >= __pa(high_memory); +#endif +} + static int mmap_mem(struct file * file, struct vm_area_struct * vma) { unsigned long offset = vma->vm_offset; @@ -166,15 +191,17 @@ * Accessing memory above the top the kernel knows about or * through a file pointer that was marked O_SYNC will be * done non-cached. - * - * Set VM_IO, as this is likely a non-cached access to an - * I/O area, and we don't want to include that in a core - * file. */ - if (offset >= __pa(high_memory) || (file->f_flags & O_SYNC)) { - pgprot_val(vma->vm_page_prot) = pgprot_noncached(pgprot_val(vma->vm_page_prot)); + if (noncached_address(offset) || (file->f_flags & O_SYNC)) + pgprot_val(vma->vm_page_prot) + = pgprot_noncached(pgprot_val(vma->vm_page_prot)); + + /* + * Don't dump addresses that are not real memory to a core file. + */ + if (offset >= __pa(high_memory) || (file->f_flags & O_SYNC)) vma->vm_flags |= VM_IO; - } + if (remap_page_range(vma->vm_start, offset, vma->vm_end-vma->vm_start, vma->vm_page_prot)) return -EAGAIN; diff -u --recursive --new-file v2.2.5/linux/drivers/char/radio-aimslab.c linux/drivers/char/radio-aimslab.c --- v2.2.5/linux/drivers/char/radio-aimslab.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/char/radio-aimslab.c Thu Apr 15 05:42:40 1999 @@ -235,6 +235,7 @@ v.rangehigh=(108*16000); v.flags=VIDEO_TUNER_LOW; v.mode=VIDEO_MODE_AUTO; + strcpy(v.name, "FM"); v.signal=0xFFFF*rt_getsigstr(rt); if(copy_to_user(arg,&v, sizeof(v))) return -EFAULT; diff -u --recursive --new-file v2.2.5/linux/drivers/char/radio-aztech.c linux/drivers/char/radio-aztech.c --- v2.2.5/linux/drivers/char/radio-aztech.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/char/radio-aztech.c Thu Apr 15 05:42:40 1999 @@ -186,6 +186,7 @@ v.signal=0xFFFF*az_getsigstr(az); if(az_getstereo(az)) v.flags|=VIDEO_TUNER_STEREO_ON; + strcpy(v.name, "FM"); if(copy_to_user(arg,&v, sizeof(v))) return -EFAULT; return 0; diff -u --recursive --new-file v2.2.5/linux/drivers/char/radio-cadet.c linux/drivers/char/radio-cadet.c --- v2.2.5/linux/drivers/char/radio-cadet.c Wed Dec 31 16:00:00 1969 +++ linux/drivers/char/radio-cadet.c Thu Apr 15 05:42:40 1999 @@ -0,0 +1,403 @@ +/* cadet.c - A video4linux driver for the ADS Cadet AM/FM Radio Card + * + * by Fred Gleason + * Version 0.1.2 + * + * (Loosely) based on code for the Aztech radio card by + * + * Russell Kroll (rkroll@exploits.org) + * Quay Ly + * Donald Song + * Jason Lewis (jlewis@twilight.vtc.vsc.edu) + * Scott McGrath (smcgrath@twilight.vtc.vsc.edu) + * William McGrath (wmcgrath@twilight.vtc.vsc.edu) + * +*/ + +#include /* Modules */ +#include /* Initdata */ +#include /* check_region, request_region */ +#include /* udelay */ +#include /* outb, outb_p */ +#include /* copy to/from user */ +#include /* kernel radio structs */ +#include /* CONFIG_RADIO_CADET_PORT */ + +#ifndef CONFIG_RADIO_CADET_PORT +#define CONFIG_RADIO_CADET_PORT 0x330 +#endif + +static int io=CONFIG_RADIO_CADET_PORT; +static int users=0; +static int curtuner=0; + +static int cadet_getstereo(void) +{ + if(curtuner!=0) { /* Only FM has stereo capability! */ + return 0; + } + outb(7,io); /* Select tuner control */ + if((inb(io+1)&0x40)==0) { + return 1; /* Stereo pilot detected */ + } + else { + return 0; /* Mono */ + } +} + + +static unsigned cadet_getfreq(void) +{ + int curvol,i; + unsigned freq=0,test,fifo=0; + + + /* + * Prepare for read + */ + outb(7,io); /* Select tuner control */ + curvol=inb(io+1); /* Save current volume/mute setting */ + outb(0x00,io+1); /* Ensure WRITE-ENABLE is LOW */ + + /* + * Read the shift register + */ + for(i=0;i<25;i++) { + fifo=(fifo<<1)|((inb(io+1)>>7)&0x01); + if(i<24) { + outb(0x01,io+1); + outb(0x00,io+1); + } + } + + /* + * Restore volume/mute setting + */ + outb(curvol,io+1); + + /* + * Convert to actual frequency + */ + if(curtuner==0) { /* FM */ + test=12500; + for(i=0;i<14;i++) { + if((fifo&0x01)!=0) { + freq+=test; + } + test=test<<1; + fifo=fifo>>1; + } + freq-=10700000; /* IF frequency is 10.7 MHz */ + freq=(freq*16)/1000000; /* Make it 1/16 MHz */ + } + if(curtuner==1) { /* AM */ + freq=((fifo&0x7fff)-2010)*16; + } + + return freq; +} + + +static void cadet_setfreq(unsigned freq) +{ + unsigned fifo; + int i,test; + int curvol; + + /* + * Formulate a fifo command + */ + fifo=0; + if(curtuner==0) { /* FM */ + test=102400; + freq=(freq*1000)/16; /* Make it kHz */ + freq+=10700; /* IF is 10700 kHz */ + for(i=0;i<14;i++) { + fifo=fifo<<1; + if(freq>=test) { + fifo|=0x01; + freq-=test; + } + test=test>>1; + } + } + if(curtuner==1) { /* AM */ + fifo=(freq/16)+2010; /* Make it kHz */ + fifo|=0x100000; /* Select AM Band */ + } + + /* + * Save current volume/mute setting + */ + curvol=inb(io+1); + + /* + * Write the shift register + */ + test=0; + test=(fifo>>23)&0x02; /* Align data for SDO */ + test|=0x1c; /* SDM=1, SWE=1, SEN=1, SCK=0 */ + outb(7,io); /* Select tuner control */ + outb(test,io+1); /* Initialize for write */ + for(i=0;i<25;i++) { + test|=0x01; /* Toggle SCK High */ + outb(test,io+1); + test&=0xfe; /* Toggle SCK Low */ + outb(test,io+1); + fifo=fifo<<1; /* Prepare the next bit */ + test=0x1c|((fifo>>23)&0x02); + outb(test,io+1); + } + /* + * Restore volume/mute setting + */ + outb(curvol,io+1); +} + + +static int cadet_getvol(void) +{ + outb(7,io); /* Select tuner control */ + if((inb(io+1)&0x20)!=0) { + return 0xffff; + } + else { + return 0; + } +} + + +static void cadet_setvol(int vol) +{ + outb(7,io); /* Select tuner control */ + if(vol>0) { + outb(0x20,io+1); + } + else { + outb(0x00,io+1); + } +} + + +static int cadet_ioctl(struct video_device *dev, unsigned int cmd, void *arg) +{ + unsigned freq; + switch(cmd) + { + case VIDIOCGCAP: + { + struct video_capability v; + v.type=VID_TYPE_TUNER; + v.channels=2; + v.audios=1; + /* No we don't do pictures */ + v.maxwidth=0; + v.maxheight=0; + v.minwidth=0; + v.minheight=0; + strcpy(v.name, "ADS Cadet"); + if(copy_to_user(arg,&v,sizeof(v))) + return -EFAULT; + return 0; + } + case VIDIOCGTUNER: + { + struct video_tuner v; + if(copy_from_user(&v, arg,sizeof(v))!=0) { + return -EFAULT; + } + if((v.tuner<0)||(v.tuner>1)) { + return -EINVAL; + } + switch(v.tuner) { + case 0: + strcpy(v.name,"FM"); + v.rangelow=1400; /* 87.5 MHz */ + v.rangehigh=1728; /* 108.0 MHz */ + v.flags=0; + v.mode=0; + v.mode|=VIDEO_MODE_AUTO; + v.signal=0xFFFF; + if(cadet_getstereo()==1) { + v.flags|=VIDEO_TUNER_STEREO_ON; + } + if(copy_to_user(arg,&v, sizeof(v))) { + return -EFAULT; + } + break; + case 1: + strcpy(v.name,"AM"); + v.rangelow=8320; /* 520 kHz */ + v.rangehigh=26400; /* 1650 kHz */ + v.flags=0; + v.flags|=VIDEO_TUNER_LOW; + v.mode=0; + v.mode|=VIDEO_MODE_AUTO; + v.signal=0xFFFF; + if(copy_to_user(arg,&v, sizeof(v))) { + return -EFAULT; + } + break; + } + return 0; + } + case VIDIOCSTUNER: + { + struct video_tuner v; + if(copy_from_user(&v, arg, sizeof(v))) { + return -EFAULT; + } + if((v.tuner<0)||(v.tuner>1)) { + return -EINVAL; + } + curtuner=v.tuner; + return 0; + } + case VIDIOCGFREQ: + freq=cadet_getfreq(); + if(copy_to_user(arg, &freq, sizeof(freq))) + return -EFAULT; + return 0; + case VIDIOCSFREQ: + if(copy_from_user(&freq, arg,sizeof(freq))) + return -EFAULT; + if((curtuner==0)&&((freq<1400)||(freq>1728))) { + return -EINVAL; + } + if((curtuner==1)&&((freq<8320)||(freq>26400))) { + return -EINVAL; + } + cadet_setfreq(freq); + return 0; + case VIDIOCGAUDIO: + { + struct video_audio v; + memset(&v,0, sizeof(v)); + v.flags=VIDEO_AUDIO_MUTABLE|VIDEO_AUDIO_VOLUME; + if(cadet_getstereo()==0) { + v.mode=VIDEO_SOUND_MONO; + } + else { + v.mode=VIDEO_SOUND_STEREO; + } + v.volume=cadet_getvol(); + v.step=0xffff; + strcpy(v.name, "Radio"); + if(copy_to_user(arg,&v, sizeof(v))) + return -EFAULT; + return 0; + } + case VIDIOCSAUDIO: + { + struct video_audio v; + if(copy_from_user(&v, arg, sizeof(v))) + return -EFAULT; + if(v.audio) + return -EINVAL; + cadet_setvol(v.volume); + if(v.flags&VIDEO_AUDIO_MUTE) + cadet_setvol(0); + else + cadet_setvol(0xffff); + return 0; + } + default: + return -ENOIOCTLCMD; + } +} + + +static int cadet_open(struct video_device *dev, int flags) +{ + if(users) + return -EBUSY; + users++; + MOD_INC_USE_COUNT; + return 0; +} + +static void cadet_close(struct video_device *dev) +{ + users--; + MOD_DEC_USE_COUNT; +} + + +static struct video_device cadet_radio= +{ + "Cadet radio", + VID_TYPE_TUNER, + VID_HARDWARE_CADET, + cadet_open, + cadet_close, + NULL, /* Can't read (no capture ability) */ + NULL, /* Can't write */ + NULL, /* No poll */ + cadet_ioctl, + NULL, + NULL +}; + +__initfunc(int cadet_init(struct video_init *v)) +{ +#ifndef MODULE + if(cadet_probe()<0) { + return EINVAL; + } +#endif + if(video_register_device(&cadet_radio,VFL_TYPE_RADIO)==-1) + return -EINVAL; + + request_region(io,2,"cadet"); + printk(KERN_INFO "ADS Cadet Radio Card at %x\n",io); + return 0; +} + + +static int cadet_probe(void) +{ + static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e}; + int i; + + for(i=0;i<8;i++) { + io=iovals[i]; + if(check_region(io,2)) { + return -1; + } + cadet_setfreq(1410); + if(cadet_getfreq()==1410) { + return io; + } + } + return -1; +} + + + +#ifdef MODULE + +MODULE_AUTHOR("Fred Gleason, Russell Kroll, Quay Lu, Donald Song, Jason Lewis, Scott McGrath, William McGrath"); +MODULE_DESCRIPTION("A driver for the ADS Cadet AM/FM/RDS radio card."); +MODULE_PARM(io, "i"); +MODULE_PARM_DESC(io, "I/O address of Cadet card (0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e)"); + +EXPORT_NO_SYMBOLS; + +int init_module(void) +{ + if(io==-1) + { + printk(KERN_ERR "You must set an I/O address with io=0x???\n"); + return -EINVAL; + } + return cadet_init(NULL); +} + +void cleanup_module(void) +{ + video_unregister_device(&cadet_radio); + release_region(io,2); +} + +#endif + diff -u --recursive --new-file v2.2.5/linux/drivers/char/radio-gemtek.c linux/drivers/char/radio-gemtek.c --- v2.2.5/linux/drivers/char/radio-gemtek.c Mon Dec 28 15:00:52 1998 +++ linux/drivers/char/radio-gemtek.c Thu Apr 15 05:42:40 1999 @@ -160,6 +160,7 @@ v.flags=VIDEO_TUNER_LOW; v.mode=VIDEO_MODE_AUTO; v.signal=0xFFFF*gemtek_getsigstr(rt); + strcpy(v.name, "FM"); if(copy_to_user(arg,&v, sizeof(v))) return -EFAULT; return 0; diff -u --recursive --new-file v2.2.5/linux/drivers/char/radio-miropcm20.c linux/drivers/char/radio-miropcm20.c --- v2.2.5/linux/drivers/char/radio-miropcm20.c Sat Sep 5 16:46:40 1998 +++ linux/drivers/char/radio-miropcm20.c Thu Apr 15 05:42:40 1999 @@ -118,6 +118,7 @@ v.flags=0; v.mode=VIDEO_MODE_AUTO; v.signal=0xFFFF*pcm20_getsigstr(pcm20); + strcpy(v.name, "FM"); if(copy_to_user(arg,&v, sizeof(v))) return -EFAULT; return 0; diff -u --recursive --new-file v2.2.5/linux/drivers/char/radio-rtrack2.c linux/drivers/char/radio-rtrack2.c --- v2.2.5/linux/drivers/char/radio-rtrack2.c Wed Aug 26 11:37:37 1998 +++ linux/drivers/char/radio-rtrack2.c Thu Apr 15 05:42:40 1999 @@ -130,6 +130,7 @@ v.flags=VIDEO_TUNER_LOW; v.mode=VIDEO_MODE_AUTO; v.signal=0xFFFF*rt_getsigstr(rt); + strcpy(v.name, "FM"); if(copy_to_user(arg,&v, sizeof(v))) return -EFAULT; return 0; diff -u --recursive --new-file v2.2.5/linux/drivers/char/radio-sf16fmi.c linux/drivers/char/radio-sf16fmi.c --- v2.2.5/linux/drivers/char/radio-sf16fmi.c Fri Nov 27 13:09:23 1998 +++ linux/drivers/char/radio-sf16fmi.c Thu Apr 15 05:42:40 1999 @@ -158,6 +158,7 @@ v.flags=fmi->flags; v.mode=VIDEO_MODE_AUTO; v.signal = fmi_getsigstr(fmi); + strcpy(v.name, "FM"); if(copy_to_user(arg,&v, sizeof(v))) return -EFAULT; return 0; diff -u --recursive --new-file v2.2.5/linux/drivers/char/radio-typhoon.c linux/drivers/char/radio-typhoon.c --- v2.2.5/linux/drivers/char/radio-typhoon.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/char/radio-typhoon.c Thu Apr 15 05:42:40 1999 @@ -195,7 +195,8 @@ v.rangehigh = 1080 * 1600; v.flags = VIDEO_TUNER_LOW; v.mode = VIDEO_MODE_AUTO; - v.signal = 0; /* We can't get the signal strength */ + v.signal = 0xFFFF; /* We can't get the signal strength */ + strcpy(v.tuner, "FM"); if (copy_to_user(arg, &v, sizeof(v))) return -EFAULT; return 0; diff -u --recursive --new-file v2.2.5/linux/drivers/char/radio-zoltrix.c linux/drivers/char/radio-zoltrix.c --- v2.2.5/linux/drivers/char/radio-zoltrix.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/char/radio-zoltrix.c Thu Apr 15 05:42:40 1999 @@ -223,14 +223,11 @@ case VIDIOCGTUNER: { struct video_tuner v; -/* if (copy_from_user(&v, arg, sizeof(v))) return -EFAULT; if (v.tuner) return -EINVAL; -*/ - v.tuner = 0; - strcpy(v.name, "Zoltrix Radio"); + strcpy(v.name, "FM"); v.rangelow = (int) (88.0 * 16000); v.rangehigh = (int) (108.0 * 16000); v.flags = zol_is_stereo(zol) diff -u --recursive --new-file v2.2.5/linux/drivers/char/softdog.c linux/drivers/char/softdog.c --- v2.2.5/linux/drivers/char/softdog.c Wed Aug 26 11:37:37 1998 +++ linux/drivers/char/softdog.c Mon Apr 12 16:18:27 1999 @@ -144,11 +144,9 @@ default: return -ENOIOCTLCMD; case WDIOC_GETSUPPORT: - i = verify_area(VERIFY_WRITE, (void*) arg, sizeof(struct watchdog_info)); - if (i) - return i; - else - return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)); + if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))) + return -EFAULT; + return 0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: return put_user(0,(int *)arg); diff -u --recursive --new-file v2.2.5/linux/drivers/char/stallion.c linux/drivers/char/stallion.c --- v2.2.5/linux/drivers/char/stallion.c Mon Mar 29 11:09:11 1999 +++ linux/drivers/char/stallion.c Fri Apr 16 08:20:23 1999 @@ -26,6 +26,7 @@ /*****************************************************************************/ +#include #include #include #include diff -u --recursive --new-file v2.2.5/linux/drivers/char/videodev.c linux/drivers/char/videodev.c --- v2.2.5/linux/drivers/char/videodev.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/char/videodev.c Thu Apr 15 05:42:40 1999 @@ -75,6 +75,9 @@ #ifdef CONFIG_RADIO_TYPHOON extern int typhoon_init(struct video_init *); #endif +#ifdef CONFIG_RADIO_CADET +extern int cadet_init(struct video_init *); +#endif #ifdef CONFIG_VIDEO_PMS extern int init_pms_cards(struct video_init *); #endif @@ -111,6 +114,9 @@ #ifdef CONFIG_RADIO_MIROPCM20 {"PCM20", pcm20_init}, #endif +#ifdef CONFIG_RADIO_CADET + {"Cadet", cadet_init}, +#endif #ifdef CONFIG_RADIO_GEMTEK {"GemTek", gemtek_init}, #endif @@ -429,6 +435,12 @@ { unregister_chrdev(VIDEO_MAJOR, "video_capture"); } + + + + + + #endif diff -u --recursive --new-file v2.2.5/linux/drivers/macintosh/adb.c linux/drivers/macintosh/adb.c --- v2.2.5/linux/drivers/macintosh/adb.c Tue Mar 23 14:35:47 1999 +++ linux/drivers/macintosh/adb.c Fri Apr 16 08:20:23 1999 @@ -5,7 +5,6 @@ * Copyright (C) 1996 Paul Mackerras. */ -#include #include #include #include diff -u --recursive --new-file v2.2.5/linux/drivers/net/Makefile linux/drivers/net/Makefile --- v2.2.5/linux/drivers/net/Makefile Tue Mar 23 14:35:47 1999 +++ linux/drivers/net/Makefile Thu Apr 15 05:42:40 1999 @@ -1073,7 +1073,7 @@ MOD_IN_SUB_DIRS += irda else ifeq ($(CONFIG_IRDA),m) - MOD_SUB_DIRS += irda + MOD_IN_SUB_DIRS += irda endif endif diff -u --recursive --new-file v2.2.5/linux/drivers/net/defxx.c linux/drivers/net/defxx.c --- v2.2.5/linux/drivers/net/defxx.c Tue Feb 23 15:21:33 1999 +++ linux/drivers/net/defxx.c Fri Apr 16 13:58:46 1999 @@ -1911,6 +1911,8 @@ } bp = (DFX_board_t *) dev->priv; + spin_lock(&bp->lock); + /* See if we're already servicing an interrupt */ if (dev->interrupt) @@ -1955,6 +1957,7 @@ } dev->interrupt = DFX_UNMASK_INTERRUPTS; + spin_unlock(&bp->lock); return; } @@ -3205,10 +3208,11 @@ ) { - DFX_board_t *bp = (DFX_board_t *) dev->priv; - u8 prod; /* local transmit producer index */ + DFX_board_t *bp = (DFX_board_t *) dev->priv; + u8 prod; /* local transmit producer index */ PI_XMT_DESCR *p_xmt_descr; /* ptr to transmit descriptor block entry */ XMT_DRIVER_DESCR *p_xmt_drv_descr; /* ptr to transmit driver descriptor */ + unsigned long flags; /* * Verify that incoming transmit request is OK @@ -3252,6 +3256,8 @@ } } + spin_lock_irqsave(&bp->lock, flags); + /* Get the current producer and the next free xmt data descriptor */ prod = bp->rcv_xmt_reg.index.xmt_prod; @@ -3272,9 +3278,10 @@ /* Write the three PRH bytes immediately before the FC byte */ - *((char *)skb->data - 3) = DFX_PRH0_BYTE; /* these byte values are defined */ - *((char *)skb->data - 2) = DFX_PRH1_BYTE; /* in the Motorola FDDI MAC chip */ - *((char *)skb->data - 1) = DFX_PRH2_BYTE; /* specification */ + skb_push(skb,3); + skb->data[0] = DFX_PRH0_BYTE; /* these byte values are defined */ + skb->data[1] = DFX_PRH1_BYTE; /* in the Motorola FDDI MAC chip */ + skb->data[2] = DFX_PRH2_BYTE; /* specification */ /* * Write the descriptor with buffer info and bump producer @@ -3304,7 +3311,7 @@ */ p_xmt_descr->long_0 = (u32) (PI_XMT_DESCR_M_SOP | PI_XMT_DESCR_M_EOP | ((skb->len + 3) << PI_XMT_DESCR_V_SEG_LEN)); - p_xmt_descr->long_1 = (u32) virt_to_bus(skb->data - 3); + p_xmt_descr->long_1 = (u32) virt_to_bus(skb->data); /* * Verify that descriptor is actually available @@ -3318,7 +3325,11 @@ */ if (prod == bp->rcv_xmt_reg.index.xmt_comp) + { + skb_pull(skb,3); + spin_unlock_irqrestore(&bp->lock, flags); return(1); /* requeue packet for later */ + } /* * Save info for this packet for xmt done indication routine @@ -3342,6 +3353,7 @@ bp->rcv_xmt_reg.index.xmt_prod = prod; dfx_port_write_long(bp, PI_PDQ_K_REG_TYPE_2_PROD, bp->rcv_xmt_reg.lword); + spin_unlock_irqrestore(&bp->lock, flags); return(0); /* packet queued to adapter */ } diff -u --recursive --new-file v2.2.5/linux/drivers/net/defxx.h linux/drivers/net/defxx.h --- v2.2.5/linux/drivers/net/defxx.h Fri May 8 23:14:48 1998 +++ linux/drivers/net/defxx.h Fri Apr 16 13:58:46 1999 @@ -1748,6 +1748,10 @@ /* Store pointers to transmit buffers for transmit completion code */ XMT_DRIVER_DESCR xmt_drv_descr_blk[PI_XMT_DATA_K_NUM_ENTRIES]; + + /* Transmit spinlocks */ + + spinlock_t lock; /* Store device, bus-specific, and parameter information for this adapter */ diff -u --recursive --new-file v2.2.5/linux/drivers/net/irda/Makefile linux/drivers/net/irda/Makefile --- v2.2.5/linux/drivers/net/irda/Makefile Wed Mar 10 15:29:46 1999 +++ linux/drivers/net/irda/Makefile Thu Apr 15 05:42:41 1999 @@ -10,7 +10,7 @@ L_TARGET := irda_drivers.a L_OBJS := M_OBJS := -MOD_LIST_NAME := IRDA_MODULES +MOD_LIST_NAME := IRDA_DRIVERS_MODULES ifeq ($(CONFIG_IRTTY_SIR),y) L_OBJS += irtty.o diff -u --recursive --new-file v2.2.5/linux/drivers/net/irda/irport.c linux/drivers/net/irda/irport.c --- v2.2.5/linux/drivers/net/irda/irport.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/net/irda/irport.c Thu Apr 15 05:42:41 1999 @@ -64,13 +64,14 @@ #include #define IO_EXTENT 8 +#define CONFIG_HALF_DUPLEX -static unsigned int io[] = { 0x3e8, ~0, ~0, ~0 }; -static unsigned int irq[] = { 11, 0, 0, 0 }; +/* static unsigned int io[] = { 0x3e8, ~0, ~0, ~0 }; */ +/* static unsigned int irq[] = { 11, 0, 0, 0 }; */ -static void irport_write_wakeup( struct irda_device *idev); -static int irport_write( int iobase, int fifo_size, __u8 *buf, int len); -static void irport_receive( struct irda_device *idev); +static void irport_write_wakeup(struct irda_device *idev); +static int irport_write(int iobase, int fifo_size, __u8 *buf, int len); +static void irport_receive(struct irda_device *idev); __initfunc(int irport_init(void)) { @@ -115,15 +116,15 @@ */ int irport_open( int iobase) { - DEBUG( 0, __FUNCTION__ "(), iobase=%#x\n", iobase); + DEBUG(4, __FUNCTION__ "(), iobase=%#x\n", iobase); /* Initialize UART */ - outb( UART_LCR_WLEN8, iobase+UART_LCR); /* Reset DLAB */ - outb(( UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase+UART_MCR); + outb(UART_LCR_WLEN8, iobase+UART_LCR); /* Reset DLAB */ + outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase+UART_MCR); /* Turn on interrups */ - outb(( UART_IER_THRI |UART_IER_RLSI | UART_IER_RDI), iobase+UART_IER); - + outb((UART_IER_RLSI | UART_IER_RDI), iobase+UART_IER); + return 0; } @@ -135,13 +136,13 @@ */ void irport_close( int iobase) { - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); /* Reset UART */ - outb( 0, iobase+UART_MCR); + outb(0, iobase+UART_MCR); /* Turn off interrupts */ - outb( 0, iobase+UART_IER); + outb(0, iobase+UART_IER); } /* @@ -158,10 +159,8 @@ DEBUG( 0, __FUNCTION__ "(), Setting speed to: %d\n", speed); - DEBUG( 0, __FUNCTION__ "(), iobase=%#x\n", iobase); - /* Turn off interrupts */ - outb( 0, iobase+UART_IER); + outb(0, iobase+UART_IER); divisor = SPEED_MAX/speed; @@ -170,55 +169,14 @@ /* IrDA ports use 8N1 */ lcr = UART_LCR_WLEN8; - outb( UART_LCR_DLAB | lcr, iobase+UART_LCR); /* Set DLAB */ - outb( divisor & 0xff, iobase+UART_DLL); /* Set speed */ - outb( divisor >> 8, iobase+UART_DLM); - outb( lcr, iobase+UART_LCR); /* Set 8N1 */ - outb( fcr, iobase+UART_FCR); /* Enable FIFO's */ - - /* Turn on interrups */ - outb( UART_IER_THRI|UART_IER_RLSI|UART_IER_RDI, iobase+UART_IER); -} - -/* - * Function irport_interrupt (irq, dev_id, regs) - * - * - */ -void irport_interrupt( int irq, void *dev_id, struct pt_regs *regs) -{ - struct irda_device *idev = (struct irda_device *) dev_id; - - int iobase, status; - int iir; - - DEBUG( 4, __FUNCTION__ "(), irq %d\n", irq); - - if ( !idev) { - printk( KERN_WARNING __FUNCTION__ - "() irq %d for unknown device.\n", irq); - return; - } - - idev->netdev.interrupt = 1; + outb(UART_LCR_DLAB | lcr, iobase+UART_LCR); /* Set DLAB */ + outb(divisor & 0xff, iobase+UART_DLL); /* Set speed */ + outb(divisor >> 8, iobase+UART_DLM); + outb(lcr, iobase+UART_LCR); /* Set 8N1 */ + outb(fcr, iobase+UART_FCR); /* Enable FIFO's */ - iobase = idev->io.iobase2; - - iir = inb(iobase + UART_IIR); - do { - status = inb( iobase+UART_LSR); - - if (status & UART_LSR_DR) { - /* Receive interrupt */ - irport_receive(idev); - } - if (status & UART_LSR_THRE) { - /* Transmitter ready for data */ - irport_write_wakeup(idev); - } - } while (!(inb(iobase+UART_IIR) & UART_IIR_NO_INT)); - - idev->netdev.interrupt = 0; + /* Turn on receive interrups */ + outb(UART_IER_RLSI|UART_IER_RDI, iobase+UART_IER); } /* @@ -231,34 +189,38 @@ static void irport_write_wakeup( struct irda_device *idev) { int actual = 0, count; - - DEBUG( 4, __FUNCTION__ "() <%ld>\n", jiffies); - - ASSERT( idev != NULL, return;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return;); + int iobase; - /* Finished with frame? */ - if ( idev->tx_buff.offset == idev->tx_buff.len) { + ASSERT(idev != NULL, return;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return;); + /* Finished with frame? */ + if (idev->tx_buff.offset == idev->tx_buff.len) { + iobase = idev->io.iobase2; /* * Now serial buffer is almost free & we can start * transmission of another packet */ - DEBUG( 4, __FUNCTION__ "(), finished with frame!\n"); - idev->netdev.tbusy = 0; /* Unlock */ idev->stats.tx_packets++; /* Schedule network layer, so we can get some more frames */ - mark_bh( NET_BH); - + mark_bh(NET_BH); +#ifdef CONFIG_HALF_DUPLEX + outb(UART_FCR_ENABLE_FIFO | + UART_FCR_TRIGGER_14 | + UART_FCR_CLEAR_RCVR, iobase+UART_FCR); /* Enable FIFO's */ + + /* Turn on receive interrupts */ + outb(UART_IER_RLSI|UART_IER_RDI, iobase+UART_IER); +#endif return; } /* Write data left in transmit buffer */ count = idev->tx_buff.len - idev->tx_buff.offset; - actual = irport_write( idev->io.iobase2, idev->io.fifo_size, - idev->tx_buff.head, count); + actual = irport_write(idev->io.iobase2, idev->io.fifo_size, + idev->tx_buff.head, count); idev->tx_buff.offset += actual; idev->tx_buff.head += actual; } @@ -269,12 +231,12 @@ * * */ -static int irport_write( int iobase, int fifo_size, __u8 *buf, int len) +static int irport_write(int iobase, int fifo_size, __u8 *buf, int len) { int actual = 0; /* Tx FIFO should be empty! */ - if (!(inb( iobase+UART_LSR) & UART_LSR_THRE)) { + if (!(inb(iobase+UART_LSR) & UART_LSR_THRE)) { DEBUG( 0, __FUNCTION__ "(), failed, fifo not empty!\n"); return -1; } @@ -287,8 +249,8 @@ actual++; } - DEBUG( 4, __FUNCTION__ "(), fifo_size %d ; %d sent of %d\n", - fifo_size, actual, len); + DEBUG(4, __FUNCTION__ "(), fifo_size %d ; %d sent of %d\n", + fifo_size, actual, len); return actual; } @@ -300,43 +262,44 @@ * waits until the next transmitt interrupt, and continues until the * frame is transmited. */ -int irport_hard_xmit( struct sk_buff *skb, struct device *dev) +int irport_hard_xmit(struct sk_buff *skb, struct device *dev) { struct irda_device *idev; - int actual; - - DEBUG( 4, __FUNCTION__ "()\n"); + int actual = 0; + int iobase; - ASSERT( dev != NULL, return -1;); + DEBUG(5, __FUNCTION__ "(), dev=%p\n", dev); - if ( dev->tbusy) { - DEBUG( 4, __FUNCTION__ "(), tbusy==TRUE\n"); - - return -EBUSY; - } + ASSERT(dev != NULL, return 0;); idev = (struct irda_device *) dev->priv; - ASSERT( idev != NULL, return -1;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return -1;); + ASSERT(idev != NULL, return 0;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return 0;); + + iobase = idev->io.iobase2; /* Lock transmit buffer */ - if ( irda_lock( (void *) &dev->tbusy) == FALSE) + if (irda_lock((void *) &dev->tbusy) == FALSE) return -EBUSY; /* * Transfer skb to tx_buff while wrapping, stuffing and making CRC */ - idev->tx_buff.len = async_wrap_skb( skb, idev->tx_buff.data, - idev->tx_buff.truesize); + idev->tx_buff.len = async_wrap_skb(skb, idev->tx_buff.data, + idev->tx_buff.truesize); - actual = irport_write( idev->io.iobase2, idev->io.fifo_size, - idev->tx_buff.data, idev->tx_buff.len); +/* actual = irport_write(idev->io.iobase2, idev->io.fifo_size, */ +/* idev->tx_buff.data, idev->tx_buff.len); */ idev->tx_buff.offset = actual; idev->tx_buff.head = idev->tx_buff.data + actual; - - dev_kfree_skb( skb); + +#ifdef CONFIG_HALF_DUPLEX + /* Turn on transmit finished interrupt. Will fire immediately! */ + outb(UART_IER_THRI, iobase+UART_IER); +#endif + dev_kfree_skb(skb); return 0; } @@ -347,18 +310,19 @@ * Receive one frame from the infrared port * */ -static void irport_receive( struct irda_device *idev) +static void irport_receive(struct irda_device *idev) { int iobase; + int boguscount = 0; - if ( !idev) + if (!idev) return; DEBUG( 4, __FUNCTION__ "()\n"); iobase = idev->io.iobase2; - if ( idev->rx_buff.len == 0) + if (idev->rx_buff.len == 0) idev->rx_buff.head = idev->rx_buff.data; /* @@ -366,10 +330,70 @@ * async_unwrap_char will deliver all found frames */ do { - async_unwrap_char( idev, inb( iobase+UART_RX)); + async_unwrap_char(idev, inb( iobase+UART_RX)); + + /* Make sure we don't stay here to long */ + if (boguscount++ > 32) { + DEBUG(0,__FUNCTION__ "(), breaking!\n"); + break; + } + + } while (inb(iobase+UART_LSR) & UART_LSR_DR); +} + +/* + * Function irport_interrupt (irq, dev_id, regs) + * + * + */ +void irport_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + struct irda_device *idev = (struct irda_device *) dev_id; + + int iobase; + int iir, lsr; + int boguscount = 0; + + DEBUG(5, __FUNCTION__ "(), irq %d\n", irq); + + if (!idev) { + printk(KERN_WARNING __FUNCTION__ + "() irq %d for unknown device.\n", irq); + return; + } + + idev->netdev.interrupt = 1; + + iobase = idev->io.iobase2; + + iir = inb(iobase + UART_IIR) & UART_IIR_ID; + while (iir) { + DEBUG(4,__FUNCTION__ "(), iir=%#x\n", iir); + + /* Clear interrupt */ + lsr = inb(iobase+UART_LSR); + + if ((iir & UART_IIR_THRI) && (lsr & UART_LSR_THRE)) { + /* Transmitter ready for data */ + irport_write_wakeup(idev); + } +#ifdef CONFIG_HALF_DUPLEX + else +#endif + if ((iir & UART_IIR_RDI) && (lsr & UART_LSR_DR)) { + /* Receive interrupt */ + irport_receive(idev); + } - } while ( inb( iobase+UART_LSR) & UART_LSR_DR); + /* Make sure we don't stay here to long */ + if (boguscount++ > 32) + break; + + iir = inb(iobase + UART_IIR) & UART_IIR_ID; + } + idev->netdev.interrupt = 0; } + #ifdef MODULE diff -u --recursive --new-file v2.2.5/linux/drivers/net/irda/irtty.c linux/drivers/net/irda/irtty.c --- v2.2.5/linux/drivers/net/irda/irtty.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/net/irda/irtty.c Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Tue Dec 9 21:18:38 1997 - * Modified at: Tue Feb 9 13:08:25 1999 + * Modified at: Tue Apr 6 21:35:25 1999 * Modified by: Dag Brattli * Sources: slip.c by Laurence Culhane, * Fred N. van Kempen, @@ -33,7 +33,6 @@ #include #include -#include #include #include #include @@ -191,7 +190,6 @@ /* * Initialize driver */ - /* self->idev.flags |= SIR_MODE | IO_PIO; */ self->idev.rx_buff.state = OUTSIDE_FRAME; /* @@ -207,7 +205,7 @@ IR_115200; self->idev.qos.min_turn_time.bits = 0x03; self->idev.flags = IFF_SIR | IFF_PIO; - irda_qos_bits_to_value( &self->idev.qos); + irda_qos_bits_to_value(&self->idev.qos); /* Specify which buffer allocation policy we need */ self->idev.rx_buff.flags = GFP_KERNEL; @@ -230,7 +228,7 @@ self->idev.netdev.stop = irtty_net_close; /* Open the IrDA device */ - irda_device_open( &self->idev, name, self); + irda_device_open(&self->idev, name, self); MOD_INC_USE_COUNT; @@ -244,20 +242,20 @@ * and then restoring the TTY line discipline to what it was before it got * hooked to IrDA (which usually is TTY again). */ -static void irtty_close( struct tty_struct *tty) +static void irtty_close(struct tty_struct *tty) { struct irtty_cb *self = (struct irtty_cb *) tty->disc_data; /* First make sure we're connected. */ - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRTTY_MAGIC, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == IRTTY_MAGIC, return;); /* We are not using any dongle anymore! */ - if ( self->dongle_q) - self->dongle_q->dongle->close( &self->idev); + if (self->dongle_q) + self->dongle_q->dongle->close(&self->idev); /* Remove driver */ - irda_device_close( &self->idev); + irda_device_close(&self->idev); /* Stop tty */ tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); @@ -266,11 +264,10 @@ self->tty = NULL; self->magic = 0; - /* hashbin_remove( irtty, 0, self->name); */ - self = hashbin_remove( irtty, (int) self, NULL); + self = hashbin_remove(irtty, (int) self, NULL); - if ( self != NULL) - kfree( self); + if (self != NULL) + kfree(self); MOD_DEC_USE_COUNT; } @@ -579,7 +576,7 @@ * Now serial buffer is almost free & we can start * transmission of another packet */ - DEBUG( 4, __FUNCTION__ "(), finished with frame!\n"); + DEBUG(5, __FUNCTION__ "(), finished with frame!\n"); tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); @@ -649,8 +646,8 @@ memset( new, 0, sizeof( struct dongle_q)); new->dongle = dongle; - /* Insert IrDA compressor into hashbin */ - hashbin_insert( dongles, (QUEUE *) new, dongle->type, NULL); + /* Insert IrDA dongle into hashbin */ + hashbin_insert(dongles, (QUEUE *) new, dongle->type, NULL); return 0; } @@ -668,11 +665,20 @@ } +/* + * Function irtty_set_dtr_rts (tty, dtr, rts) + * + * This function can be used by dongles etc. to set or reset the status + * of the dtr and rts lines + */ void irtty_set_dtr_rts(struct tty_struct *tty, int dtr, int rts) { mm_segment_t fs; - int arg = TIOCM_OUT2; + int arg = 0; +#ifdef TIOCM_OUT2 /* Not defined for ARM */ + arg = TIOCM_OUT2; +#endif if (rts) arg |= TIOCM_RTS; if (dtr) @@ -747,8 +753,7 @@ */ int init_module(void) { - irtty_init(); - return(0); + return irtty_init(); } /* diff -u --recursive --new-file v2.2.5/linux/drivers/net/irda/pc87108.c linux/drivers/net/irda/pc87108.c --- v2.2.5/linux/drivers/net/irda/pc87108.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/net/irda/pc87108.c Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sat Nov 7 21:43:15 1998 - * Modified at: Tue Feb 9 13:29:40 1999 + * Modified at: Sat Apr 3 15:54:47 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli @@ -132,7 +132,7 @@ for ( i=0; (io[i] < 2000) && (i < 4); i++) { int ioaddr = io[i]; - if (check_region(ioaddr, CHIP_IO_EXTENT)) + if (check_region(ioaddr, CHIP_IO_EXTENT) < 0) continue; if (pc87108_open( i, io[i], io2[i], irq[i], dma[i]) == 0) return 0; @@ -151,11 +151,11 @@ { int i; - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - for ( i=0; i < 4; i++) { - if ( dev_self[i]) - pc87108_close( &(dev_self[i]->idev)); + for (i=0; i < 4; i++) { + if (dev_self[i]) + pc87108_close(&(dev_self[i]->idev)); } } #endif /* MODULE */ @@ -233,7 +233,6 @@ idev->tx_buff.truesize = 4000; /* Initialize callbacks */ - idev->hard_xmit = pc87108_hard_xmit; idev->change_speed = pc87108_change_speed; idev->wait_until_sent = pc87108_wait_until_sent; idev->is_receiving = pc87108_is_receiving; @@ -671,7 +670,7 @@ /* Set appropriate speed mode */ switch_bank(iobase, BANK0); - outb( mcr|MCR_TX_DFR, iobase+MCR); + outb(mcr | MCR_TX_DFR, iobase+MCR); /* Give some hits to the transceiver */ pc87108_change_dongle_speed( iobase, speed, idev->io.dongle_id); @@ -805,8 +804,8 @@ switch_bank(iobase, BANK0); outb( inb( iobase+MCR) & ~MCR_DMA_EN, iobase+MCR); - setup_dma( idev->io.dma, idev->tx_buff.data, idev->tx_buff.len, - DMA_MODE_WRITE); + setup_dma(idev->io.dma, idev->tx_buff.data, idev->tx_buff.len, + DMA_MODE_WRITE); /* idev->media_busy = TRUE; */ idev->io.direction = IO_XMIT; @@ -920,29 +919,29 @@ * if it starts to receive a frame. * */ -static int pc87108_dma_receive( struct irda_device *idev) +static int pc87108_dma_receive(struct irda_device *idev) { struct pc87108 *self; int iobase; __u8 bsr; - ASSERT( idev != NULL, return -1;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return -1;); + ASSERT(idev != NULL, return -1;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return -1;); - DEBUG( 4, __FUNCTION__ "\n"); + DEBUG(4, __FUNCTION__ "\n"); self = idev->priv; - iobase= idev->io.iobase; + iobase = idev->io.iobase; /* Save current bank */ - bsr = inb( iobase+BSR); + bsr = inb(iobase+BSR); /* Disable DMA */ - switch_bank( iobase, BANK0); - outb( inb(iobase+MCR) & ~MCR_DMA_EN, iobase+MCR); + switch_bank(iobase, BANK0); + outb(inb(iobase+MCR) & ~MCR_DMA_EN, iobase+MCR); - setup_dma( idev->io.dma, idev->rx_buff.data, idev->rx_buff.truesize, - DMA_MODE_READ); + setup_dma(idev->io.dma, idev->rx_buff.data, + idev->rx_buff.truesize, DMA_MODE_READ); /* driver->media_busy = FALSE; */ idev->io.direction = IO_RECV; @@ -950,22 +949,22 @@ idev->rx_buff.offset = 0; /* Reset Rx FIFO. This will also flush the ST_FIFO */ - outb( FCR_RXTH|FCR_TXTH|FCR_RXSR|FCR_FIFO_EN, iobase+FCR); + outb(FCR_RXTH|FCR_TXTH|FCR_RXSR|FCR_FIFO_EN, iobase+FCR); self->st_fifo.len = self->st_fifo.tail = self->st_fifo.head = 0; /* Choose DMA Rx, DMA Fairness, and Advanced mode */ switch_bank(iobase, BANK2); - outb(( inb( iobase+ECR1) & ~ECR1_DMASWP)|ECR1_DMANF|ECR1_EXT_SL, - iobase+ECR1); + outb((inb( iobase+ECR1) & ~ECR1_DMASWP)|ECR1_DMANF|ECR1_EXT_SL, + iobase+ECR1); /* enable DMA */ switch_bank(iobase, BANK0); - outb( inb( iobase+MCR)|MCR_DMA_EN, iobase+MCR); + outb(inb(iobase+MCR)|MCR_DMA_EN, iobase+MCR); /* Restore bank register */ - outb( bsr, iobase+BSR); + outb(bsr, iobase+BSR); - DEBUG( 4, __FUNCTION__ "(), done!\n"); + DEBUG(4, __FUNCTION__ "(), done!\n"); return 0; } @@ -1481,9 +1480,7 @@ */ int init_module(void) { - pc87108_init(); - - return(0); + return pc87108_init(); } /* @@ -1496,6 +1493,5 @@ { pc87108_cleanup(); } - -#endif +#endif /* MODULE */ diff -u --recursive --new-file v2.2.5/linux/drivers/net/irda/tekram.c linux/drivers/net/irda/tekram.c --- v2.2.5/linux/drivers/net/irda/tekram.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/net/irda/tekram.c Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Wed Oct 21 20:02:35 1998 - * Modified at: Tue Feb 9 15:36:55 1999 + * Modified at: Mon Feb 15 14:13:17 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. diff -u --recursive --new-file v2.2.5/linux/drivers/net/irda/uircc.c linux/drivers/net/irda/uircc.c --- v2.2.5/linux/drivers/net/irda/uircc.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/net/irda/uircc.c Thu Apr 15 05:42:41 1999 @@ -1,13 +1,13 @@ /********************************************************************* * * Filename: uircc.c - * Version: 0.1 + * Version: 0.3 * Description: Driver for the Sharp Universal Infrared - * Communications Controller (UIRCC) + * Communications Controller (UIRCC v 1.3) * Status: Experimental. * Author: Dag Brattli * Created at: Sat Dec 26 10:59:03 1998 - * Modified at: Tue Feb 9 13:30:41 1999 + * Modified at: Sat Apr 3 15:54:41 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. @@ -25,10 +25,6 @@ * 740CDT, Portege 300CT, 660CDT, Satellite 220C Series, * Satellite Pro, 440C Series, 470CDT, 460C Series, 480C Series * - * Notice that FIR mode is not working yet, since I don't know - * how to make the UIRCC drive the interrupt line, and not the - * UART (which is used for SIR speeds). Please mail me if you know! - * ********************************************************************/ #include @@ -69,22 +65,24 @@ static struct uircc_cb *dev_self[] = { NULL, NULL, NULL, NULL}; /* Some prototypes */ -static int uircc_open( int i, unsigned int iobase, unsigned int board_addr, - unsigned int irq, unsigned int dma); -static int uircc_close( struct irda_device *idev); -static int uircc_probe( int iobase, int board_addr, int irq, int dma); -static int uircc_dma_receive( struct irda_device *idev); +static int uircc_open(int i, unsigned int iobase, unsigned int board_addr, + unsigned int irq, unsigned int dma); +#ifdef MODULE +static int uircc_close(struct irda_device *idev); +#endif /* MODULE */ +static int uircc_probe(int iobase, int board_addr, int irq, int dma); +static int uircc_dma_receive(struct irda_device *idev); static int uircc_dma_receive_complete(struct irda_device *idev, int iobase); -static int uircc_hard_xmit( struct sk_buff *skb, struct device *dev); -static void uircc_dma_write( struct irda_device *idev, int iobase); -static void uircc_change_speed( struct irda_device *idev, int baud); +static int uircc_hard_xmit(struct sk_buff *skb, struct device *dev); +static void uircc_dma_write(struct irda_device *idev, int iobase); +static void uircc_change_speed(struct irda_device *idev, int baud); static void uircc_interrupt(int irq, void *dev_id, struct pt_regs *regs); -static void uircc_wait_until_sent( struct irda_device *idev); -static int uircc_is_receiving( struct irda_device *idev); - -static int uircc_net_init( struct device *dev); -static int uircc_net_open( struct device *dev); -static int uircc_net_close( struct device *dev); +static void uircc_wait_until_sent(struct irda_device *idev); +static int uircc_is_receiving(struct irda_device *idev); +static int uircc_toshiba_cmd(int *retval, int arg0, int arg1, int arg2); +static int uircc_net_init(struct device *dev); +static int uircc_net_open(struct device *dev); +static int uircc_net_close(struct device *dev); /* * Function uircc_init () @@ -98,9 +96,9 @@ for ( i=0; (io[i] < 2000) && (i < 4); i++) { int ioaddr = io[i]; - if (check_region(ioaddr, CHIP_IO_EXTENT)) + if (check_region(ioaddr, CHIP_IO_EXTENT) < 0) continue; - if (uircc_open( i, io[i], io2[i], irq[i], dma[i]) == 0) + if (uircc_open(i, io[i], io2[i], irq[i], dma[i]) == 0) return 0; } return -ENODEV; @@ -117,11 +115,11 @@ { int i; - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - for ( i=0; i < 4; i++) { - if ( dev_self[i]) - uircc_close( &(dev_self[i]->idev)); + for (i=0; i < 4; i++) { + if (dev_self[i]) + uircc_close(&(dev_self[i]->idev)); } } #endif /* MODULE */ @@ -132,28 +130,28 @@ * Open driver instance * */ -static int uircc_open( int i, unsigned int iobase, unsigned int iobase2, - unsigned int irq, unsigned int dma) +static int uircc_open(int i, unsigned int iobase, unsigned int iobase2, + unsigned int irq, unsigned int dma) { struct uircc_cb *self; struct irda_device *idev; int ret; - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - if (( uircc_probe( iobase, iobase2, irq, dma)) == -1) + if ((uircc_probe(iobase, iobase2, irq, dma)) == -1) return -1; /* * Allocate new instance of the driver */ self = kmalloc( sizeof(struct uircc_cb), GFP_KERNEL); - if ( self == NULL) { - printk( KERN_ERR "IrDA: Can't allocate memory for " - "IrDA control block!\n"); + if (self == NULL) { + printk(KERN_ERR "IrDA: Can't allocate memory for " + "IrDA control block!\n"); return -ENOMEM; } - memset( self, 0, sizeof(struct uircc_cb)); + memset(self, 0, sizeof(struct uircc_cb)); /* Need to store self somewhere */ dev_self[i] = self; @@ -170,32 +168,32 @@ idev->io.fifo_size = 16; /* Lock the port that we need */ - ret = check_region( idev->io.iobase, idev->io.io_ext); - if ( ret < 0) { - DEBUG( 0, __FUNCTION__ "(), can't get iobase of 0x%03x\n", - idev->io.iobase); + ret = check_region(idev->io.iobase, idev->io.io_ext); + if (ret < 0) { + DEBUG(0, __FUNCTION__ "(), can't get iobase of 0x%03x\n", + idev->io.iobase); /* uircc_cleanup( self->idev); */ return -ENODEV; } - ret = check_region( idev->io.iobase2, idev->io.io_ext2); - if ( ret < 0) { - DEBUG( 0, __FUNCTION__ "(), can't get iobase of 0x%03x\n", - idev->io.iobase2); + ret = check_region(idev->io.iobase2, idev->io.io_ext2); + if (ret < 0) { + DEBUG(0, __FUNCTION__ "(), can't get iobase of 0x%03x\n", + idev->io.iobase2); /* uircc_cleanup( self->idev); */ return -ENODEV; } - request_region( idev->io.iobase, idev->io.io_ext, idev->name); - request_region( idev->io.iobase2, idev->io.io_ext2, idev->name); + request_region(idev->io.iobase, idev->io.io_ext, idev->name); + request_region(idev->io.iobase2, idev->io.io_ext2, idev->name); /* Initialize QoS for this device */ - irda_init_max_qos_capabilies( &idev->qos); + irda_init_max_qos_capabilies(&idev->qos); /* The only value we must override it the baudrate */ idev->qos.baud_rate.bits = IR_9600|IR_19200|IR_38400|IR_57600| - IR_115200|IR_576000|IR_1152000|(IR_4000000 << 8); + IR_115200|/*IR_576000|IR_1152000| */(IR_4000000 << 8); - idev->qos.min_turn_time.bits = 0x07; - irda_qos_bits_to_value( &idev->qos); + idev->qos.min_turn_time.bits = 0x0f; + irda_qos_bits_to_value(&idev->qos); idev->flags = IFF_FIR|IFF_SIR|IFF_DMA|IFF_PIO; @@ -208,7 +206,6 @@ idev->tx_buff.truesize = 4000; /* Initialize callbacks */ - idev->hard_xmit = uircc_hard_xmit; idev->change_speed = uircc_change_speed; idev->wait_until_sent = uircc_wait_until_sent; idev->is_receiving = uircc_is_receiving; @@ -219,10 +216,10 @@ idev->netdev.open = uircc_net_open; idev->netdev.stop = uircc_net_close; - irport_open( iobase2); + irport_open(iobase2); /* Open the IrDA device */ - irda_device_open( idev, driver_name, self); + irda_device_open(idev, driver_name, self); return 0; } @@ -233,36 +230,41 @@ * Close driver instance * */ -static int uircc_close( struct irda_device *idev) +#ifdef MODULE +static int uircc_close(struct irda_device *idev) { int iobase; + int status; - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( idev != NULL, return -1;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return -1;); + ASSERT(idev != NULL, return -1;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return -1;); iobase = idev->io.iobase; + /* Some magic to disable FIR and enable SIR */ + uircc_toshiba_cmd(&status, 0xffff, 0x001b, 0x0000); + /* Disable modem */ - outb( 0x00, iobase+UIRCC_CR10); + outb(0x00, iobase+UIRCC_CR10); - irport_close( idev->io.iobase2); + irport_close(idev->io.iobase2); /* Release the PORT that this driver is using */ - DEBUG( 4, __FUNCTION__ "(), Releasing Region %03x\n", idev->io.iobase); - release_region( idev->io.iobase, idev->io.io_ext); + DEBUG(4, __FUNCTION__ "(), Releasing Region %03x\n", idev->io.iobase); + release_region(idev->io.iobase, idev->io.io_ext); - if ( idev->io.iobase2) { - DEBUG( 4, __FUNCTION__ "(), Releasing Region %03x\n", - idev->io.iobase2); - release_region( idev->io.iobase2, idev->io.io_ext2); + if (idev->io.iobase2) { + DEBUG(4, __FUNCTION__ "(), Releasing Region %03x\n", + idev->io.iobase2); + release_region(idev->io.iobase2, idev->io.io_ext2); } - - irda_device_close( idev); + irda_device_close(idev); return 0; } +#endif /* MODULE */ /* * Function uircc_probe (iobase, board_addr, irq, dma) @@ -270,83 +272,38 @@ * Returns non-negative on success. * */ -static int uircc_probe( int iobase, int iobase2, int irq, int dma) +static int uircc_probe(int iobase, int iobase2, int irq, int dma) { int version; -#if 0 - int probe_irq=0; - unsigned long mask; - int i; -#endif - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); /* read the chip version, should be 0x03 */ - version = inb( iobase+UIRCC_SR8); + version = inb(iobase+UIRCC_SR8); - if ( version != 0x03) { - DEBUG( 0, __FUNCTION__ "(), Wrong chip version"); + if (version != 0x03) { + DEBUG(0, __FUNCTION__ "(), Wrong chip version"); return -1; } - DEBUG( 0, "UIRCC driver loaded. Version: 0x%02x\n", version); + printk(KERN_INFO "Sharp UIRCC IrDA driver loaded. Version: 0x%02x\n", + version); /* Reset chip */ - outb( UIRCC_CR0_SYS_RST, iobase+UIRCC_CR0); + outb(UIRCC_CR0_SYS_RST, iobase+UIRCC_CR0); /* Initialize some registers */ - outb( 0, iobase+UIRCC_CR11); - outb( 0, iobase+UIRCC_CR9); - - /* Enable DMA single mode */ - outb( UIRCC_CR1_RX_DMA|UIRCC_CR1_TX_DMA|UIRCC_CR1_MUST_SET, - iobase+UIRCC_CR1); - - /* Disable interrupts */ - outb( 0xff, iobase+UIRCC_CR2); - -#if 0 - irport_close( iobase2); + outb(0x03, iobase+UIRCC_CR15); + outb(0, iobase+UIRCC_CR11); + outb(0, iobase+UIRCC_CR9); - for (i=0;i<1;i++) { - - /* Set appropriate speed mode */ - outb( UIRCC_CR10_FIR, iobase+UIRCC_CR10); + DEBUG(0, __FUNCTION__ "(), sr15=%#x\n", inb(iobase+UIRCC_SR15)); /* Enable DMA single mode */ - outb( UIRCC_CR1_RX_DMA|UIRCC_CR1_TX_DMA|UIRCC_CR1_MUST_SET, - iobase+UIRCC_CR1); + outb(UIRCC_CR1_RX_DMA|UIRCC_CR1_TX_DMA|UIRCC_CR1_MUST_SET, + iobase+UIRCC_CR1); - /* Set up timer */ - outb( 0x01, iobase+UIRCC_CR12); - outb( 0x00, iobase+UIRCC_CR13); - - /* Set interrupt mask */ - outb( 0x82, iobase+UIRCC_CR2); - - DEBUG( 0, __FUNCTION__ "(*), sr3=%#x, sr2=%#x, sr10=%#x, sr12=%#x\n", - inb( iobase+UIRCC_SR3), inb( iobase+UIRCC_SR2), - inb( iobase+UIRCC_SR10), inb( iobase+UIRCC_SR12)); - - mask = probe_irq_on(); - - /* Enable timer */ - outb( 0x08, iobase+UIRCC_CR11); - - udelay( 10000); /* Wait for interrupt! */ - - probe_irq = probe_irq_off( mask); - - DEBUG( 0, "Found irq=%d\n", probe_irq); - - DEBUG( 0, __FUNCTION__ "(), sr3=%#x, sr2=%#x, sr10=%#x, sr12=%#x\n", - inb( iobase+UIRCC_SR3), inb( iobase+UIRCC_SR2), - inb( iobase+UIRCC_SR10), inb( iobase+UIRCC_SR12)); - - - /* Diable timer */ - outb( 0x00, iobase+UIRCC_CR11); - } -#endif + /* Disable interrupts */ + outb(0xff, iobase+UIRCC_CR2); /* Set self poll address */ @@ -359,16 +316,20 @@ * Change the speed of the device * */ -static void uircc_change_speed( struct irda_device *idev, int speed) +static void uircc_change_speed(struct irda_device *idev, int speed) { struct uircc_cb *self; int iobase; int modem = UIRCC_CR10_SIR; + int status; + + DEBUG(0, __FUNCTION__ "()\n"); - DEBUG( 0, __FUNCTION__ "()\n"); + /* Just test the high speed stuff */ + /*speed = 4000000;*/ - ASSERT( idev != NULL, return;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return;); + ASSERT(idev != NULL, return;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return;); self = idev->priv; iobase = idev->io.iobase; @@ -377,16 +338,20 @@ idev->io.baudrate = speed; /* Disable interrupts */ - outb( 0xff, iobase+UIRCC_CR2); + outb(0xff, iobase+UIRCC_CR2); - switch ( speed) { + switch (speed) { case 9600: case 19200: case 37600: case 57600: case 115200: -/* irport_open( idev->io.iobase2); */ + irport_open(idev->io.iobase2); irport_change_speed( idev->io.iobase2, speed); + + /* Some magic to disable FIR and enable SIR */ + uircc_toshiba_cmd(&status, 0xffff, 0x001b, 0x0000); + modem = UIRCC_CR10_SIR; break; case 576000: @@ -398,9 +363,18 @@ DEBUG(0, __FUNCTION__ "(), handling baud of 1152000\n"); break; case 4000000: - irport_close( idev->io.iobase2); + irport_close(idev->io.iobase2); + + /* Some magic to disable SIR and enable FIR */ + uircc_toshiba_cmd(&status, 0xffff, 0x001b, 0x0001); + modem = UIRCC_CR10_FIR; DEBUG(0, __FUNCTION__ "(), handling baud of 4000000\n"); + + /* Set self pole address */ + outb(0x10, iobase+UIRCC_CR8); + + /* outb(0x10, iobase+UIRCC_CR11); */ break; default: DEBUG( 0, __FUNCTION__ "(), unknown baud rate of %d\n", speed); @@ -408,19 +382,19 @@ } /* Set appropriate speed mode */ - outb( modem, iobase+UIRCC_CR10); + outb(modem, iobase+UIRCC_CR10); idev->netdev.tbusy = 0; /* Enable some interrupts so we can receive frames */ - if ( speed > 115200) { + if (speed > 115200) { /* Enable DMA single mode */ - outb( UIRCC_CR1_RX_DMA|UIRCC_CR1_TX_DMA|UIRCC_CR1_MUST_SET, - iobase+UIRCC_CR1); + outb(UIRCC_CR1_RX_DMA|UIRCC_CR1_TX_DMA|UIRCC_CR1_MUST_SET, + iobase+UIRCC_CR1); - /* outb( UIRCC_CR2_RECV_MASK, iobase+UIRCC_CR2); */ - outb( 0, iobase+UIRCC_CR2); - uircc_dma_receive( idev); + /* Enable all interrupts */ + outb(0, iobase+UIRCC_CR2); + uircc_dma_receive(idev); } } @@ -430,7 +404,7 @@ * Transmit the frame! * */ -static int uircc_hard_xmit( struct sk_buff *skb, struct device *dev) +static int uircc_hard_xmit(struct sk_buff *skb, struct device *dev) { struct irda_device *idev; int iobase; @@ -438,86 +412,97 @@ idev = (struct irda_device *) dev->priv; - ASSERT( idev != NULL, return 0;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return 0;); + ASSERT(idev != NULL, return 0;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return 0;); iobase = idev->io.iobase; - DEBUG(0, __FUNCTION__ "(%ld), skb->len=%d\n", jiffies, (int) skb->len); + DEBUG(4, __FUNCTION__ "(%ld), skb->len=%d\n", jiffies, (int) skb->len); + + /* Reset carrier latch */ + /*outb(0x02, iobase+UIRCC_CR0);*/ /* Use irport for SIR speeds */ if (idev->io.baudrate <= 115200) { return irport_hard_xmit(skb, dev); } + DEBUG(0, __FUNCTION__ "(), sr0=%#x, sr1=%#x, sr2=%#x, sr3=%#x, sr10=%#x, sr11=%#x\n", + inb(iobase+UIRCC_SR0), inb(iobase+UIRCC_SR3), + inb(iobase+UIRCC_SR2), inb(iobase+UIRCC_SR3), + inb(iobase+UIRCC_SR10), inb(iobase+UIRCC_SR11)); + /* Lock transmit buffer */ if (irda_lock((void *) &dev->tbusy) == FALSE) return -EBUSY; - memcpy( idev->tx_buff.data, skb->data, skb->len); + memcpy(idev->tx_buff.data, skb->data, skb->len); /* Make sure that the length is a multiple of 16 bits */ - if ( skb->len & 0x01) + if (skb->len & 0x01) skb->len++; idev->tx_buff.len = skb->len; idev->tx_buff.head = idev->tx_buff.data; idev->tx_buff.offset = 0; - mtt = irda_get_mtt( skb); + mtt = irda_get_mtt(skb); /* Use udelay for delays less than 50 us. */ if (mtt) - udelay( mtt); + udelay(mtt); /* Enable transmit interrupts */ - /* outb( UIRCC_CR2_XMIT_MASK, iobase+UIRCC_CR2); */ - outb( 0, iobase+UIRCC_CR2); + outb(0, iobase+UIRCC_CR2); - uircc_dma_write( idev, iobase); + uircc_dma_write(idev, iobase); - dev_kfree_skb( skb); + dev_kfree_skb(skb); return 0; } /* - * Function uircc_dma_xmit (idev, iobase) + * Function uircc_dma_write (idev, iobase) * * Transmit data using DMA * */ -static void uircc_dma_write( struct irda_device *idev, int iobase) +static void uircc_dma_write(struct irda_device *idev, int iobase) { struct uircc_cb *self; - int i; - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( idev != NULL, return;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return;); + ASSERT(idev != NULL, return;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return;); self = idev->priv; /* Receiving disable */ self->cr3 &= ~UIRCC_CR3_RECV_EN; - outb( self->cr3, iobase+UIRCC_CR3); + outb(self->cr3, iobase+UIRCC_CR3); - setup_dma( idev->io.dma, idev->tx_buff.data, idev->tx_buff.len, - DMA_MODE_WRITE); - - DEBUG( 0, __FUNCTION__ "residue=%d\n", - get_dma_residue( idev->io.dma)); + /* Set modem */ + outb(0x80, iobase+UIRCC_CR10); + + /* Enable transmit DMA */ + outb(UIRCC_CR1_TX_DMA|UIRCC_CR1_MUST_SET, iobase+UIRCC_CR1); + ASSERT((((__u32)(idev->tx_buff.data)) & 0x01) != 0x01, return;); + + setup_dma(idev->io.dma, idev->tx_buff.data, idev->tx_buff.len, + DMA_MODE_WRITE); + idev->io.direction = IO_XMIT; - /* Set frame length */ - outb( idev->tx_buff.len & 0xff, iobase+UIRCC_CR4); /* Low byte */ - outb( idev->tx_buff.len >> 8, iobase+UIRCC_CR5); /* High byte */ + /* Set frame length (should be the real length without padding */ + outb(idev->tx_buff.len & 0xff, iobase+UIRCC_CR4); /* Low byte */ + outb(idev->tx_buff.len >> 8, iobase+UIRCC_CR5); /* High byte */ /* Enable transmit and transmit CRC */ self->cr3 |= (UIRCC_CR3_XMIT_EN|UIRCC_CR3_TX_CRC_EN); - outb( self->cr3, iobase+UIRCC_CR3); + outb(self->cr3, iobase+UIRCC_CR3); } /* @@ -533,33 +518,38 @@ int iobase; int len; - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( idev != NULL, return;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return;); + ASSERT(idev != NULL, return;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return;); self = idev->priv; iobase = idev->io.iobase; /* Select TX counter */ - outb( UIRCC_CR0_CNT_SWT, iobase+UIRCC_CR0); + outb(UIRCC_CR0_CNT_SWT, iobase+UIRCC_CR0); /* Read TX length counter */ - len = inb( iobase+UIRCC_SR4); /* Low byte */ - len |= inb( iobase+UIRCC_SR5) << 8; /* High byte */ + len = inb(iobase+UIRCC_SR4); /* Low byte */ + len |= inb(iobase+UIRCC_SR5) << 8; /* High byte */ + + DEBUG(4, __FUNCTION__ "(), sent %d bytes\n", len); /* Disable transmit */ self->cr3 &= ~UIRCC_CR3_XMIT_EN; - outb( self->cr3, iobase+UIRCC_CR3); + outb(self->cr3, iobase+UIRCC_CR3); + + /* Transmit reset (just to be sure) */ + outb(UIRCC_CR0_XMIT_RST, iobase+UIRCC_CR0); /* Check for underrrun! */ - if ( underrun) { + if (underrun) { idev->stats.tx_errors++; idev->stats.tx_fifo_errors++; } else { idev->stats.tx_packets++; - idev->stats.tx_bytes += idev->tx_buff.len; + idev->stats.tx_bytes += idev->tx_buff.len; } /* Unlock tx_buff and request another frame */ @@ -567,7 +557,7 @@ idev->media_busy = FALSE; /* Tell the network layer, that we can accept more frames */ - mark_bh( NET_BH); + mark_bh(NET_BH); } /* @@ -577,23 +567,38 @@ * if it starts to receive a frame. * */ -static int uircc_dma_receive( struct irda_device *idev) +static int uircc_dma_receive(struct irda_device *idev) { struct uircc_cb *self; int iobase; - ASSERT( idev != NULL, return -1;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return -1;); + ASSERT(idev != NULL, return -1;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return -1;); - DEBUG( 0, __FUNCTION__ "\n"); + DEBUG(4, __FUNCTION__ "\n"); self = idev->priv; iobase= idev->io.iobase; - /* Disable DMA */ - - setup_dma( idev->io.dma, idev->rx_buff.data, idev->rx_buff.truesize, - DMA_MODE_READ); + /* Transmit disable */ + /* self->cr3 &= ~UIRCC_CR3_XMIT_EN; */ + self->cr3 = 0; + outb(self->cr3, iobase+UIRCC_CR3); + + /* Transmit reset (just in case) */ + outb(UIRCC_CR0_XMIT_RST, iobase+UIRCC_CR0); + + /* Set modem */ + outb(0x08, iobase+UIRCC_CR10); + + /* Make sure Rx DMA is set */ + outb(UIRCC_CR1_RX_DMA|UIRCC_CR1_MUST_SET, iobase+UIRCC_CR1); + + /* Rx reset */ + /* outb(UIRCC_CR0_RECV_RST, iobase+UIRCC_CR0); */ + + setup_dma(idev->io.dma, idev->rx_buff.data, + idev->rx_buff.truesize, DMA_MODE_READ); /* driver->media_busy = FALSE; */ idev->io.direction = IO_RECV; @@ -601,13 +606,13 @@ idev->rx_buff.offset = 0; /* Enable receiving with CRC */ - self->cr3 |= (UIRCC_CR3_RECV_EN|UIRCC_CR3_RX_CRC_EN); - outb( self->cr3, iobase+UIRCC_CR3); + self->cr3 = (UIRCC_CR3_RECV_EN|UIRCC_CR3_RX_CRC_EN); + outb(self->cr3, iobase+UIRCC_CR3); + + DEBUG(4, __FUNCTION__ "(), cr3=%#x\n", self->cr3); /* Address check? */ - DEBUG( 4, __FUNCTION__ "(), done!\n"); - return 0; } @@ -618,7 +623,7 @@ * * */ -static int uircc_dma_receive_complete( struct irda_device *idev, int iobase) +static int uircc_dma_receive_complete(struct irda_device *idev, int iobase) { struct sk_buff *skb; struct uircc_cb *self; @@ -626,37 +631,37 @@ self = idev->priv; - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(0, __FUNCTION__ "()\n"); /* Check for CRC or framing error */ - if ( inb( iobase+UIRCC_SR0) & UIRCC_SR0_RX_CRCFRM) { - DEBUG( 0, __FUNCTION__ "(), crc or frm error\n"); + if (inb(iobase+UIRCC_SR0) & UIRCC_SR0_RX_CRCFRM) { + DEBUG(0, __FUNCTION__ "(), CRC or FRAME error\n"); return -1; } /* Select receive length counter */ - outb( 0x00, iobase+UIRCC_CR0); + outb(0x00, iobase+UIRCC_CR0); /* Read frame length */ - len = inb( iobase+UIRCC_SR4); /* Low byte */ - len |= inb( iobase+UIRCC_SR5) << 8; /* High byte */ + len = inb(iobase+UIRCC_SR4); /* Low byte */ + len |= inb(iobase+UIRCC_SR5) << 8; /* High byte */ - DEBUG( 0, __FUNCTION__ "(), len=%d\n", len); + DEBUG(0, __FUNCTION__ "(), len=%d\n", len); /* Receiving disable */ self->cr3 &= ~UIRCC_CR3_RECV_EN; - outb( self->cr3, iobase+UIRCC_CR3); + outb(self->cr3, iobase+UIRCC_CR3); - skb = dev_alloc_skb( len+1); + skb = dev_alloc_skb(len+1); if (skb == NULL) { - printk( KERN_INFO __FUNCTION__ - "(), memory squeeze, dropping frame.\n"); + printk(KERN_INFO __FUNCTION__ + "(), memory squeeze, dropping frame.\n"); /* Restore bank register */ return FALSE; } /* Make sure IP header gets aligned */ - skb_reserve( skb, 1); + skb_reserve(skb, 1); /* Copy frame without CRC */ /* if ( idev->io.baudrate < 4000000) { */ @@ -667,14 +672,14 @@ /* memcpy( skb->data, idev->rx_buff.head, len-4); */ /* } */ - skb_put( skb, len); - memcpy( skb->data, idev->rx_buff.head, len); + skb_put(skb, len); + memcpy(skb->data, idev->rx_buff.head, len); idev->stats.rx_packets++; skb->dev = &idev->netdev; skb->mac.raw = skb->data; skb->protocol = htons(ETH_P_IRDA); - netif_rx( skb); + netif_rx(skb); return TRUE; } @@ -706,40 +711,44 @@ /* Read interrupt status */ sr3 = inb( iobase+UIRCC_SR3); if (!sr3) { + DEBUG(4,"**\n"); return; } - idev->netdev.interrupt = 1; - DEBUG( 4, __FUNCTION__ "(), sr3=%#x, sr2=%#x, sr10=%#x\n", - inb( iobase+UIRCC_SR3), inb( iobase+UIRCC_SR2), - inb( iobase+UIRCC_SR10)); + DEBUG(4, __FUNCTION__ "(), sr3=%#x, sr2=%#x, sr10=%#x\n", + inb( iobase+UIRCC_SR3), inb( iobase+UIRCC_SR2), + inb( iobase+UIRCC_SR10)); /* * Check what interrupt this is. The UIRCC will not report two * different interrupts at the same time! */ - switch( sr3) { - case UIRCC_SR3_RX_EOF: /* Check of end of frame */ - uircc_dma_receive_complete( idev, iobase); + switch(sr3) { + case UIRCC_SR3_RX_EOF: /* Check for end of frame */ + uircc_dma_receive_complete(idev, iobase); break; case UIRCC_SR3_TXUR: /* Check for transmit underrun */ - uircc_dma_xmit_complete( idev, TRUE); + uircc_dma_xmit_complete(idev, TRUE); + uircc_dma_receive(idev); + outb(0, iobase+UIRCC_CR2); break; case UIRCC_SR3_TX_DONE: - uircc_dma_xmit_complete( idev, FALSE); + uircc_dma_xmit_complete(idev, FALSE); + uircc_dma_receive(idev); + + /* outb(0, iobase+UIRCC_CR2); */ break; case UIRCC_SR3_TMR_OUT: /* Disable timer */ - outb( inb( iobase+UIRCC_CR11) & ~UIRCC_CR11_TMR_EN, - iobase+UIRCC_CR11); + outb(inb(iobase+UIRCC_CR11) & ~UIRCC_CR11_TMR_EN, + iobase+UIRCC_CR11); break; default: - DEBUG( 0, __FUNCTION__ "(), unknown interrupt status=%#x\n", - sr3); + DEBUG(0, __FUNCTION__ "(), unknown interrupt status=%#x\n", + sr3); break; - } - + } idev->netdev.interrupt = 0; } @@ -767,13 +776,13 @@ int status = FALSE; /* int iobase; */ - ASSERT( idev != NULL, return FALSE;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return FALSE;); + ASSERT(idev != NULL, return FALSE;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return FALSE;); - if ( idev->io.baudrate > 115200) { + if (idev->io.baudrate > 115200) { } else - status = ( idev->rx_buff.state != OUTSIDE_FRAME); + status = (idev->rx_buff.state != OUTSIDE_FRAME); return status; } @@ -789,7 +798,7 @@ DEBUG( 4, __FUNCTION__ "()\n"); /* Setup to be a normal IrDA network device driver */ - irda_device_setup( dev); + irda_device_setup(dev); /* Insert overrides below this line! */ @@ -803,23 +812,23 @@ * Start the device * */ -static int uircc_net_open( struct device *dev) +static int uircc_net_open(struct device *dev) { struct irda_device *idev; int iobase; DEBUG( 4, __FUNCTION__ "()\n"); - ASSERT( dev != NULL, return -1;); + ASSERT(dev != NULL, return -1;); idev = (struct irda_device *) dev->priv; - ASSERT( idev != NULL, return 0;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return 0;); + ASSERT(idev != NULL, return 0;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return 0;); iobase = idev->io.iobase; - if (request_irq( idev->io.irq, uircc_interrupt, 0, idev->name, - (void *) idev)) { + if (request_irq(idev->io.irq, uircc_interrupt, 0, idev->name, + (void *) idev)) { return -EAGAIN; } /* @@ -827,7 +836,7 @@ * and clean up on failure. */ if (request_dma(idev->io.dma, idev->name)) { - free_irq( idev->io.irq, idev); + free_irq(idev->io.irq, idev); return -EAGAIN; } @@ -854,32 +863,62 @@ struct irda_device *idev; int iobase; - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); /* Stop device */ dev->tbusy = 1; dev->start = 0; - ASSERT( dev != NULL, return -1;); + ASSERT(dev != NULL, return -1;); idev = (struct irda_device *) dev->priv; - ASSERT( idev != NULL, return 0;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return 0;); + ASSERT(idev != NULL, return 0;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return 0;); iobase = idev->io.iobase; - disable_dma( idev->io.dma); + disable_dma(idev->io.dma); /* Disable interrupts */ - free_irq( idev->io.irq, idev); - free_dma( idev->io.dma); + free_irq(idev->io.irq, idev); + free_dma(idev->io.dma); MOD_DEC_USE_COUNT; return 0; } +/* + * Function uircc_toshiba_cmd (arg0, arg1, arg2) + * + * disable FIR: uircc_toshiba_cmd(&status, 0xffff, 0x001b, 0x0000); + * enable FIR: uircc_toshiba_cmd(&status, 0xffff, 0x001b, 0x0001); + * IRDA status: uircc_toshiba_cmd(&status, 0xfefe, 0x001b, 0x0000); + */ +static int uircc_toshiba_cmd(int *retval, int arg0, int arg1, int arg2) +{ + char return_code = 0; + + __asm__ volatile ("inb $0xb2,%%al; " + "movb %%ah,%%al; " + : /* Output */ + "=al" (return_code), + "=ecx" (*retval) + : /* Input */ + "ax" (arg0), + "bx" (arg1), + "cx" (arg2) + ); + /* + * Return + * 0x00 = OK + * 0x80 = Function not supported by system + * 0x83 = Input data error + */ + return (int) return_code; +} + #ifdef MODULE /* @@ -890,9 +929,7 @@ */ int init_module(void) { - uircc_init(); - - return(0); + return uircc_init(); } /* @@ -905,6 +942,5 @@ { uircc_cleanup(); } - -#endif +#endif /* MODULE */ diff -u --recursive --new-file v2.2.5/linux/drivers/net/irda/w83977af_ir.c linux/drivers/net/irda/w83977af_ir.c --- v2.2.5/linux/drivers/net/irda/w83977af_ir.c Wed Mar 10 15:29:46 1999 +++ linux/drivers/net/irda/w83977af_ir.c Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Paul VanderSpek * Created at: Wed Nov 4 11:46:16 1998 - * Modified at: Tue Feb 9 13:30:35 1999 + * Modified at: Wed Apr 7 17:35:59 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Corel Computer Corp. @@ -22,7 +22,7 @@ * provided "AS-IS" and at no charge. * * If you find bugs in this file, its very likely that the same bug - * will also be in w83977af_ir.c since the implementations is quite + * will also be in pc87108.c since the implementations is quite * similar. * * Notice that all functions that needs to access the chip in _any_ @@ -67,8 +67,8 @@ #define CHIP_IO_EXTENT 8 -static unsigned int io[] = { 0x400, ~0, ~0, ~0 }; -static unsigned int irq[] = { 22, 0, 0, 0 }; +static unsigned int io[] = { 0x180, ~0, ~0, ~0 }; +static unsigned int irq[] = { 6, 0, 0, 0 }; static unsigned int dma[] = { 0, 0, 0, 0 }; static struct irda_device *dev_self[] = { NULL, NULL, NULL, NULL}; @@ -116,7 +116,7 @@ for ( i=0; (io[i] < 2000) && (i < 4); i++) { int ioaddr = io[i]; - if (check_region(ioaddr, CHIP_IO_EXTENT)) + if (check_region(ioaddr, CHIP_IO_EXTENT) < 0) continue; if (w83977af_open( i, io[i], irq[i], dma[i]) == 0) return 0; @@ -216,7 +216,6 @@ idev->tx_buff.truesize = 4000; /* Initialize callbacks */ - idev->hard_xmit = w83977af_hard_xmit; idev->change_speed = w83977af_change_speed; idev->wait_until_sent = w83977af_wait_until_sent; idev->is_receiving = w83977af_is_receiving; @@ -290,9 +289,10 @@ /* Configure PnP port, IRQ, and DMA channel */ w977_write_reg(0x60, (iobase >> 8) & 0xff); w977_write_reg(0x61, (iobase) & 0xff); - w977_write_reg(0x70, 0x06); + /* w977_write_reg(0x70, 0x06); */ + w977_write_reg(0x70, irq); #ifdef NETWINDER - w977_write_reg(0x74, dma+1); /* Netwinder uses 1 higher than Linux */ + w977_write_reg(0x74, dma+1); /* Netwinder uses one higher than Linux */ #else w977_write_reg(0x74, dma); #endif @@ -433,7 +433,7 @@ /* set FIFO threshold to TX17, RX16 */ switch_bank(iobase, SET0); - outb( UFR_RXTL|UFR_TXTL|UFR_TXF_RST|UFR_RXF_RST|UFR_EN_FIFO, iobase+UFR); + outb(UFR_RXTL|UFR_TXTL|UFR_TXF_RST|UFR_RXF_RST|UFR_EN_FIFO, iobase+UFR); idev->netdev.tbusy = 0; @@ -464,65 +464,65 @@ idev = (struct irda_device *) dev->priv; - ASSERT( idev != NULL, return 0;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return 0;); + ASSERT(idev != NULL, return 0;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return 0;); iobase = idev->io.iobase; DEBUG(4, __FUNCTION__ "(%ld), skb->len=%d\n", jiffies, (int) skb->len); /* Lock transmit buffer */ - if ( irda_lock( (void *) &dev->tbusy) == FALSE) + if (irda_lock((void *) &dev->tbusy) == FALSE) return -EBUSY; - + /* Save current set */ - set = inb( iobase+SSR); + set = inb(iobase+SSR); /* Decide if we should use PIO or DMA transfer */ - if ( idev->io.baudrate > 115200) { - memcpy( idev->tx_buff.data, skb->data, skb->len); + if (idev->io.baudrate > 115200) { + memcpy(idev->tx_buff.data, skb->data, skb->len); idev->tx_buff.len = skb->len; idev->tx_buff.head = idev->tx_buff.data; idev->tx_buff.offset = 0; - mtt = irda_get_mtt( skb); - if ( mtt > 50) { + mtt = irda_get_mtt(skb); + if (mtt > 50) { /* Adjust for timer resolution */ - mtt /= 1000+1; + mtt = mtt / 1000 + 1; /* Setup timer */ - switch_bank( iobase, SET4); - outb( mtt & 0xff, iobase+TMRL); - outb(( mtt >> 8) & 0x0f, iobase+TMRH); + switch_bank(iobase, SET4); + outb(mtt & 0xff, iobase+TMRL); + outb((mtt >> 8) & 0x0f, iobase+TMRH); /* Start timer */ - outb( IR_MSL_EN_TMR, iobase+IR_MSL); + outb(IR_MSL_EN_TMR, iobase+IR_MSL); idev->io.direction = IO_XMIT; /* Enable timer interrupt */ - switch_bank( iobase, SET0); - outb( ICR_ETMRI, iobase+ICR); + switch_bank(iobase, SET0); + outb(ICR_ETMRI, iobase+ICR); } else { - if ( mtt) - udelay( mtt); + if (mtt) + udelay(mtt); /* Enable DMA interrupt */ - switch_bank( iobase, SET0); - outb( ICR_EDMAI, iobase+ICR); - w83977af_dma_write( idev, iobase); + switch_bank(iobase, SET0); + outb(ICR_EDMAI, iobase+ICR); + w83977af_dma_write(idev, iobase); } } else { - idev->tx_buff.len = async_wrap_skb( skb, idev->tx_buff.data, - idev->tx_buff.truesize); + idev->tx_buff.len = async_wrap_skb(skb, idev->tx_buff.data, + idev->tx_buff.truesize); idev->tx_buff.offset = 0; idev->tx_buff.head = idev->tx_buff.data; /* Add interrupt on tx low level (will fire immediately) */ switch_bank( iobase, SET0); - outb( ICR_ETXTHI, iobase+ICR); + outb(ICR_ETXTHI, iobase+ICR); } - dev_kfree_skb( skb); + dev_kfree_skb(skb); /* Restore set register */ outb( set, iobase+SSR); @@ -550,23 +550,23 @@ switch_bank(iobase, SET0); outb( inb( iobase+HCR) & ~HCR_EN_DMA, iobase+HCR); - setup_dma( idev->io.dma, idev->tx_buff.data, idev->tx_buff.len, - DMA_MODE_WRITE); + setup_dma(idev->io.dma, idev->tx_buff.data, idev->tx_buff.len, + DMA_MODE_WRITE); /* idev->media_busy = TRUE; */ idev->io.direction = IO_XMIT; /* Choose transmit DMA channel */ switch_bank(iobase, SET2); - outb( inb( iobase+ADCR1) | ADCR1_D_CHSW|ADCR1_DMA_F|ADCR1_ADV_SL, - iobase+ADCR1); + outb(inb(iobase+ADCR1) | ADCR1_D_CHSW|ADCR1_DMA_F|ADCR1_ADV_SL, + iobase+ADCR1); /* Enable DMA */ - switch_bank( iobase, SET0); - outb( inb( iobase+HCR) | HCR_EN_DMA, iobase+HCR); + switch_bank(iobase, SET0); + outb(inb(iobase+HCR) | HCR_EN_DMA, iobase+HCR); /* Restore set register */ - outb( set, iobase+SSR); + outb(set, iobase+SSR); } /* @@ -575,7 +575,7 @@ * * */ -static int w83977af_pio_write( int iobase, __u8 *buf, int len, int fifo_size) +static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size) { int actual = 0; __u8 set; @@ -586,7 +586,7 @@ set = inb( iobase+SSR); switch_bank( iobase, SET0); - if (!( inb_p( iobase+USR) & USR_TSRE)) { + if (!(inb_p(iobase+USR) & USR_TSRE)) { DEBUG( 4, __FUNCTION__ "(), warning, FIFO not empty yet!\n"); fifo_size -= 17; @@ -599,11 +599,11 @@ outb( buf[actual++], iobase+TBR); } - DEBUG( 4, __FUNCTION__ "(), fifo_size %d ; %d sent of %d\n", - fifo_size, actual, len); + DEBUG(4, __FUNCTION__ "(), fifo_size %d ; %d sent of %d\n", + fifo_size, actual, len); /* Restore bank */ - outb( set, iobase+SSR); + outb(set, iobase+SSR); return actual; } @@ -615,34 +615,34 @@ * * */ -void w83977af_dma_xmit_complete( struct irda_device *idev) +void w83977af_dma_xmit_complete(struct irda_device *idev) { int iobase; __u8 set; - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( idev != NULL, return;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return;); + ASSERT(idev != NULL, return;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return;); iobase = idev->io.iobase; /* Save current set */ - set = inb( iobase+SSR); + set = inb(iobase+SSR); /* Disable DMA */ switch_bank(iobase, SET0); - outb( inb(iobase+HCR) & ~HCR_EN_DMA, iobase+HCR); + outb(inb(iobase+HCR) & ~HCR_EN_DMA, iobase+HCR); /* Check for underrrun! */ - if ( inb( iobase+AUDR) & AUDR_UNDR) { - DEBUG( 0, __FUNCTION__ "(), Transmit underrun!\n"); + if (inb(iobase+AUDR) & AUDR_UNDR) { + DEBUG(0, __FUNCTION__ "(), Transmit underrun!\n"); idev->stats.tx_errors++; idev->stats.tx_fifo_errors++; /* Clear bit, by writing 1 to it */ - outb( AUDR_UNDR, iobase+AUDR); + outb(AUDR_UNDR, iobase+AUDR); } else idev->stats.tx_packets++; @@ -651,10 +651,10 @@ idev->media_busy = FALSE; /* Tell the network layer, that we want more frames */ - mark_bh( NET_BH); + mark_bh(NET_BH); /* Restore set */ - outb( set, iobase+SSR); + outb(set, iobase+SSR); } /* @@ -664,7 +664,7 @@ * if it starts to receive a frame. * */ -int w83977af_dma_receive( struct irda_device *idev) +int w83977af_dma_receive(struct irda_device *idev) { int iobase; __u8 set; @@ -673,10 +673,10 @@ __u8 hcr; #endif - ASSERT( idev != NULL, return -1;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return -1;); + ASSERT(idev != NULL, return -1;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return -1;); - DEBUG( 0, __FUNCTION__ "\n"); + DEBUG(0, __FUNCTION__ "\n"); iobase= idev->io.iobase; @@ -697,8 +697,8 @@ set_dma_addr( idev->io.dma, virt_to_bus(idev->rx_buff.data)); set_dma_count( idev->io.dma, idev->rx_buff.truesize); #else - setup_dma( idev->io.dma, idev->rx_buff.data, idev->rx_buff.truesize, - DMA_MODE_READ); + setup_dma(idev->io.dma, idev->rx_buff.data, + idev->rx_buff.truesize, DMA_MODE_READ); #endif /* driver->media_busy = FALSE; */ idev->io.direction = IO_RECV; @@ -895,23 +895,23 @@ * Handle SIR interrupt * */ -static __u8 w83977af_sir_interrupt( struct irda_device *idev, int isr) +static __u8 w83977af_sir_interrupt(struct irda_device *idev, int isr) { int len; int actual; __u8 new_icr = 0; - DEBUG( 4, __FUNCTION__ "(), isr=%#x\n", isr); + DEBUG(4, __FUNCTION__ "(), isr=%#x\n", isr); /* Transmit FIFO low on data */ - if ( isr & ISR_TXTH_I) { + if (isr & ISR_TXTH_I) { /* Write data left in transmit buffer */ len = idev->tx_buff.len - idev->tx_buff.offset; - ASSERT( len > 0, return 0;); - actual = w83977af_pio_write( idev->io.iobase, - idev->tx_buff.head, - len, idev->io.fifo_size); + ASSERT(len > 0, return 0;); + actual = w83977af_pio_write(idev->io.iobase, + idev->tx_buff.head, + len, idev->io.fifo_size); idev->tx_buff.offset += actual; idev->tx_buff.head += actual; @@ -931,7 +931,7 @@ new_icr |= ICR_ETXTHI; } /* Check if transmission has completed */ - if ( isr & ISR_TXEMP_I) { + if (isr & ISR_TXEMP_I) { /* Turn around and get ready to receive some data */ idev->io.direction = IO_RECV; @@ -939,8 +939,8 @@ } /* Rx FIFO threshold or timeout */ - if ( isr & ISR_RXTH_I) { - w83977af_pio_receive( idev); + if (isr & ISR_RXTH_I) { + w83977af_pio_receive(idev); /* Keep receiving */ new_icr |= ICR_ERBRI; @@ -964,64 +964,64 @@ iobase = idev->io.iobase; - set = inb( iobase+SSR); + set = inb(iobase+SSR); /* End of frame detected in FIFO */ - if ( isr & (ISR_FEND_I|ISR_FSF_I)) { - if ( w83977af_dma_receive_complete( idev)) { + if (isr & (ISR_FEND_I|ISR_FSF_I)) { + if (w83977af_dma_receive_complete(idev)) { new_icr |= ICR_EFSFI; } else { /* DMA not finished yet */ /* Set timer value, resolution 1 ms */ - switch_bank( iobase, SET4); - outb( 0x01, iobase+TMRL); /* 1 ms */ - outb( 0x00, iobase+TMRH); + switch_bank(iobase, SET4); + outb(0x01, iobase+TMRL); /* 1 ms */ + outb(0x00, iobase+TMRH); /* Start timer */ - outb( IR_MSL_EN_TMR, iobase+IR_MSL); + outb(IR_MSL_EN_TMR, iobase+IR_MSL); new_icr |= ICR_ETMRI; } } /* Timer finished */ - if ( isr & ISR_TMR_I) { + if (isr & ISR_TMR_I) { /* Disable timer */ - switch_bank( iobase, SET4); - outb( 0, iobase+IR_MSL); + switch_bank(iobase, SET4); + outb(0, iobase+IR_MSL); /* Clear timer event */ /* switch_bank(iobase, SET0); */ /* outb( ASCR_CTE, iobase+ASCR); */ /* Check if this is a TX timer interrupt */ - if ( idev->io.direction == IO_XMIT) { - w83977af_dma_write( idev, iobase); + if (idev->io.direction == IO_XMIT) { + w83977af_dma_write(idev, iobase); new_icr |= ICR_EDMAI; } else { /* Check if DMA has now finished */ - w83977af_dma_receive_complete( idev); + w83977af_dma_receive_complete(idev); new_icr |= ICR_EFSFI; } } /* Finished with DMA */ - if ( isr & ISR_DMA_I) { + if (isr & ISR_DMA_I) { w83977af_dma_xmit_complete( idev); - + /* Check if there are more frames to be transmitted */ - if ( irda_device_txqueue_empty( idev)) { + if (irda_device_txqueue_empty( idev)) { /* Prepare for receive */ - w83977af_dma_receive( idev); + w83977af_dma_receive(idev); new_icr = ICR_EFSFI; } } /* Restore set */ - outb( set, iobase+SSR); + outb(set, iobase+SSR); return new_icr; } @@ -1039,9 +1039,9 @@ struct irda_device *idev = (struct irda_device *) dev_id; - if ( idev == NULL) { - printk( KERN_WARNING "%s: irq %d for unknown device.\n", - driver_name, irq); + if (idev == NULL) { + printk(KERN_WARNING "%s: irq %d for unknown device.\n", + driver_name, irq); return; } @@ -1050,24 +1050,24 @@ iobase = idev->io.iobase; /* Save current bank */ - set = inb( iobase+SSR); - switch_bank( iobase, SET0); + set = inb(iobase+SSR); + switch_bank(iobase, SET0); - icr = inb( iobase+ICR); - isr = inb( iobase+ISR) & icr; /* Mask out the interesting ones */ + icr = inb(iobase+ICR); + isr = inb(iobase+ISR) & icr; /* Mask out the interesting ones */ - outb( 0, iobase+ICR); /* Disable interrupts */ + outb(0, iobase+ICR); /* Disable interrupts */ - if ( isr) { + if (isr) { /* Dispatch interrupt handler for the current speed */ if ( idev->io.baudrate > 115200) - icr = w83977af_fir_interrupt( idev, isr); + icr = w83977af_fir_interrupt(idev, isr); else - icr = w83977af_sir_interrupt( idev, isr); + icr = w83977af_sir_interrupt(idev, isr); } - outb( icr, iobase+ICR); /* Restore (new) interrupts */ - outb( set, iobase+SSR); /* Restore bank register */ + outb(icr, iobase+ICR); /* Restore (new) interrupts */ + outb(set, iobase+SSR); /* Restore bank register */ idev->netdev.interrupt = 0; } @@ -1078,7 +1078,7 @@ * This function should put the current thread to sleep until all data * have been sent, so it is safe to f.eks. change the speed. */ -static void w83977af_wait_until_sent( struct irda_device *idev) +static void w83977af_wait_until_sent(struct irda_device *idev) { current->state = TASK_INTERRUPTIBLE; schedule_timeout(6); @@ -1090,7 +1090,7 @@ * Return TRUE is we are currently receiving a frame * */ -static int w83977af_is_receiving( struct irda_device *idev) +static int w83977af_is_receiving(struct irda_device *idev) { int status = FALSE; int iobase; @@ -1103,15 +1103,15 @@ iobase = idev->io.iobase; /* Check if rx FIFO is not empty */ - set = inb( iobase+SSR); + set = inb(iobase+SSR); switch_bank( iobase, SET2); if (( inb( iobase+RXFDTH) & 0x3f) != 0) { /* We are receiving something */ status = TRUE; } - outb( set, iobase+SSR); + outb(set, iobase+SSR); } else - status = ( idev->rx_buff.state != OUTSIDE_FRAME); + status = (idev->rx_buff.state != OUTSIDE_FRAME); return status; } @@ -1124,7 +1124,7 @@ */ static int w83977af_net_init( struct device *dev) { - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(0, __FUNCTION__ "()\n"); /* Set up to be a normal IrDA network device driver */ irda_device_setup( dev); @@ -1147,18 +1147,18 @@ int iobase; __u8 set; - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(0, __FUNCTION__ "()\n"); - ASSERT( dev != NULL, return -1;); + ASSERT(dev != NULL, return -1;); idev = (struct irda_device *) dev->priv; - ASSERT( idev != NULL, return 0;); - ASSERT( idev->magic == IRDA_DEVICE_MAGIC, return 0;); + ASSERT(idev != NULL, return 0;); + ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return 0;); iobase = idev->io.iobase; - if (request_irq( idev->io.irq, w83977af_interrupt, 0, idev->name, - (void *) idev)) { + if (request_irq(idev->io.irq, w83977af_interrupt, 0, idev->name, + (void *) idev)) { return -EAGAIN; } /* @@ -1166,7 +1166,7 @@ * and clean up on failure. */ if (request_dma(idev->io.dma, idev->name)) { - free_irq( idev->io.irq, idev); + free_irq(idev->io.irq, idev); return -EAGAIN; } @@ -1176,11 +1176,11 @@ dev->start = 1; /* Save current set */ - set = inb( iobase+SSR); + set = inb(iobase+SSR); /* Enable some interrupts so we can receive frames again */ switch_bank(iobase, SET0); - if ( idev->io.baudrate > 115200) { + if (idev->io.baudrate > 115200) { outb( ICR_EFSFI, iobase+ICR); w83977af_dma_receive( idev); } else @@ -1250,9 +1250,7 @@ */ int init_module(void) { - w83977af_init(); - - return(0); + return w83977af_init(); } /* @@ -1265,5 +1263,4 @@ { w83977af_cleanup(); } - -#endif +#endif /* MODULE */ diff -u --recursive --new-file v2.2.5/linux/drivers/net/rclanmtl.c linux/drivers/net/rclanmtl.c --- v2.2.5/linux/drivers/net/rclanmtl.c Tue Jan 19 11:32:51 1999 +++ linux/drivers/net/rclanmtl.c Mon Apr 12 16:18:27 1999 @@ -2,7 +2,7 @@ ** ************************************************************************* ** ** -** R C L A N M T L . C $Revision: 5 $ +** R C L A N M T L . C $Revision: 6 $ ** ** ** RedCreek I2O LAN Message Transport Layer program module. @@ -29,6 +29,10 @@ ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +** +** 1998-1999, LAN API was modified and enhanced by Alice Hennessy. +** +** Sometime in 1997, LAN API was written from scratch by Wendell Nichols. ** ************************************************************************* */ @@ -200,7 +204,7 @@ /* Special TID Assignments */ #define I2O_IOP_TID 0 -#define I2O_HOST_TID 1 +#define I2O_HOST_TID 0xB91 /* RedCreek I2O private message codes */ #define RC_PRIVATE_GET_MAC_ADDR 0x0001/**/ /* OBSOLETE */ diff -u --recursive --new-file v2.2.5/linux/drivers/net/rclanmtl.h linux/drivers/net/rclanmtl.h --- v2.2.5/linux/drivers/net/rclanmtl.h Tue Jan 19 11:32:51 1999 +++ linux/drivers/net/rclanmtl.h Mon Apr 12 16:18:27 1999 @@ -2,7 +2,7 @@ ** ************************************************************************* ** ** -** R C L A N M T L . H $Revision: 5 $ +** R C L A N M T L . H $Revision: 6 $ ** ** ** RedCreek I2O LAN Message Transport Layer header file. diff -u --recursive --new-file v2.2.5/linux/drivers/net/rcpci45.c linux/drivers/net/rcpci45.c --- v2.2.5/linux/drivers/net/rcpci45.c Tue Jan 19 11:32:51 1999 +++ linux/drivers/net/rcpci45.c Mon Apr 12 16:18:27 1999 @@ -1,4 +1,5 @@ /* +** ** RCpci45.c ** ** @@ -36,16 +37,18 @@ ** ** ** Pete Popov, January 11,99: Fixed a couple of 2.1.x problems -** (virt_to_bus() not called), tested it under 2.2pre5, and added a -** #define to enable the use of the same file for both, the 2.0.x kernels -** as well as the 2.1.x. +** (virt_to_bus() not called), tested it under 2.2pre5 (as a module), and +** added a #define(s) to enable the use of the same file for both, the 2.0.x +** kernels as well as the 2.1.x. ** ** Ported to 2.1.x by Alan Cox 1998/12/9. ** +** Sometime in mid 1998, written by Pete Popov and Brian Moyle. +** ***************************************************************************/ static char *version = -"RedCreek Communications PCI linux driver version 2.00\n"; +"RedCreek Communications PCI linux driver version 2.02\n"; #include @@ -155,11 +158,10 @@ }; -static int RCscan(void); -static struct device -*RCfound_device(struct device *, int, int, int, int, int, int); +static int RCinit(struct device *dev); +static int RCscan(struct device *dev); +static int RCfound_device(struct device *, int, int, int, int, int, int); -static int RCprobe1(struct device *); static int RCopen(struct device *); static int RC_xmit_packet(struct sk_buff *, struct device *); static void RCinterrupt(int, void *, struct pt_regs *); @@ -180,134 +182,143 @@ #ifdef MODULE int init_module(void) #else -int rcpci_probe(struct netdevice *dev) +int rcpci_probe(struct device *dev) #endif { int cards_found; - printk(version); - - root_RCdev = NULL; - cards_found = RCscan(); #ifdef MODULE - return cards_found ? 0 : -ENODEV; + cards_found = RCscan(NULL); #else - return -1; + cards_found = RCscan(dev); #endif + if (cards_found) + printk(version); + return cards_found ? 0 : -ENODEV; } -static int RCscan() +static int RCscan(struct device *dev) { int cards_found = 0; - struct device *dev = 0; + static int pci_index = 0; + + if (!pcibios_present()) + return cards_found; - if (pcibios_present()) + for (;pci_index < 0x8; pci_index++) { - static int pci_index = 0; unsigned char pci_bus, pci_device_fn; int scan_status; int board_index = 0; + unsigned char pci_irq_line; + unsigned short pci_command, vendor, device, class; + unsigned int pci_ioaddr; - for (;pci_index < 0xff; pci_index++) - { - unsigned char pci_irq_line; - unsigned short pci_command, vendor, device, class; - unsigned int pci_ioaddr; - - - scan_status = - (pcibios_find_device (RC_PCI45_VENDOR_ID, - RC_PCI45_DEVICE_ID, - pci_index, - &pci_bus, - &pci_device_fn)); -#ifdef RCDEBUG - printk("rc scan_status = 0x%X\n", scan_status); -#endif - if (scan_status != PCIBIOS_SUCCESSFUL) - break; - pcibios_read_config_word(pci_bus, - pci_device_fn, - PCI_VENDOR_ID, &vendor); - pcibios_read_config_word(pci_bus, - pci_device_fn, - PCI_DEVICE_ID, &device); - pcibios_read_config_byte(pci_bus, - pci_device_fn, - PCI_INTERRUPT_LINE, &pci_irq_line); - pcibios_read_config_dword(pci_bus, - pci_device_fn, - PCI_BASE_ADDRESS_0, &pci_ioaddr); - pcibios_read_config_word(pci_bus, - pci_device_fn, - PCI_CLASS_DEVICE, &class); - - pci_ioaddr &= ~0xf; + scan_status = + (pcibios_find_device (RC_PCI45_VENDOR_ID, + RC_PCI45_DEVICE_ID, + pci_index, + &pci_bus, + &pci_device_fn)); #ifdef RCDEBUG - printk("rc: Found RedCreek PCI adapter\n"); - printk("rc: pci class = 0x%x 0x%x \n", class, class>>8); - printk("rc: pci_bus = %d, pci_device_fn = %d\n", pci_bus, pci_device_fn); - printk("rc: pci_irq_line = 0x%x \n", pci_irq_line); - printk("rc: pci_ioaddr = 0x%x\n", pci_ioaddr); + printk("rc scan_status = 0x%X\n", scan_status); +#endif + if (scan_status != PCIBIOS_SUCCESSFUL) + break; + pcibios_read_config_word(pci_bus, + pci_device_fn, + PCI_VENDOR_ID, &vendor); + pcibios_read_config_word(pci_bus, + pci_device_fn, + PCI_DEVICE_ID, &device); + pcibios_read_config_byte(pci_bus, + pci_device_fn, + PCI_INTERRUPT_LINE, &pci_irq_line); + pcibios_read_config_dword(pci_bus, + pci_device_fn, + PCI_BASE_ADDRESS_0, &pci_ioaddr); + pcibios_read_config_word(pci_bus, + pci_device_fn, + PCI_CLASS_DEVICE, &class); + + pci_ioaddr &= ~0xf; + +#ifdef RCDEBUG + printk("rc: Found RedCreek PCI adapter\n"); + printk("rc: pci class = 0x%x 0x%x \n", class, class>>8); + printk("rc: pci_bus = %d, pci_device_fn = %d\n", pci_bus, pci_device_fn); + printk("rc: pci_irq_line = 0x%x \n", pci_irq_line); + printk("rc: pci_ioaddr = 0x%x\n", pci_ioaddr); #endif -#if 1 - if (check_region(pci_ioaddr, 2*32768)) - { - printk("rc: check_region failed\n"); - continue; - } - else - { - printk("rc: check_region passed\n"); - } + if (check_region(pci_ioaddr, 2*32768)) + { + printk("rc: check_region failed\n"); + continue; + } +#ifdef RCDEBUG + else + { + printk("rc: check_region passed\n"); + } #endif - + + /* + * Get and check the bus-master and latency values. + * Some PCI BIOSes fail to set the master-enable bit. + */ + + pcibios_read_config_word(pci_bus, + pci_device_fn, + PCI_COMMAND, + &pci_command); + if ( ! (pci_command & PCI_COMMAND_MASTER)) { + printk("rc: PCI Master Bit has not been set!\n"); + + pci_command |= PCI_COMMAND_MASTER; + pcibios_write_config_word(pci_bus, + pci_device_fn, + PCI_COMMAND, + pci_command); + } + if ( ! (pci_command & PCI_COMMAND_MEMORY)) { /* - * Get and check the bus-master and latency values. - * Some PCI BIOSes fail to set the master-enable bit. + * If the BIOS did not set the memory enable bit, what else + * did it not initialize? Skip this adapter. */ - - pcibios_read_config_word(pci_bus, - pci_device_fn, - PCI_COMMAND, - &pci_command); - if ( ! (pci_command & PCI_COMMAND_MASTER)) { - printk("rc: PCI Master Bit has not been set!\n"); - - pci_command |= PCI_COMMAND_MASTER; - pcibios_write_config_word(pci_bus, - pci_device_fn, - PCI_COMMAND, - pci_command); - } - if ( ! (pci_command & PCI_COMMAND_MEMORY)) { - /* - * If the BIOS did not set the memory enable bit, what else - * did it not initialize? Skip this adapter. - */ - printk("rc: Adapter %d, PCI Memory Bit has not been set!\n", - cards_found); - printk("rc: Bios problem? \n"); - continue; - } - - dev = RCfound_device(dev, pci_ioaddr, pci_irq_line, - pci_bus, pci_device_fn, - board_index++, cards_found); - - if (dev) { - dev = 0; - cards_found++; - } + printk("rc: Adapter %d, PCI Memory Bit has not been set!\n", + cards_found); + printk("rc: Bios problem? \n"); + continue; + } + + if (!RCfound_device(dev, pci_ioaddr, pci_irq_line, + pci_bus, pci_device_fn, + board_index++, cards_found)) + { + dev = 0; + cards_found++; } } +#ifdef RCDEBUG printk("rc: found %d cards \n", cards_found); +#endif return cards_found; } -static struct device * +static int RCinit(struct device *dev) +{ + dev->open = &RCopen; + dev->hard_start_xmit = &RC_xmit_packet; + dev->stop = &RCclose; + dev->get_stats = &RCget_stats; + dev->do_ioctl = &RCioctl; + dev->set_config = &RCconfig; + return 0; +} + +static int RCfound_device(struct device *dev, int memaddr, int irq, int bus, int function, int product_index, int card_idx) { @@ -324,18 +335,37 @@ * assigned to DPA; and finally, the rest will be assigned to the * the LAN API layer. */ + +#ifdef MODULE dev = (struct device *) kmalloc(dev_size, GFP_DMA | GFP_KERNEL |GFP_ATOMIC); + if (!dev) + { + printk("rc: unable to kmalloc dev\n"); + return 1; + } memset(dev, 0, dev_size); -#ifdef RCDEBUG - printk("rc: dev = 0x%08X\n", (uint)dev); -#endif - /* * dev->priv will point to the start of DPA. */ dev->priv = (void *)(((long)dev + sizeof(struct device) + 15) & ~15); +#else + dev->priv = 0; + dev->priv = (struct device *) kmalloc(dev_size, GFP_DMA | GFP_KERNEL |GFP_ATOMIC); + if (!dev->priv) + { + printk("rc: unable to kmalloc private area\n"); + return 1; + } + memset(dev->priv, 0, dev_size); +#endif + +#ifdef RCDEBUG + printk("rc: dev = 0x%x, dev->priv = 0x%x\n", (uint)dev, (uint)dev->priv); +#endif + pDpa = dev->priv; - dev->name = pDpa->devname; + if (!dev->name) + dev->name = pDpa->devname; pDpa->dev = dev; /* this is just for easy reference */ pDpa->function = function; @@ -378,24 +408,21 @@ printk( "RC PCI 45: %s: unable to get IRQ %d\n", (PU8)dev->name, (uint)dev->irq ); iounmap(vaddr); kfree(dev); - return 0; + return 1; } init_status = RCInitI2OMsgLayer(pDpa->id, dev->base_addr, - pDpa->PLanApiPA, (PU8)virt_to_bus((void *)pDpa->PLanApiPA), - (PFNTXCALLBACK)RCxmit_callback, - (PFNRXCALLBACK)RCrecv_callback, - (PFNCALLBACK)RCreboot_callback); -#ifdef RCDEBUG - printk("rc: I2O msg initted: status = 0x%x\n", init_status); -#endif + pDpa->PLanApiPA, (PU8)virt_to_bus((void *)pDpa->PLanApiPA), + (PFNTXCALLBACK)RCxmit_callback, + (PFNRXCALLBACK)RCrecv_callback, + (PFNCALLBACK)RCreboot_callback); if (init_status) { printk("rc: Unable to initialize msg layer\n"); free_irq(dev->irq, dev); iounmap(vaddr); kfree(dev); - return 0; + return 1; } if (RCGetMAC(pDpa->id, dev->dev_addr, NULL)) { @@ -403,38 +430,34 @@ free_irq(dev->irq, dev); iounmap(vaddr); kfree(dev); - return 0; + return 1; } DriverControlWord |= WARM_REBOOT_CAPABLE; RCReportDriverCapability(pDpa->id, DriverControlWord); - dev->init = RCprobe1; + dev->init = &RCinit; ether_setup(dev); /* linux kernel interface */ pDpa->next = root_RCdev; root_RCdev = dev; +#ifdef MODULE if (register_netdev(dev) != 0) /* linux kernel interface */ { printk("rc: unable to register device \n"); free_irq(dev->irq, dev); iounmap(vaddr); kfree(dev); - return 0; + return 1; } - return dev; -} +#else + RCinit(dev); +#endif + printk("%s: RedCreek Communications IPSEC VPN adapter\n", + dev->name); -static int RCprobe1(struct device *dev) -{ - dev->open = RCopen; - dev->hard_start_xmit = RC_xmit_packet; - dev->stop = RCclose; - dev->get_stats = RCget_stats; - dev->do_ioctl = RCioctl; - dev->set_config = RCconfig; - return 0; + return 0; /* success */ } static int @@ -516,6 +539,7 @@ #ifdef RCDEBUG printk("rc: RC_xmit_packet: tbusy!\n"); #endif + dev->tbusy = 1; return 1; } @@ -658,7 +682,7 @@ RCShutdownLANCard(pDpa->id,0,0,0); printk("rc: scheduling timer...\n"); init_timer(&pDpa->timer); - pDpa->timer.expires = RUN_AT((30*HZ)/10); /* 3 sec. */ + pDpa->timer.expires = RUN_AT((40*HZ)/10); /* 4 sec. */ pDpa->timer.data = (unsigned long)dev; pDpa->timer.function = &rc_timer; /* timer handler */ add_timer(&pDpa->timer); @@ -757,9 +781,11 @@ if (!pDpa->shutdown && !pDpa->reboot) printk("rc: RCrecv error: status = 0x%x\n", (uint)Status); +#ifdef RCDEBUG else printk("rc: Returning %d buffers, status = 0x%x\n", PktCount, (uint)Status); +#endif /* * TO DO: check the nature of the failure and put the adapter in * failed mode if it's a hard failure. Send a reset to the adapter @@ -808,6 +834,8 @@ (uint)skb->data[0], (uint)skb->data[1], (uint)skb->data[2], (uint)skb->data[3], (uint)skb->data[4], (uint)skb->data[5]); #endif + +#ifdef PROMISCUOUS_BY_DEFAULT /* early 2.x firmware */ if ( (memcmp(dev->dev_addr, skb->data, 6)) && (!broadcast_packet(skb->data))) { @@ -838,6 +866,7 @@ } } else +#endif /* PROMISCUOUS_BY_DEFAULT */ { len = PacketDescBlock[2]; skb->dev = dev; @@ -883,10 +912,10 @@ pDpa = (PDPA) (dev->priv); +#ifdef RCDEBUG if (pDpa->shutdown) printk("rc: shutdown: service irq\n"); -#ifdef RCDEBUG printk("RC irq: pDpa = 0x%x, dev = 0x%x, id = %d\n", (uint)pDpa, (uint)dev, (uint)pDpa->id); printk("dev = 0x%x\n", (uint)dev); @@ -901,7 +930,8 @@ return; } -#define REBOOT_REINIT_RETRY_LIMIT 10 + +#define REBOOT_REINIT_RETRY_LIMIT 4 static void rc_timer(unsigned long data) { struct device *dev = (struct device *)data; @@ -914,12 +944,12 @@ if (pDpa->reboot) { - init_status = RCInitI2OMsgLayer(pDpa->id, dev->base_addr, - pDpa->PLanApiPA, pDpa->PLanApiPA, - (PFNTXCALLBACK)RCxmit_callback, - (PFNRXCALLBACK)RCrecv_callback, - (PFNCALLBACK)RCreboot_callback); + pDpa->PLanApiPA, + (PU8)virt_to_bus((void *)pDpa->PLanApiPA), + (PFNTXCALLBACK)RCxmit_callback, + (PFNRXCALLBACK)RCrecv_callback, + (PFNCALLBACK)RCreboot_callback); switch(init_status) { @@ -949,14 +979,16 @@ (uint)pDpa->numOutRcvBuffers); } printk("rc: Initialization done.\n"); + dev->tbusy=0; + retry=0; return; case RC_RTN_FREE_Q_EMPTY: retry++; - printk("rc: inbound free q emtpy\n"); + printk("rc: inbound free q empty\n"); break; default: retry++; - printk("rc: unexpected bad status after reboot\n"); + printk("rc: bad status after reboot: %d\n", init_status); break; } @@ -972,7 +1004,7 @@ { printk("rc: rescheduling timer...\n"); init_timer(&pDpa->timer); - pDpa->timer.expires = RUN_AT((30*HZ)/10); /* 3 sec. */ + pDpa->timer.expires = RUN_AT((40*HZ)/10); /* 3 sec. */ pDpa->timer.data = (unsigned long)dev; pDpa->timer.function = &rc_timer; /* timer handler */ add_timer(&pDpa->timer); @@ -1286,6 +1318,8 @@ return 0; } + +#ifdef MODULE void cleanup_module(void) { @@ -1315,6 +1349,8 @@ root_RCdev = next; } } +#endif + static int RC_allocate_and_post_buffers(struct device *dev, int numBuffers) diff -u --recursive --new-file v2.2.5/linux/drivers/net/syncppp.c linux/drivers/net/syncppp.c --- v2.2.5/linux/drivers/net/syncppp.c Tue Feb 23 15:21:33 1999 +++ linux/drivers/net/syncppp.c Fri Apr 16 13:58:46 1999 @@ -121,6 +121,7 @@ u16 time1; }; #define CISCO_PACKET_LEN 18 +#define CISCO_BIG_PACKET_LEN 20 static struct sppp *spppq; static struct timer_list sppp_keepalive_timer; @@ -649,7 +650,7 @@ struct cisco_packet *h; struct device *dev = sp->pp_if; - if (skb->len != CISCO_PACKET_LEN) { + if (skb->len != CISCO_PACKET_LEN && skb->len != CISCO_BIG_PACKET_LEN) { if (sp->pp_flags & PP_DEBUG) printk (KERN_WARNING "%s: invalid cisco packet length: %d bytes\n", dev->name, skb->len); diff -u --recursive --new-file v2.2.5/linux/drivers/net/tlan.c linux/drivers/net/tlan.c --- v2.2.5/linux/drivers/net/tlan.c Tue Feb 23 15:21:33 1999 +++ linux/drivers/net/tlan.c Mon Apr 12 16:18:33 1999 @@ -1877,6 +1877,7 @@ u8 data8; priv->tlanFullDuplex = FALSE; + priv->phyOnline=0; /* 1. Assert reset bit. */ data = inl(dev->base_addr + TLAN_HOST_CMD); diff -u --recursive --new-file v2.2.5/linux/drivers/net/z85230.c linux/drivers/net/z85230.c --- v2.2.5/linux/drivers/net/z85230.c Tue Feb 23 15:21:33 1999 +++ linux/drivers/net/z85230.c Fri Apr 16 13:58:46 1999 @@ -416,8 +416,9 @@ static void z8530_dma_tx(struct z8530_channel *chan) { - if(!chan->txdma_on) + if(!chan->dma_tx) { + printk("Hey who turned the DMA off?\n"); z8530_tx(chan); return; } @@ -434,7 +435,7 @@ chan->status=status; - if(chan->txdma_on) + if(chan->dma_tx) { if(status&TxEOM) { @@ -619,6 +620,9 @@ z8530_rx_done(c); /* Load the frame ring */ z8530_rx_done(c); /* Load the backup frame */ z8530_rtsdtr(c,1); + c->dma_tx = 0; + c->regs[R1]|=TxINT_ENAB; + write_zsreg(c, R1, c->regs[R1]); write_zsreg(c, R3, c->regs[R3]|RxENABLE); return 0; } @@ -706,6 +710,9 @@ c->regs[R14]|= DTRREQ; write_zsreg(c, R14, c->regs[R14]); + c->regs[R1]&= ~TxINT_ENAB; + write_zsreg(c, R1, c->regs[R1]); + /* * RX DMA via W/Req */ @@ -713,6 +720,7 @@ c->regs[R1]|= WT_FN_RDYFN; c->regs[R1]|= WT_RDY_RT; c->regs[R1]|= INT_ERR_Rx; + c->regs[R1]&= ~TxINT_ENAB; write_zsreg(c, R1, c->regs[R1]); c->regs[R1]|= WT_RDY_ENAB; write_zsreg(c, R1, c->regs[R1]); @@ -972,7 +980,7 @@ dev->name, z8530_type_name[dev->type], mapping, - io, + Z8530_PORT_OF(io), dev->irq); } @@ -991,7 +999,7 @@ dev->chanB.irqs=&z8530_nop; /* Reset the chip */ write_zsreg(&dev->chanA, R9, 0xC0); - udelay(100); + udelay(200); /* Now check its valid */ write_zsreg(&dev->chanA, R12, 0xAA); if(read_zsreg(&dev->chanA, R12)!=0xAA) @@ -1108,7 +1116,7 @@ if(c->tx_skb==NULL) { /* Idle on */ - if(c->txdma) + if(c->dma_tx) { flags=claim_dma_lock(); disable_dma(c->txdma); @@ -1126,7 +1134,6 @@ } else { - c->tx_ptr=c->tx_next_ptr; c->txcount=c->tx_skb->len; @@ -1141,6 +1148,18 @@ flags=claim_dma_lock(); disable_dma(c->txdma); + + /* + * These two are needed by the 8530/85C30 + * and must be issued when idling. + */ + + if(c->dev->type!=Z85230) + { + write_zsctrl(c, RES_Tx_CRC); + write_zsctrl(c, RES_EOM_L); + } + write_zsreg(c, R10, c->regs[10]&~ABUNDER); clear_dma_ff(c->txdma); set_dma_addr(c->txdma, virt_to_bus(c->tx_ptr)); set_dma_count(c->txdma, c->txcount); @@ -1156,7 +1175,7 @@ /* ABUNDER off */ write_zsreg(c, R10, c->regs[10]); write_zsctrl(c, RES_Tx_CRC); - write_zsctrl(c, RES_EOM_L); +//??? write_zsctrl(c, RES_EOM_L); while(c->txcount && (read_zsreg(c,R0)&Tx_BUF_EMP)) { @@ -1176,11 +1195,10 @@ spin_lock_irqsave(&z8530_buffer_lock, flags); c->netdevice->tbusy=0; - /* Can't happen */ + /* Actually this can happen.*/ if(c->tx_skb==NULL) { spin_unlock_irqrestore(&z8530_buffer_lock, flags); - printk(KERN_WARNING "%s: spurious tx done\n", c->dev->name); return; } skb=c->tx_skb; diff -u --recursive --new-file v2.2.5/linux/drivers/pci/oldproc.c linux/drivers/pci/oldproc.c --- v2.2.5/linux/drivers/pci/oldproc.c Tue Mar 23 14:35:48 1999 +++ linux/drivers/pci/oldproc.c Mon Apr 12 10:09:47 1999 @@ -433,8 +433,12 @@ DEVICE( RP, RP8M, "RocketModem 8 J"), DEVICE( CYCLADES, CYCLOM_Y_Lo, "Cyclom-Y below 1Mbyte"), DEVICE( CYCLADES, CYCLOM_Y_Hi, "Cyclom-Y above 1Mbyte"), - DEVICE( CYCLADES, CYCLOM_Z_Lo, "Cyclom-Z below 1Mbyte"), - DEVICE( CYCLADES, CYCLOM_Z_Hi, "Cyclom-Z above 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_4Y_Lo, "Cyclom-4Y below 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_4Y_Hi, "Cyclom-4Y above 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_8Y_Lo, "Cyclom-8Y below 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_8Y_Hi, "Cyclom-8Y above 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_Z_Lo, "Cyclades-Z below 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_Z_Hi, "Cyclades-Z above 1Mbyte"), DEVICE( ESSENTIAL, ESSENTIAL_ROADRUNNER,"Roadrunner serial HIPPI"), DEVICE( O2, O2_6832, "6832"), DEVICE( 3DFX, 3DFX_VOODOO, "Voodoo"), diff -u --recursive --new-file v2.2.5/linux/drivers/sbus/audio/dmy.c linux/drivers/sbus/audio/dmy.c --- v2.2.5/linux/drivers/sbus/audio/dmy.c Tue Mar 23 14:35:48 1999 +++ linux/drivers/sbus/audio/dmy.c Fri Apr 16 08:20:23 1999 @@ -8,7 +8,6 @@ * to a file instead. (or will shortly) */ -#include #include #include #include diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/ChangeLog.ncr53c8xx linux/drivers/scsi/ChangeLog.ncr53c8xx --- v2.2.5/linux/drivers/scsi/ChangeLog.ncr53c8xx Wed Mar 10 15:29:46 1999 +++ linux/drivers/scsi/ChangeLog.ncr53c8xx Mon Apr 12 09:51:04 1999 @@ -1,3 +1,15 @@ +Thu Mar 11 23:00 1999 Gerard Roudier (groudier@club-internet.fr) + * revision 3.2 (8xx-896 driver bundle) + - Only define the host template in ncr53c8xx.h and include the + sym53c8xx_defs.h file. + - Declare static all symbols that donnot need to be visible from + outside the driver code. + - Add 'excl' boot command option that allows to pass to the driver + io address of devices not to attach. + - Add info() function called from the host template to print + driver/host information. + - Minor documentation additions. + Sat Mar 6 11:00 1999 Gerard Roudier (groudier@club-internet.fr) * revision 3.1h - Fix some oooold bug that hangs the bus if a device rejects a diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/ChangeLog.sym53c8xx linux/drivers/scsi/ChangeLog.sym53c8xx --- v2.2.5/linux/drivers/scsi/ChangeLog.sym53c8xx Wed Dec 31 16:00:00 1969 +++ linux/drivers/scsi/ChangeLog.sym53c8xx Mon Apr 12 09:51:04 1999 @@ -0,0 +1,219 @@ +Sat Mar 20 21:00 1999 Gerard Roudier (groudier@club-internet.fr) + * version sym53c8xx-1.3b + - Add support for NCR PQS PDS. + James Bottomley + - Allow value 0 for host ID. + - Support more than 8 controllers (> 40 in fact :-) ) + - Add 'excl=#ioaddr' boot option: exclude controller. + (Version 1.3a driver) + +Thu Mar 11 23:00 1999 Gerard Roudier (groudier@club-internet.fr) + * version sym53c8xx-1.3 (8xx-896 driver bundle) + - Equivalent changes as ncr53c8xx-3.2 due to the driver bundle. + (See Changelog.ncr53c8xx) + - Do a normal soft reset as first chip reset, since aborting current + operation may raise an interrupt we are not able to handle since + the interrupt handler is not yet established. + +Sat Mar 6 11:00 1999 Gerard Roudier (groudier@club-internet.fr) + * version sym53c8xx-1.2b + - Fix some oooold bug that hangs the bus if a device rejects a + negotiation. Btw, the corresponding stuff also needed some cleanup + and thus the change is a bit larger than it could have been. + - Still some typo that made compilation fail for 64 bit (trivial fix). + +Sun Feb 21 20:00 1999 Gerard Roudier (groudier@club-internet.fr) + * version sym53c8xx-1.2a + - The rewrite of the interrupt handling broke the SBMC interrupt + handling due to a 1 bit mask tiny error. Hopefully fixed. + - If INQUIRY came from a scatter list, the driver looked into + the scatterlist instead of the data.:) Since this should never + happen, we just discard the data if use_sg is not zero. + +Fri Feb 12 23:00 1999 Gerard Roudier (groudier@club-internet.fr) + * version sym53c8xx-1.2 + - Major rewrite of the interrupt handling and recovery stuff for + the support of non compliant SCSI removal, insertion and all + kinds of screw-up that may happen on the SCSI BUS. + Hopefully, the driver is now unbreakable or may-be, it is just + quite brocken. :-) + Many thanks to Johnson Russel (Symbios) for having responded to + my questions and for his interesting advices and comments about + support of SCSI hot-plug. + - Add 'recovery' option to driver set-up. + - Negotiate SYNC data transfers with CCS devices. + - Deal correctly with 64 bit PCI address registers on Linux 2.2. + Pointed out by Leonard Zubkoff. + +Sun Jan 31 18:00 1999 Gerard Roudier (groudier@club-internet.fr) + * version sym53c8xx-1.1a + - Some 896 chip revisions (all for now :-)), may hang-up if the + soft reset bit is set at the wrong time while SCRIPTS are running. + We need to first abort the current SCRIPTS operation prior to + resetting the chip. This fix has been sent to me by SYMBIOS/LSI + and I just translated it into ncr53c8xx syntax. + Must be considered 100 % trustable, unless I did some mistake + when translating it. :-) + +Sun Jan 24 18:00 1999 Gerard Roudier (groudier@club-internet.fr) + * version sym53c8xx-1.1 + - Major rewrite of the SCSI parity error handling. + The informations contained in the data manuals are incomplete about + this feature. + I asked SYMBIOS about and got in reply the explanations that are + _indeed_ missing in the data manuals. + - Allow to tune request_irq() flags from the boot command line using + ncr53c8xx=irqm:??, as follows: + a) If bit 0x10 is set in irqm, SA_SHIRQ flag is not used. + b) If bit 0x20 is set in irqm, SA_INTERRUPT flag is not used. + By default the driver uses both SA_SHIRQ and SA_INTERRUPT. + Option 'ncr53c8xx=irqm:0x20' may be used when an IRQ is shared by + a 53C8XX adapter and a network board. + - Fix for 64 bit PCI address register calculation. (Lance Robinson) + - Fix for big-endian in phase mismatch handling. (Michal Jaegermann) + +Fri Jan 1 20:00 1999 Gerard Roudier (groudier@club-internet.fr) + * version sym53c8xx-1.0a + - Waiting list look-up didn't work for the first command of the list. + Hopefully fixed, but tested on paper only. ;) + - Remove the most part of PPC specific code for Linux-2.2. + Thanks to Cort. + - Some other minors changes. + +Sat Dec 19 21:00 1998 Gerard Roudier (groudier@club-internet.fr) + * version sym53c8xx-1.0 + - Define some new IO registers for the 896 (istat1, mbox0, mbox1) + - Revamp slighly the Symbios NVRAM lay-out based on the excerpt of + the header file I received from Symbios. + - Check the PCI bus number for the boot order (Using a fast + PCI controller behing a PCI-PCI bridge seems sub-optimal). + - Disable overlapped PCI arbitration for the 896 revision 1. + - Reduce a bit the number of IO register reads for phase mismatch + by reading DWORDS at a time instead of BYTES. + +Thu Dec 3 24:00 1998 Gerard Roudier (groudier@club-internet.fr) + * version pre-sym53c8xx-0.18 + - I received this afternoon a 896 from SYMBIOS and started testing + the driver with this beast. After having fixed 3 buglets, it worked + with all features enabled including the phase mismatch handling + from SCRIPTS. Since this feature is not yet tested enough, the + boot option 'ncr53c8xx=specf:1' is still required to enable the + driver to handle PM from SCRIPTS. + +Sun Nov 29 18:00 1998 Gerard Roudier (groudier@club-internet.fr) + * version pre-sym53c8xx-0.17 + - The SISL RAID change requires now remap_pci_mem() stuff to be + compiled for __i386__ when normal IOs are used. + - The PCI memory read from SCRIPTS that should ensure ordering + was in fact misplaced. BTW, this may explain why broken PCI + device drivers regarding ordering are working so well. ;-) + - Rewrite ncr53c8xx_setup (boot command line options) since the + binary code was a bit too bloated in my opinion. + - Make the code simpler in the wakeup_done routine. + +Tue Nov 24 23:00 1998 Gerard Roudier (groudier@club-internet.fr) + * version pre-sym53c8xx-0.16 + - Add SCSI_NCR_OPTIMIZE_896_1 compile option and 'optim' boot option. + When set, the driver unconditionnaly assumes that the interrupt + handler is called for command completion, then clears INTF, scans + the done queue and returns if some completed CCB is found. If no + completed CCB are found, interrupt handling will proceed normally. + With a 896 that handles MA from SCRIPTS, this can be a great win, + since the driver will never performs PCI read transactions, but + only PCI write transactions that may be posted. + If the driver haven't to also raise the SIGP this would be perfect. + Even with this penalty, I think that this will work great. + Obviously this optimization makes sense only if the IRQ is not + shared with another device. + - Still a buglet in the tags initial settings that needed to be fixed. + It was not possible to disable TGQ at system startup for devices + that claim TGQ support. The driver used at least 2 for the queue + depth but did'nt keep track of user settings for tags depth lower + than 2. + +Thu Nov 19 23:00 1998 Gerard Roudier (groudier@club-internet.fr) + * version pre-sym53c8xx-0.15 + - Add support for hardware LED control of the 896. + - Ignore chips that are driven by SISL RAID (DAC 960). + Change sent by Leonard Zubkoff and slightly reworked. + - Prevent 810A rev 11 and 860 rev 1 from using cache line based + transactions since those early chip revisions may use such on + LOAD/STORE instructions (work-around). + - Remove some useless and bloat code from the pci init stuff. + - Donnot use the readX()/writeX() kernel functions for __i386__, + since they perform useless masking operations in order to deal + with broken driver in 2.1.X kernel. + +Wed Nov 11 10:00 1998 Gerard Roudier (groudier@club-internet.fr) + * version pre-sym53c8xx-0.14 + - The driver was unhappy when configured with default_tags > MAX_TAGS + Hopefully doubly-fixed. + - Set PCI_PARITY in PCI_COMMAND register in not set (PCI fix-up). + - Print out some message if phase mismatch is handled from SCRIPTS. + +Sun Nov 1 14H00 1998 Gerard Roudier (groudier@club-internet.fr) + * version pre-sym53c8xx-0.13 + - Some rewrite of the device detection code. This code had been + patched too much and needed to be face-lifted a bit. + Remove all platform dependant fix-ups that was not needed or + conflicted with some other driver code as work-arounds. + Reread the NVRAM before the calling of ncr_attach(). This spares + stack space and so allows to handle more boards. + Handle 64 bit base addresses under linux-2.0.X. + Set MASTER bit in PCI COMMAND register if not set. + +Wed Oct 30 22H00 1998 Gerard Roudier (groudier@club-internet.fr) + * version pre-sym53c8xx-0.12 + - Damned! I just broke the driver for Alpha by leaving a stale + instruction in the source code. Hopefully fixed. + - Donnot set PFEN when it is useless. Doing so we are sure that BOF + will be active, since the manual appears to be very unclear on what + feature is actually used by the chip when both PFEN and BOF are + set. + +Sat Oct 24 16H00 1998 Gerard Roudier (groudier@club-internet.fr) + * version pre-sym53c8xx-0.11 + - LOAD/STORE instructions were miscompiled for register offsets + beyond 0x7f. This broke accesses to 896' new registers. + - Disable by default Phase Mismatch handling from SCRIPTS, since + current 896 rev.1 seems not to operate safely with the driver + when this feature is enabled (and above LOAD/STORE fix applied). + I will change the default to 'enabled' when this problem will be + solved. + Using boot option 'ncr53c8xx=specf:1' enables this feature. + - Implement a work-around (DEL 472 - ITEM 5) that should allow the + driver to safely enable hardware phase mismatch with 896 rev. 1. + +Tue Oct 20 22H00 1998 Gerard Roudier (groudier@club-internet.fr) + * version pre-sym53c8xx-0.10 + - Add the 53c876 description to the chip table. This is only useful + for printing the right name of the controller. + - Add additionnal checking of INQUIRY data: + Check INQUIRY data received length is at least 7. Byte 7 of + inquiry data contains device features bits and the driver might + be confused by garbage. Also check peripheral qualifier. + - Use a 1,3,5,...MAXTAGS*2+1 tag numbering. Previous driver could + use any tag number from 1 to 253 and some non conformant devices + might have problems with large tag numbers. + - Use NAME53C and NAME53C8XX for chip name prefix chip family name. + Just give a try using "sym53c" and "sym53c8xx" instead of "ncr53c" + and "ncr53c8xx". :-) + +Sun Oct 11 17H00 1998 Gerard Roudier (groudier@club-internet.fr) + * version pre-sym53c8xx-0.9 + - DEL-441 Item 2 work-around for the 53c876 rev <= 5 (0x15). + - Break ncr_scatter() into 2 functions in order to guarantee best + possible code optimization for the case we get a scatter list. + - Add the code intended to support up to 1 tera-byte for 64 bit systems. + It is probably too early, but I wanted to complete the thing. + +Sat Oct 3 14H00 1998 Gerard Roudier (groudier@club-internet.fr) + * version pre-sym53c8xx-0.8 + - Do some testing with io_mapped and fix what needed to be so. + - Wait for SCSI selection to complete or time-out immediately after + the chip won arbitration, since executing SCRIPTS while the SCSI + core is performing SCSI selection breaks the selection procedure + at least for some chip revisions. + - Interrupt the SCRIPTS if a device does not go to MSG OUT phase after + having been selected with ATN. Such a situation is not recoverable, + better to fail when we are stuck. diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/Config.in linux/drivers/scsi/Config.in --- v2.2.5/linux/drivers/scsi/Config.in Wed Mar 10 15:29:46 1999 +++ linux/drivers/scsi/Config.in Fri Apr 16 11:48:46 1999 @@ -36,6 +36,9 @@ dep_tristate 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 $CONFIG_SCSI dep_tristate 'AM53/79C974 PCI SCSI support' CONFIG_SCSI_AM53C974 $CONFIG_SCSI dep_tristate 'AMI MegaRAID support' CONFIG_SCSI_MEGARAID $CONFIG_SCSI +if [ "$CONFIG_SCSI_MEGARAID" != "n" ]; then + bool ' Concurrent IO commands on MegaRAID' CONFIG_MEGARAID_MULTI_IO +fi dep_tristate 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC $CONFIG_SCSI if [ "$CONFIG_SCSI_BUSLOGIC" != "n" ]; then @@ -88,12 +91,16 @@ fi if [ "$CONFIG_PCI" = "y" -a "$CONFIG_SCSI_NCR53C7xx" != "y" ]; then dep_tristate 'NCR53C8XX SCSI support' CONFIG_SCSI_NCR53C8XX $CONFIG_SCSI - if [ "$CONFIG_SCSI_NCR53C8XX" != "n" ]; then + dep_tristate 'SYM53C8XX SCSI support' CONFIG_SCSI_SYM53C8XX $CONFIG_SCSI + if [ "$CONFIG_SCSI_NCR53C8XX" != "n" -o "$CONFIG_SCSI_SYM53C8XX" != "n" ]; then int ' default tagged command queue depth' CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS 8 int ' maximum number of queued commands' CONFIG_SCSI_NCR53C8XX_MAX_TAGS 32 int ' synchronous transfers frequency in MHz' CONFIG_SCSI_NCR53C8XX_SYNC 20 bool ' enable profiling' CONFIG_SCSI_NCR53C8XX_PROFILE bool ' use normal IO' CONFIG_SCSI_NCR53C8XX_IOMAPPED + if [ "$CONFIG_SCSI_SYM53C8XX" != "n" ]; then + bool ' include support for the NCR PQS/PDS SCSI card' CONFIG_SCSI_NCR53C8XX_PQS_PDS + fi if [ "$CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS" = "0" ]; then bool ' not allow targets to disconnect' CONFIG_SCSI_NCR53C8XX_NO_DISCONNECT fi diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/Makefile linux/drivers/scsi/Makefile --- v2.2.5/linux/drivers/scsi/Makefile Tue Mar 23 14:35:48 1999 +++ linux/drivers/scsi/Makefile Mon Apr 12 09:51:04 1999 @@ -482,6 +482,14 @@ endif endif +ifeq ($(CONFIG_SCSI_SYM53C8XX),y) +L_OBJS += sym53c8xx.o +else + ifeq ($(CONFIG_SCSI_SYM53C8XX),m) + M_OBJS += sym53c8xx.o + endif +endif + ifeq ($(CONFIG_SCSI_PAS16),y) L_OBJS += pas16.o else diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/NCR5380.c linux/drivers/scsi/NCR5380.c --- v2.2.5/linux/drivers/scsi/NCR5380.c Tue Dec 22 14:16:56 1998 +++ linux/drivers/scsi/NCR5380.c Thu Apr 15 05:45:12 1999 @@ -569,10 +569,6 @@ if (!main_running) { main_running = 1; NCR5380_main(); - /* - * main_running is cleared in NCR5380_main once it can't do - * more work, and NCR5380_main exits with interrupts disabled. - */ } restore_flags(flags); } @@ -702,7 +698,9 @@ } restore_flags(flags); + spin_lock_irqsave(&io_request_lock, flags); run_main(); + spin_unlock_irqrestore(&io_request_lock, flags); } #endif /* def USLEEP */ @@ -1266,6 +1264,7 @@ struct Scsi_Host *instance; struct NCR5380_hostdata *hostdata; int done; + unsigned long flags; /* * We run (with interrupts disabled) until we're sure that none of @@ -1279,14 +1278,16 @@ * this should prevent any race conditions. */ + spin_unlock_irq(&io_request_lock); + + save_flags(flags); + do { cli(); /* Freeze request queues */ done = 1; for (instance = first_instance; instance && instance->hostt == the_template; instance = instance->next) { - unsigned long flags; hostdata = (struct NCR5380_hostdata *) instance->hostdata; - save_flags(flags); cli(); #ifdef USLEEP if (!hostdata->connected && !hostdata->selecting) { @@ -1365,8 +1366,6 @@ TAG_NEXT)) { break; } else { - unsigned long flags; - save_flags(flags); cli(); LIST(tmp, hostdata->issue_queue); tmp->host_scribble = (unsigned char *) @@ -1393,14 +1392,12 @@ } else { - unsigned long flags; /* RvC: device failed, so we wait a long time this is needed for Mustek scanners, that do not respond to commands immediately after a scan */ printk(KERN_DEBUG "scsi%d: device %d did not respond in time\n", instance->host_no, tmp->target); - save_flags(flags); cli(); LIST(tmp, hostdata->issue_queue); tmp->host_scribble = (unsigned char *) hostdata->issue_queue; @@ -1434,7 +1431,8 @@ break; } /* for instance */ } while (!done); - cli(); + spin_lock_irq(&io_request_lock); + /* cli();*/ main_running = 0; } diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/README.ncr53c8xx linux/drivers/scsi/README.ncr53c8xx --- v2.2.5/linux/drivers/scsi/README.ncr53c8xx Wed Mar 10 15:29:46 1999 +++ linux/drivers/scsi/README.ncr53c8xx Mon Apr 12 09:51:04 1999 @@ -4,12 +4,14 @@ 21 Rue Carnot 95170 DEUIL LA BARRE - FRANCE -14 February 1999 +10 March 1999 =============================================================================== 1. Introduction 2. Supported chips and SCSI features -3. Summary of other supported features +3. Advantages of the enhanced 896 driver + 3.1 Optimized SCSI SCRIPTS + 3.2 New features of the SYM53C896 (64 bit PCI dual LVD SCSI controller) 4. Memory mapped I/O versus normal I/O 5. Tagged command queueing 6. Parity checking @@ -56,21 +58,30 @@ 1. Introduction -This driver has been ported from FreeBSD to Linux and is currently -maintained by: +The initial Linux ncr53c8xx driver has been a port of the ncr driver from +FreeBSD that has been achieved in November 1995 by: Gerard Roudier The original driver has been written for 386bsd and FreeBSD by: Wolfgang Stanglmeier Stefan Esser +It is now available as a bundle of 2 drivers: + +- ncr53c8xx generic driver that supports all the SYM53C8XX family including + the ealiest 810 rev. 1 and the latest 896 2 channels LVD SCSI controller. +- sym53c8xx enhanced driver (a.k.a. 896 drivers) that drops support of oldest + chips in order to gain advantage of new features, as LOAD/STORE intructions + available since the 810A and hardware phase mismatch available with the + latest 896. + You can find technical information about the NCR 8xx family in the PCI-HOWTO written by Michael Will and in the SCSI-HOWTO written by Drew Eckhardt. -Information about new chips is available at SYMBIOS web server: +Information about new chips is available at LSILOGIC web server: - http://www.symbios.com/ + http://www.lsilogic.com/ SCSI standard documentations are available at SYMBIOS ftp server: @@ -109,34 +120,65 @@ Master parity checking "Wide negotiation" is supported for chips that allow it. The -following table shows some characteristics of NCR 8xx family chips: - - On board Supported by -Chip SDMS BIOS Wide SCSI std. Max. sync the driver ----- --------- ---- --------- ---------- ------------ -810 N N FAST10 10 MB/s Y -810A N N FAST10 10 MB/s Y -815 Y N FAST10 10 MB/s Y -825 Y Y FAST10 20 MB/s Y -825A Y Y FAST10 20 MB/s Y -860 N N FAST20 20 MB/s Y -875 Y Y FAST20 40 MB/s Y -876 Y Y FAST20 40 MB/s Y -895 Y Y FAST40 80 MB/s Y - - -3. Summary of other supported features. - - Module: allow to load the driver - Memory mapped I/O: increases performance - Profiling information: read operations from the proc SCSI file system - Control commands: write operations to the proc SCSI file system - Debugging information: written to syslog (expert only) - Scatter / gather - Shared interrupt - Boot setup commands - Serial NVRAM: Symbios and Tekram formats +following table shows some characteristics of NCR 8xx family chips +and what drivers support them. + Supported by Supported by + On board the generic the enhanced +Chip SDMS BIOS Wide SCSI std. Max. sync driver driver +---- --------- ---- --------- ---------- ------------ ------------- +810 N N FAST10 10 MB/s Y N +810A N N FAST10 10 MB/s Y Y +815 Y N FAST10 10 MB/s Y N +825 Y Y FAST10 20 MB/s Y N +825A Y Y FAST10 20 MB/s Y Y +860 N N FAST20 20 MB/s Y Y +875 Y Y FAST20 40 MB/s Y Y +876 Y Y FAST20 40 MB/s Y Y +895 Y Y FAST40 80 MB/s Y Y +896 Y Y FAST40 80 MB/s Y Y + + +Summary of other supported features: + +Module: allow to load the driver +Memory mapped I/O: increases performance +Profiling information: read operations from the proc SCSI file system +Control commands: write operations to the proc SCSI file system +Debugging information: written to syslog (expert only) +Scatter / gather +Shared interrupt +Boot setup commands +Serial NVRAM: Symbios and Tekram formats + + +3. Advantages of the enhanced 896 driver + +3.1 Optimized SCSI SCRIPTS. + +The 810A, 825A, 875, 895 and newest 896 support new SCSI SCRIPTS instructions +named LOAD and STORE that allow to move 1 DWORD from/to an IO register to/from +memory much faster that the MOVE MEMORY instruction that is supported by the +53c7xx and 53c8xx family. The LOAD/STORE instructions support absolute and +DSA relative addressing modes. The SCSI SCRIPTS had been entirely rewritten +using LOAD/STORE instead of MOVE MEMORY instructions. + +3.2 New features of the SYM53C896 (64 bit PCI dual LVD SCSI controller) + +The 896 allows to handle the phase mismatch context saving from SCRIPTS +(avoids the phase mismatch interrupt that stops the SCSI processor +until the C code has saved the context of the transfer). +Implementing this without using LOAD/STORE instructions would be painfull +and I did'nt even try it. This chip also supports 64 bit PCI transactions +and addressing. The SCRIPTS processor is not true 64 bit, but uses segment +registers for bit 32-63. Another interesting feature is that LOAD/STORE +instructions that address the on-chip RAM (8k) remain internal to the chip. + +Due to the use of LOAD/STORE SCRIPTS instructions, this driver does not +support the following chips: +- SYM53C810 revision < 0x10 (16) +- SYM53C815 all revisions +- SYM53C825 revision < 0x10 (16) 4. Memory mapped I/O versus normal I/O @@ -703,6 +745,13 @@ 0x1: Check and donnot attach the controller on error. 0x2: Check and just warn on error. +Exclude hosts from being attached + excl= + + Prevent host at a given io address from being attached. + For example 'ncr53c8xx=excl:0xb400,excl:0xc000' indicate to the + ncr53c8xx driver not to attach hosts at address 0xb400 and 0xc000. + Boot fail safe safe:y load the following assumed fail safe initial setup @@ -1036,15 +1085,20 @@ When an IRQ is shared by devices that are handled by different drivers, it may happen that one driver complains about the request of the IRQ having -failed. This may be due to one driver having requested the IRQ using the -SA_INTERRUPT flag but some other having requested the same IRQ without this -flag, or to one driver not having requested the IRQ with the SA_SHIRQ flag. - -By default, the ncr53c8xx driver requests IRQs with both the SA_INTERRUPT -and the SA_SHIRQ flag, but you can disable use of SA_INTERRUPT flags from -the boot command line by using the following option: +failed. Inder Linux-2.0, this may be due to one driver having requested the +IRQ using the SA_INTERRUPT flag but some other having requested the same IRQ +without this flag. Under both Linux-2.0 and linux-2.2, this may be caused by +one driver not having requested the IRQ with the SA_SHIRQ flag. + +By default, the ncr53c8xx and sym53c8xx drivers request IRQs with both the +SA_INTERRUPT and the SA_SHIRQ flag under Linux-2.0 and with only the SA_SHIRQ +flag under Linux-2.2. + +Under Linux-2.0, you can disable use of SA_INTERRUPT flag from the boot +command line by using the following option: - ncr53c8xx=irqm:0x20 + ncr53c8xx=irqm:0x20 (for the generic ncr53c8xx driver) + sym53c8xx=irqm:0x20 (for the sym53c8xx driver) If this does not fix the problem, then you may want to check how all other drivers are requesting the IRQ and report the problem. Note that if at least diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/aha152x.c linux/drivers/scsi/aha152x.c --- v2.2.5/linux/drivers/scsi/aha152x.c Wed Jan 20 23:14:05 1999 +++ linux/drivers/scsi/aha152x.c Mon Apr 12 16:18:26 1999 @@ -343,6 +343,7 @@ #include #include #include +#include #include "aha152x.h" #include @@ -489,6 +490,7 @@ int ext_trans; int swint; + int service; unsigned char syncrate[8]; @@ -500,7 +502,7 @@ #endif }; -void aha152x_intr(int irq, void *dev_id, struct pt_regs *); +static void aha152x_intr(int irq, void *dev_id, struct pt_regs *); void aha152x_done(struct Scsi_Host *shpnt, int error); void aha152x_setup(char *str, int *ints); int aha152x_checksetup(struct aha152x_setup *setup); @@ -1550,38 +1552,72 @@ aha152x_panic(shpnt, "done() called outside of command"); } + +static void aha152x_complete(struct Scsi_Host *); + +static struct tq_struct aha152x_tq; + /* - * Interrupts handler (main routine of the driver) + * Run service completions on the card with interrupts enabled. */ -void aha152x_intr(int irqno, void *dev_id, struct pt_regs * regs) + +static void aha152x_run(void) { - struct Scsi_Host *shpnt = aha152x_host[irqno-IRQ_MIN]; - unsigned int flags; - int done=0, phase; + int i; + for(i=0;iservice) + { + HOSTDATA(shpnt)->service=0; + aha152x_complete(shpnt); + } + } +} + +/* + * Interrupts handler (main routine of the driver) + */ + +static void aha152x_intr(int irqno, void *dev_id, struct pt_regs * regs) +{ + struct Scsi_Host *shpnt = aha152x_host[irqno-IRQ_MIN]; #if defined(DEBUG_RACE) - enter_driver("intr"); + enter_driver("intr"); #else #if defined(DEBUG_INTR) - if(HOSTDATA(shpnt)->debug & debug_intr) - printk("\naha152x: intr(), "); + if(HOSTDATA(shpnt)->debug & debug_intr) + printk("\naha152x: intr(), "); #endif #endif - if(!shpnt) - panic("aha152x: catched interrupt for unknown controller.\n"); + if(!shpnt) + panic("aha152x: catched interrupt for unknown controller.\n"); + + /* no more interrupts from the controller, while we're busy. + INTEN is restored by the BH handler */ + + CLRBITS(DMACNTRL0, INTEN); + + /* Poke the BH handler */ + + HOSTDATA(shpnt)->service=1; + aha152x_tq.routine = (void *)aha152x_run; + queue_task(&aha152x_tq, &tq_immediate); + mark_bh(IMMEDIATE_BH); +} + +static void aha152x_complete(struct Scsi_Host *shpnt) +{ + unsigned int flags; + int done=0, phase; - /* no more interrupts from the controller, while we're busy. - INTEN has to be restored, when we're ready to leave - intr(). To avoid race conditions, we have to return - immediately afterwards. */ - CLRBITS(DMACNTRL0, INTEN); - /* sti(); FIXME!!! Yes, sti() really needs to be here if we want to lock up */ - - /* disconnected target is trying to reconnect. - Only possible, if we have disconnected nexuses and - nothing is occupying the bus. - */ + /* disconnected target is trying to reconnect. + Only possible, if we have disconnected nexuses and + nothing is occupying the bus. + */ + if(TESTHI(SSTAT0, SELDI) && DISCONNECTED_SC && (!CURRENT_SC || (CURRENT_SC->SCp.phase & in_selection)) ) { diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/gdth.c linux/drivers/scsi/gdth.c --- v2.2.5/linux/drivers/scsi/gdth.c Wed Jan 13 15:00:42 1999 +++ linux/drivers/scsi/gdth.c Mon Apr 12 09:56:16 1999 @@ -2,7 +2,7 @@ * GDT ISA/EISA/PCI Disk Array Controller driver for Linux * * * * gdth.c * - * Copyright (C) 1995-98 ICP vortex Computersysteme GmbH, Achim Leubner * + * Copyright (C) 1995-99 ICP vortex Computersysteme GmbH, Achim Leubner * * * * * * * @@ -20,9 +20,34 @@ * along with this kernel; if not, write to the Free Software * * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * - * Tested with Linux 1.2.13, ..., 2.1.131 * + * Tested with Linux 1.2.13, ..., 2.2.4 * * * * $Log: gdth.c,v $ + * Revision 1.23 1999/03/26 09:12:31 achim + * Default value for hdr_channel set to 0 + * + * Revision 1.22 1999/03/22 16:27:16 achim + * Bugfix: gdth_store_event() must not be locked with GDTH_LOCK_HA() + * + * Revision 1.21 1999/03/16 13:40:34 achim + * Problems with reserved drives solved + * gdth_eh_bus_reset() implemented + * + * Revision 1.20 1999/03/10 09:08:13 achim + * Bugfix: Corrections in gdth_direction_tab[] made + * Bugfix: Increase command timeout (gdth_update_timeout()) NOT in gdth_putq() + * + * Revision 1.19 1999/03/05 14:38:16 achim + * Bugfix: Heads/Sectors mapping for reserved devices possibly wrong + * -> gdth_eval_mapping() implemented, changes in gdth_bios_param() + * INIT_RETRIES set to 100s to avoid DEINIT-Timeout for controllers + * with BIOS disabled and memory test set to Intensive + * Enhanced /proc support + * + * Revision 1.18 1999/02/24 09:54:33 achim + * Command line parameter hdr_channel implemented + * Bugfix for EISA controllers + Linux 2.2.x + * * Revision 1.17 1998/12/17 15:58:11 achim * Command line parameters implemented * Changes for Alpha platforms @@ -95,7 +120,7 @@ * Initial revision * ************************************************************************/ -#ident "$Id: gdth.c,v 1.17 1998/12/17 15:58:11 achim Exp $" +#ident "$Id: gdth.c,v 1.23 1999/03/26 09:12:31 achim Exp $" /* All GDT Disk Array Controllers are fully supported by this driver. * This includes the PCI/EISA/ISA SCSI Disk Array Controllers and the @@ -122,9 +147,10 @@ * max_ids:x x - target ID count per channel (1..MAXID) * rescan:Y rescan all channels/IDs * rescan:N use all devices found until now + * hdr_channel:x x - number of virtual bus for host drives * * The default value is: "gdth=disable:N,reserve_mode:1,reverse_scan:N, - * max_ids:127,rescan:N". + * max_ids:127,rescan:N,hdr_channel:0". * Here is another example: "gdth=reserve_list:0,1,2,0,0,1,3,0,rescan:Y". * * When loading the gdth driver as a module, the same options are available. @@ -134,7 +160,7 @@ * '1' in place of 'Y' and '0' in place of 'N'. * * Default: "modprobe gdth disable=0 reserve_mode=1 reverse_scan=0 - * max_ids=127 rescan=0" + * max_ids=127 rescan=0 hdr_channel=0" * The other example: "modprobe gdth reserve_list=0,1,2,0,0,1,3,0 rescan=1". */ @@ -179,6 +205,8 @@ #include "gdth.h" +static void gdth_delay(int milliseconds); +static void gdth_eval_mapping(ulong32 size, int *cyls, int *heads, int *secs); #if LINUX_VERSION_CODE >= 0x010346 static void gdth_interrupt(int irq,void *dev_id,struct pt_regs *regs); #else @@ -186,7 +214,7 @@ #endif static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp); static int gdth_async_event(int hanum,int service); -static void gdth_log_event(gdth_evt_data *dvr); +static void gdth_log_event(gdth_evt_data *dvr, char *buffer); static void gdth_putq(int hanum,Scsi_Cmnd *scp,unchar priority); static void gdth_next(int hanum); @@ -226,6 +254,7 @@ static const char *gdth_ctr_name(int hanum); +#if LINUX_VERSION_CODE >= 0x010300 static void gdth_flush(int hanum); #if LINUX_VERSION_CODE >= 0x020100 static int gdth_halt(struct notifier_block *nb, ulong event, void *buf); @@ -233,6 +262,7 @@ static int halt_called = FALSE; void gdth_halt(void); #endif +#endif #ifdef DEBUG_GDTH static unchar DebugState = DEBUG_GDTH; @@ -331,6 +361,7 @@ #define HADATA(a) (&((gdth_ext_str *)((a)->hostdata))->haext) #define CMDDATA(a) (&((gdth_ext_str *)((a)->hostdata))->cmdext) +#define BUS_L2P(a,b) ((b)>(a)->virt_bus ? (b-1):(b)) #if LINUX_VERSION_CODE < 0x010300 static void *gdth_mmap(ulong paddr, ulong size) @@ -429,16 +460,16 @@ static unchar gdth_direction_tab[0x100] = { DNO,DNO,DIN,DIN,DOU,DIN,DIN,DOU,DIN,DUN,DOU,DOU,DUN,DUN,DUN,DIN, DNO,DIN,DIN,DOU,DIN,DOU,DNO,DNO,DOU,DNO,DIN,DNO,DIN,DOU,DNO,DUN, - DIN,DUN,DIN,DUN,DOU,DIN,DUN,DUN,DIN,DIN,DIN,DUN,DUN,DIN,DIN,DIN, - DIN,DIN,DIN,DNO,DIN,DNO,DNO,DIN,DIN,DIN,DIN,DIN,DIN,DIN,DIN,DIN, - DIN,DIN,DIN,DIN,DIN,DNO,DUN,DNO,DNO,DNO,DUN,DNO,DIN,DIN,DUN,DUN, - DUN,DUN,DUN,DUN,DUN,DIN,DUN,DUN,DUN,DUN,DIN,DUN,DUN,DUN,DUN,DUN, + DIN,DUN,DIN,DUN,DOU,DIN,DUN,DUN,DIN,DIN,DOU,DNO,DUN,DIN,DOU,DOU, + DOU,DOU,DOU,DNO,DIN,DNO,DNO,DIN,DOU,DOU,DOU,DOU,DIN,DOU,DIN,DOU, + DOU,DOU,DIN,DIN,DIN,DNO,DUN,DNO,DNO,DNO,DUN,DNO,DOU,DIN,DUN,DUN, + DUN,DUN,DUN,DUN,DUN,DOU,DUN,DUN,DUN,DUN,DIN,DUN,DUN,DUN,DUN,DUN, DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN, DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN, DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN, DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN, - DUN,DUN,DUN,DUN,DUN,DNO,DNO,DUN,DIN,DNO,DIN,DUN,DNO,DUN,DIN,DIN, - DIN,DIN,DIN,DNO,DUN,DIN,DIN,DIN,DIN,DUN,DUN,DUN,DUN,DUN,DUN,DUN, + DUN,DUN,DUN,DUN,DUN,DNO,DNO,DUN,DIN,DNO,DOU,DUN,DNO,DUN,DOU,DOU, + DOU,DOU,DOU,DNO,DUN,DIN,DOU,DIN,DIN,DUN,DUN,DUN,DUN,DUN,DUN,DUN, DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN, DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN, DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DOU,DUN,DUN,DUN,DUN,DUN, @@ -474,25 +505,6 @@ #define GDTH_UNLOCK_SCSI_DOCMD() do {} while (0) #endif -/* /proc support */ -#if LINUX_VERSION_CODE >= 0x010300 -#include -struct proc_dir_entry proc_scsi_gdth = { - PROC_SCSI_GDTH, 4, "gdth", - S_IFDIR | S_IRUGO | S_IXUGO, 2 -}; -#include "gdth_proc.h" -#include "gdth_proc.c" -#endif - -#if LINUX_VERSION_CODE >= 0x020100 -/* notifier block to get a notify on system shutdown/halt/reboot */ -static struct notifier_block gdth_notifier = { - gdth_halt, NULL, 0 -}; -#endif - - /* LILO and modprobe/insmod parameters */ /* IRQ list for GDT3000/3020 EISA controllers */ static int irq[MAXHA] __initdata = @@ -501,14 +513,16 @@ /* disable driver flag */ static int disable __initdata = 0; /* reserve flag */ -static int reserve_mode __initdata = 1; +static int reserve_mode = 1; /* reserve list */ -static int reserve_list[MAX_RES_ARGS] __initdata = +static int reserve_list[MAX_RES_ARGS] = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; /* scan order for PCI controllers */ -static int reverse_scan __initdata = 0; +static int reverse_scan = 0; +/* virtual channel for the host drives */ +static int hdr_channel = 0; /* max. IDs per channel */ static int max_ids = MAXID; /* rescan all IDs */ @@ -522,12 +536,31 @@ MODULE_PARM(reserve_mode, "i"); MODULE_PARM(reserve_list, "4-" __MODULE_STRING(MAX_RES_ARGS) "i"); MODULE_PARM(reverse_scan, "i"); +MODULE_PARM(hdr_channel, "i"); MODULE_PARM(max_ids, "i"); MODULE_PARM(rescan, "i"); MODULE_AUTHOR("Achim Leubner"); #endif #endif +/* /proc support */ +#if LINUX_VERSION_CODE >= 0x010300 +#include +struct proc_dir_entry proc_scsi_gdth = { + PROC_SCSI_GDTH, 4, "gdth", + S_IFDIR | S_IRUGO | S_IXUGO, 2 +}; +#include "gdth_proc.h" +#include "gdth_proc.c" +#endif + +#if LINUX_VERSION_CODE >= 0x020100 +/* notifier block to get a notify on system shutdown/halt/reboot */ +static struct notifier_block gdth_notifier = { + gdth_halt, NULL, 0 +}; +#endif + static void gdth_delay(int milliseconds) { @@ -544,6 +577,25 @@ } } +static void gdth_eval_mapping(ulong32 size, int *cyls, int *heads, int *secs) +{ + *cyls = size /HEADS/SECS; + if (*cyls <= MAXCYLS) { + *heads = HEADS; + *secs = SECS; + } else { /* too high for 64*32 */ + *cyls = size /MEDHEADS/MEDSECS; + if (*cyls <= MAXCYLS) { + *heads = MEDHEADS; + *secs = MEDSECS; + } else { /* too high for 127*63 */ + *cyls = size /BIGHEADS/BIGSECS; + *heads = BIGHEADS; + *secs = BIGSECS; + } + } +} + /* controller search and initialization functions */ __initfunc (static int gdth_search_eisa(ushort eisa_adr)) @@ -1413,9 +1465,9 @@ ha->pccb->Service |= 0x80; if (ha->type == GDT_EISA) { - outb(ha->pccb->Service, ha->bmic + LDOORREG); if (ha->pccb->OpCode == GDT_INIT) /* store DMA buffer */ - outl((ulong)ha->pccb, ha->bmic + MAILBOXREG); + outl(virt_to_bus(ha->pccb), ha->bmic + MAILBOXREG); + outb(ha->pccb->Service, ha->bmic + LDOORREG); } else if (ha->type == GDT_ISA) { gdth_writeb(0, &((gdt2_dpram_str *)ha->brd)->io.event); } else if (ha->type == GDT_PCI) { @@ -1526,11 +1578,15 @@ { register gdth_ha_str *ha; ushort cdev_cnt, i; - ulong32 drv_cyls, drv_hds, drv_secs; + int drv_cyls, drv_hds, drv_secs; ulong32 bus_no; + ulong32 drv_cnt, drv_no, j; gdth_getch_str *chn; + gdth_drlist_str *drl; gdth_iochan_str *ioc; - + gdth_raw_iochan_str *iocr; + gdth_arraylist_str *alst; + TRACE(("gdth_search_drives() hanum %d\n",hanum)); ha = HADATA(gdth_ctr_tab[hanum]); @@ -1565,19 +1621,19 @@ cdev_cnt = (ushort)ha->info; /* detect number of buses - try new IOCTL */ - ioc = (gdth_iochan_str *)ha->pscratch; - ioc->version = 0xffffffff; - ioc->list_entries = MAXBUS; - ioc->first_chan = 0; - ioc->last_chan = MAXBUS-1; - ioc->list_offset = GDTOFFSOF(gdth_iochan_str, list[0]); - if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL,GET_IOCHAN_DESC, - INVALID_CHANNEL,sizeof(gdth_iochan_str))) { - TRACE2(("GET_IOCHAN_DESC supported!\n")); - ha->bus_cnt = ioc->chan_count; + iocr = (gdth_raw_iochan_str *)ha->pscratch; + iocr->hdr.version = 0xffffffff; + iocr->hdr.list_entries = MAXBUS; + iocr->hdr.first_chan = 0; + iocr->hdr.last_chan = MAXBUS-1; + iocr->hdr.list_offset = GDTOFFSOF(gdth_raw_iochan_str, list[0]); + if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL,IOCHAN_RAW_DESC, + INVALID_CHANNEL,sizeof(gdth_raw_iochan_str))) { + TRACE2(("IOCHAN_RAW_DESC supported!\n")); + ha->bus_cnt = iocr->hdr.chan_count; for (bus_no = 0; bus_no < ha->bus_cnt; ++bus_no) { - if (ioc->list[bus_no].proc_id < MAXID) - ha->bus_id[bus_no] = ioc->list[bus_no].proc_id; + if (iocr->list[bus_no].proc_id < MAXID) + ha->bus_id[bus_no] = iocr->list[bus_no].proc_id; else ha->bus_id[bus_no] = 0xff; } @@ -1618,16 +1674,100 @@ ha->cpar.version,ha->cpar.state,ha->cpar.strategy, ha->cpar.write_back,ha->cpar.block_size)); - /* read board info, fill ctr_name[] */ + /* read board info and features */ + ha->more_proc = FALSE; if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL,BOARD_INFO, INVALID_CHANNEL,sizeof(gdth_binfo_str))) { - TRACE2(("BOARD_INFO supported!\n")); - strcpy(ha->ctr_name, ((gdth_binfo_str *)ha->pscratch)->type_string); + ha->binfo = *(gdth_binfo_str *)ha->pscratch; + if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL,BOARD_FEATURES, + INVALID_CHANNEL,sizeof(gdth_bfeat_str))) { + TRACE2(("BOARD_INFO/BOARD_FEATURES supported\n")); + ha->bfeat = *(gdth_bfeat_str *)ha->pscratch; + ha->more_proc = TRUE; + } } else { - strcpy(ha->ctr_name, gdth_ctr_name(hanum)); + TRACE2(("BOARD_INFO requires firmware >= 1.10/2.08\n")); + strcpy(ha->binfo.type_string, gdth_ctr_name(hanum)); } - TRACE2(("Controller name: %s\n",ha->ctr_name)); + TRACE2(("Controller name: %s\n",ha->binfo.type_string)); + /* read more informations */ + if (ha->more_proc) { + /* physical drives, channel addresses */ + ioc = (gdth_iochan_str *)ha->pscratch; + ioc->hdr.version = 0xffffffff; + ioc->hdr.list_entries = MAXBUS; + ioc->hdr.first_chan = 0; + ioc->hdr.last_chan = MAXBUS-1; + ioc->hdr.list_offset = GDTOFFSOF(gdth_iochan_str, list[0]); + if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL,IOCHAN_DESC, + INVALID_CHANNEL,sizeof(gdth_iochan_str))) { + for (bus_no = 0; bus_no < ha->bus_cnt; ++bus_no) { + ha->raw[bus_no].address = ioc->list[bus_no].address; + ha->raw[bus_no].local_no = ioc->list[bus_no].local_no; + } + } else { + for (bus_no = 0; bus_no < ha->bus_cnt; ++bus_no) { + ha->raw[bus_no].address = IO_CHANNEL; + ha->raw[bus_no].local_no = bus_no; + } + } + for (bus_no = 0; bus_no < ha->bus_cnt; ++bus_no) { + chn = (gdth_getch_str *)ha->pscratch; + chn->channel_no = ha->raw[bus_no].local_no; + if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL, + SCSI_CHAN_CNT | L_CTRL_PATTERN, + ha->raw[bus_no].address | INVALID_CHANNEL, + sizeof(gdth_getch_str))) { + ha->raw[bus_no].pdev_cnt = chn->drive_cnt; + TRACE2(("Channel %d: %d phys. drives\n", + bus_no,chn->drive_cnt)); + } + if (ha->raw[bus_no].pdev_cnt > 0) { + drl = (gdth_drlist_str *)ha->pscratch; + drl->sc_no = ha->raw[bus_no].local_no; + drl->sc_cnt = ha->raw[bus_no].pdev_cnt; + if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL, + SCSI_DR_LIST | L_CTRL_PATTERN, + ha->raw[bus_no].address | INVALID_CHANNEL, + sizeof(gdth_drlist_str))) { + for (j = 0; j < ha->raw[bus_no].pdev_cnt; ++j) + ha->raw[bus_no].id_list[j] = drl->sc_list[j]; + } else { + ha->raw[bus_no].pdev_cnt = 0; + } + } + } + + /* logical drives */ + if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL,CACHE_DRV_CNT, + INVALID_CHANNEL,sizeof(ulong32))) { + drv_cnt = *(ulong32 *)ha->pscratch; + if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL,CACHE_DRV_LIST, + INVALID_CHANNEL,drv_cnt * sizeof(ulong32))) { + for (j = 0; j < drv_cnt; ++j) { + drv_no = ((ulong32 *)ha->pscratch)[j]; + if (drv_no < MAX_HDRIVES) { + ha->hdr[drv_no].is_logdrv = TRUE; + TRACE2(("Drive %d is log. drive\n",drv_no)); + } + } + } + if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL, + ARRAY_DRV_LIST | LA_CTRL_PATTERN, + 0, 35 * sizeof(gdth_arraylist_str))) { + for (j = 0; j < 35; ++j) { + alst = &((gdth_arraylist_str *)ha->pscratch)[j]; + ha->hdr[j].is_arraydrv = alst->is_arrayd; + ha->hdr[j].is_master = alst->is_master; + ha->hdr[j].is_parity = alst->is_parity; + ha->hdr[j].is_hotfix = alst->is_hotfix; + ha->hdr[j].master_no = alst->cd_handle; + } + } + } + } + /* initialize raw service */ if (!gdth_internal_cmd(hanum,SCSIRAWSERVICE,GDT_INIT,0,0,0)) { printk("GDT: Initialization error raw service (code %d)\n", @@ -1695,21 +1835,7 @@ /* evaluate mapping (sectors per head, heads per cylinder) */ ha->hdr[i].size &= ~SECS32; if (ha->info2 == 0) { - drv_cyls = ha->hdr[i].size /HEADS/SECS; - if (drv_cyls <= MAXCYLS) { - drv_hds = HEADS; - drv_secs= SECS; - } else { /* too high for 64*32 */ - drv_cyls = ha->hdr[i].size /MEDHEADS/MEDSECS; - if (drv_cyls <= MAXCYLS) { - drv_hds = MEDHEADS; - drv_secs= MEDSECS; - } else { /* too high for 127*63 */ - drv_cyls = ha->hdr[i].size /BIGHEADS/BIGSECS; - drv_hds = BIGHEADS; - drv_secs= BIGSECS; - } - } + gdth_eval_mapping(ha->hdr[i].size,&drv_cyls,&drv_hds,&drv_secs); } else { drv_hds = ha->info2 & 0xff; drv_secs = (ha->info2 >> 8) & 0xff; @@ -1752,7 +1878,6 @@ GDTH_LOCK_HA(ha, flags); scp->SCp.this_residual = (int)priority; - gdth_update_timeout(hanum, scp, scp->timeout_per_command * 6); #if LINUX_VERSION_CODE >= 0x020000 b = scp->channel; #else @@ -1761,8 +1886,8 @@ t = scp->target; #if LINUX_VERSION_CODE >= 0x010300 if (priority >= DEFAULT_PRI) { - if ((b < ha->bus_cnt && ha->raw[b].lock) || - (b == ha->bus_cnt && ha->hdr[t].lock)) { + if ((b != ha->virt_bus && ha->raw[BUS_L2P(ha,b)].lock) || + (b == ha->virt_bus && t < MAX_HDRIVES && ha->hdr[t].lock)) { TRACE2(("gdth_putq(): locked IO -> update_timeout()\n")); scp->SCp.buffers_residual = gdth_update_timeout(hanum, scp, 0); } @@ -1825,8 +1950,8 @@ #endif t = nscp->target; if (nscp->SCp.this_residual >= DEFAULT_PRI) { - if ((b < ha->bus_cnt && ha->raw[b].lock) || - (b == ha->bus_cnt && ha->hdr[t].lock)) + if ((b != ha->virt_bus && ha->raw[BUS_L2P(ha,b)].lock) || + (b == ha->virt_bus && t < MAX_HDRIVES && ha->hdr[t].lock)) continue; } @@ -1843,22 +1968,24 @@ firsttime = FALSE; } +#if LINUX_VERSION_CODE >= 0x010300 + if (nscp->done != gdth_scsi_done) +#endif + { if (nscp->SCp.phase == -1) { nscp->SCp.phase = SCSIRAWSERVICE; /* default: raw svc. */ if (nscp->cmnd[0] == TEST_UNIT_READY) { - TRACE2(("TEST_UNIT_READY Bus %d Id %d LUN %d\n", - nscp->channel, nscp->target, nscp->lun)); + TRACE2(("TEST_UNIT_READY Bus %d Id %d LUN %d\n", + b, t, nscp->lun)); /* TEST_UNIT_READY -> set scan mode */ if ((ha->scan_mode & 0x0f) == 0) { - if (nscp->channel == 0 && nscp->target == 0 && - nscp->lun == 0) { + if (b == 0 && t == 0 && nscp->lun == 0) { ha->scan_mode |= 1; TRACE2(("Scan mode: 0x%x\n", ha->scan_mode)); } } else if ((ha->scan_mode & 0x0f) == 1) { - if (nscp->channel == 0 && - ((nscp->target == 0 && nscp->lun == 1) || - (nscp->target == 1 && nscp->lun == 0))) { + if (b == 0 && ((t == 0 && nscp->lun == 1) || + (t == 1 && nscp->lun == 0))) { nscp->SCp.Status = GDT_SCAN_START; nscp->SCp.phase |= ((ha->scan_mode & 0x10 ? 1:0) << 8); ha->scan_mode = 0x12; @@ -1869,7 +1996,7 @@ TRACE2(("Scan mode: 0x%x\n", ha->scan_mode)); } } else if (ha->scan_mode == 0x12) { - if (b == ha->bus_cnt) { + if (b == ha->bus_cnt && t == ha->tid_cnt-1) { nscp->SCp.Status = GDT_SCAN_END; ha->scan_mode &= 0x10; TRACE2(("Scan mode: 0x%x (SCAN_END)\n", @@ -1878,10 +2005,12 @@ } } } + } if (nscp->SCp.Status != -1) { if ((nscp->SCp.phase & 0xff) == SCSIRAWSERVICE) { - cmd_index=gdth_fill_raw_cmd(hanum,nscp,b); + if (!(cmd_index=gdth_fill_raw_cmd(hanum,nscp,BUS_L2P(ha,b)))) + this_cmd = FALSE; next_cmd = FALSE; } } else @@ -1893,13 +2022,15 @@ next_cmd = FALSE; } else #endif - if (b < ha->bus_cnt) { - if (!(cmd_index=gdth_fill_raw_cmd(hanum,nscp,b))) { + if (b != ha->virt_bus) { + if (ha->raw[BUS_L2P(ha,b)].io_cnt[t] >= GDTH_MAX_RAW || + !(cmd_index=gdth_fill_raw_cmd(hanum,nscp,BUS_L2P(ha,b)))) this_cmd = FALSE; - } - } else if (!ha->hdr[nscp->target].present || nscp->lun != 0) { + else + ha->raw[BUS_L2P(ha,b)].io_cnt[t]++; + } else if (t >= MAX_HDRIVES || !ha->hdr[t].present || nscp->lun != 0) { TRACE2(("Command 0x%x to bus %d id %d lun %d -> IGNORE\n", - nscp->cmnd[0], b, nscp->target, nscp->lun)); + nscp->cmnd[0], b, t, nscp->lun)); nscp->result = DID_BAD_TARGET << 16; GDTH_UNLOCK_HA(ha,flags); /* io_request_lock already active ! */ @@ -2405,14 +2536,13 @@ ushort idx, gdth_evt_data *evt) { gdth_evt_str *e; - ulong flags; struct timeval tv; + /* no GDTH_LOCK_HA() ! */ TRACE2(("gdth_store_event() source %d idx %d\n", source, idx)); if (source == 0) /* no source -> no event */ return 0; - GDTH_LOCK_HA(ha, flags); if (ebuffer[elastidx].event_source == source && ebuffer[elastidx].event_idx == idx && !memcmp((char *)&ebuffer[elastidx].event_data.eu, @@ -2440,7 +2570,6 @@ e->same_count = 1; e->event_data = *evt; } - GDTH_UNLOCK_HA(ha, flags); return e; } @@ -2808,9 +2937,12 @@ printk("\n"); } else { - scp->SCp.Message = (int)ha->status; + if (scp->SCp.Status == -1 && scp->channel != ha->virt_bus) { + ha->raw[BUS_L2P(ha,scp->channel)].io_cnt[scp->target]--; + } /* cache or raw service */ if (ha->status == S_OK) { + scp->SCp.Message = S_OK; if (scp->SCp.Status != -1) { TRACE2(("gdth_sync_event(): special cmd 0x%x OK\n", scp->SCp.Status)); @@ -2821,8 +2953,10 @@ scp->result = DID_OK << 16; } else if (ha->status == S_BSY) { TRACE2(("Controller busy -> retry !\n")); + scp->SCp.Message = S_BSY; return 2; } else { + scp->SCp.Message = (int)((ha->info<<16)|ha->status); if (scp->SCp.Status != -1) { TRACE2(("gdth_sync_event(): special cmd 0x%x error 0x%x\n", scp->SCp.Status, ha->status)); @@ -2836,7 +2970,10 @@ scp->sense_buffer[2] = NOT_READY; scp->result = (DID_OK << 16) | (CHECK_CONDITION << 1); - if (scp->done != gdth_scsi_done) { +#if LINUX_VERSION_CODE >= 0x010300 + if (scp->done != gdth_scsi_done) +#endif + { dvr.size = sizeof(dvr.eu.sync); dvr.eu.sync.ionode = hanum; dvr.eu.sync.service = service; @@ -2904,7 +3041,7 @@ "GDT HA %u, Array Drive %u: parity build failed", /*18*/ "\005\000\002\006\002" "GDT HA %u, Array Drive %u: drive rebuild failed", -/*19*/ "\007\000\002\010\002" +/*19*/ "\005\000\002\010\002" "GDT HA %u, Test of Hot Fix %u failed", /*20*/ "\005\000\002\006\002" "GDT HA %u, Array Drive %u: drive build finished successfully", @@ -3066,12 +3203,12 @@ dvr.eu.async.info = ha->info; *(ulong32 *)dvr.eu.async.scsi_coord = ha->info2; gdth_store_event(ha, ES_ASYNC, service, &dvr); - gdth_log_event( &dvr ); + gdth_log_event( &dvr, NULL ); } return 1; } -static void gdth_log_event(gdth_evt_data *dvr) +static void gdth_log_event(gdth_evt_data *dvr, char *buffer) { gdth_stackframe stack; char *f = NULL; @@ -3101,12 +3238,22 @@ break; } } - - printk(&f[(int)f[0]],stack); printk("\n"); + + if (buffer == NULL) { + printk(&f[(int)f[0]],stack); + printk("\n"); + } else { + sprintf(buffer,&f[(int)f[0]],stack); + } } else { - printk("GDT: Unknown async. event service %d event no. %d\n", - dvr->eu.async.service,dvr->eu.async.status); + if (buffer == NULL) { + printk("GDT HA %u, Unknown async. event service %d event no. %d\n", + dvr->eu.async.ionode,dvr->eu.async.service,dvr->eu.async.status); + } else { + sprintf(buffer,"GDT HA %u, Unknown async. event service %d event no. %d", + dvr->eu.async.ionode,dvr->eu.async.service,dvr->eu.async.status); + } } } @@ -3249,6 +3396,9 @@ scsi_unregister(shp); continue; } + if (hdr_channel < 0 || hdr_channel > ha->bus_cnt) + hdr_channel = ha->bus_cnt; + ha->virt_bus = hdr_channel; #if LINUX_VERSION_CODE >= 0x020000 shp->max_id = ha->tid_cnt; @@ -3333,6 +3483,9 @@ scsi_unregister(shp); continue; } + if (hdr_channel < 0 || hdr_channel > ha->bus_cnt) + hdr_channel = ha->bus_cnt; + ha->virt_bus = hdr_channel; #if LINUX_VERSION_CODE >= 0x020000 shp->max_id = ha->tid_cnt; @@ -3429,6 +3582,9 @@ scsi_unregister(shp); continue; } + if (hdr_channel < 0 || hdr_channel > ha->bus_cnt) + hdr_channel = ha->bus_cnt; + ha->virt_bus = hdr_channel; #if LINUX_VERSION_CODE >= 0x020000 shp->max_id = ha->tid_cnt; @@ -3479,7 +3635,9 @@ if (NUMDATA(shp)->busnum == 0) { hanum = NUMDATA(shp)->hanum; ha = HADATA(gdth_ctr_tab[hanum]); +#if LINUX_VERSION_CODE >= 0x010300 gdth_flush(hanum); +#endif if (shp->irq) { #if LINUX_VERSION_CODE >= 0x010346 @@ -3552,7 +3710,7 @@ hanum = NUMDATA(shp)->hanum; ha = HADATA(gdth_ctr_tab[hanum]); - return ((const char *)ha->ctr_name); + return ((const char *)ha->binfo.type_string); } /* old error handling */ @@ -3588,8 +3746,33 @@ int gdth_eh_bus_reset(Scsi_Cmnd *scp) { + int i, hanum; + gdth_ha_str *ha; + ulong flags; + Scsi_Cmnd *cmnd; + TRACE2(("gdth_eh_bus_reset()\n")); - return FAILED; + hanum = NUMDATA(scp->host)->hanum; + ha = HADATA(gdth_ctr_tab[hanum]); + if (scp->channel == ha->virt_bus) + return FAILED; + + GDTH_LOCK_HA(ha, flags); + for (i = 0; i < MAXID; ++i) + ha->raw[BUS_L2P(ha,scp->channel)].io_cnt[i] = 0; + for (i = 0; i < GDTH_MAXCMDS; ++i) { + cmnd = ha->cmd_tab[i].cmnd; + if (!SPECIAL_SCP(cmnd) && cmnd->channel == scp->channel) + ha->cmd_tab[i].cmnd = UNUSED_CMND; + } + gdth_polling = TRUE; + while (gdth_test_busy(hanum)) + gdth_delay(0); + gdth_internal_cmd(hanum, SCSIRAWSERVICE, GDT_RESET_BUS, + BUS_L2P(ha,scp->channel), 0, 0); + gdth_polling = FALSE; + GDTH_UNLOCK_HA(ha, flags); + return SUCCESS; } int gdth_eh_host_reset(Scsi_Cmnd *scp) @@ -3608,7 +3791,6 @@ unchar t; int hanum; gdth_ha_str *ha; - int drv_hds, drv_secs; hanum = NUMDATA(disk->device->host)->hanum; t = disk->device->id; @@ -3616,27 +3798,16 @@ hanum, disk->device->channel, t)); ha = HADATA(gdth_ctr_tab[hanum]); - if (ha->hdr[t].heads == 0) { - /* raw device: evaluate mapping (sectors per head, heads per cylinder) */ - if (disk->capacity /HEADS/SECS <= MAXCYLS) { - drv_hds = HEADS; - drv_secs= SECS; - } else if (disk->capacity /MEDHEADS/MEDSECS <= MAXCYLS) { - drv_hds = MEDHEADS; - drv_secs= MEDSECS; - } else { - drv_hds = BIGHEADS; - drv_secs= BIGSECS; - } - ha->hdr[t].heads = drv_hds; - ha->hdr[t].secs = drv_secs; - TRACE2(("gdth_bios_param(): raw device -> params evaluated\n")); + if (disk->device->channel != ha->virt_bus || ha->hdr[t].heads == 0) { + /* raw device or host drive without mapping information */ + TRACE2(("Evaluate mapping\n")); + gdth_eval_mapping(disk->capacity,&ip[2],&ip[0],&ip[1]); + } else { + ip[0] = ha->hdr[t].heads; + ip[1] = ha->hdr[t].secs; + ip[2] = disk->capacity / ip[0] / ip[1]; } - ip[0] = ha->hdr[t].heads; - ip[1] = ha->hdr[t].secs; - ip[2] = disk->capacity / ip[0] / ip[1]; - TRACE2(("gdth_bios_param(): %d heads, %d secs, %d cyls\n", ip[0],ip[1],ip[2])); return 0; @@ -3683,11 +3854,13 @@ if (scp->done == gdth_scsi_done) priority = scp->SCp.this_residual; #endif + gdth_update_timeout(hanum, scp, scp->timeout_per_command * 6); gdth_putq( hanum, scp, priority ); gdth_next( hanum ); return 0; } +#if LINUX_VERSION_CODE >= 0x010300 /* flush routine */ static void gdth_flush(int hanum) { @@ -3696,7 +3869,6 @@ Scsi_Cmnd scp; Scsi_Device sdev; gdth_cmd_str gdtcmd; - char cmnd[12]; TRACE2(("gdth_flush() hanum %d\n",hanum)); ha = HADATA(gdth_ctr_tab[hanum]); @@ -3719,18 +3891,7 @@ gdtcmd.u.cache.BlockNo = 1; gdtcmd.u.cache.sg_canz = 0; TRACE2(("gdth_flush(): flush ha %d drive %d\n", hanum, i)); - { - struct semaphore sem = MUTEX_LOCKED; - scp.request.rq_status = RQ_SCSI_BUSY; - scp.request.sem = &sem; - scp.SCp.this_residual = IOCTL_PRI; - GDTH_LOCK_SCSI_DOCMD(); - scsi_do_cmd(&scp, cmnd, &gdtcmd, - sizeof(gdth_cmd_str), gdth_scsi_done, - 30*HZ, 1); - GDTH_UNLOCK_SCSI_DOCMD(); - down(&sem); - } + gdth_do_cmd(&scp, &gdtcmd, 30); } } } @@ -3747,7 +3908,6 @@ Scsi_Cmnd scp; Scsi_Device sdev; gdth_cmd_str gdtcmd; - char cmnd[12]; #endif #if LINUX_VERSION_CODE >= 0x020100 @@ -3782,18 +3942,7 @@ gdtcmd.Service = CACHESERVICE; gdtcmd.OpCode = GDT_RESET; TRACE2(("gdth_halt(): reset controller %d\n", hanum)); - { - struct semaphore sem = MUTEX_LOCKED; - scp.request.rq_status = RQ_SCSI_BUSY; - scp.request.sem = &sem; - scp.SCp.this_residual = IOCTL_PRI; - GDTH_LOCK_SCSI_DOCMD(); - scsi_do_cmd(&scp, cmnd, &gdtcmd, - sizeof(gdth_cmd_str), gdth_scsi_done, - 10*HZ, 1); - GDTH_UNLOCK_SCSI_DOCMD(); - down(&sem); - } + gdth_do_cmd(&scp, &gdtcmd, 10); #endif } printk("Done.\n"); @@ -3806,6 +3955,7 @@ return NOTIFY_OK; #endif } +#endif /* called from init/main.c */ @@ -3846,6 +3996,8 @@ reserve_mode = val; else if (!strncmp(argv, "reverse_scan:", 13)) reverse_scan = val; + else if (!strncmp(argv, "hdr_channel:", 12)) + hdr_channel = val; else if (!strncmp(argv, "max_ids:", 8)) max_ids = val; else if (!strncmp(argv, "rescan:", 7)) diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/gdth.h linux/drivers/scsi/gdth.h --- v2.2.5/linux/drivers/scsi/gdth.h Wed Jan 13 15:00:42 1999 +++ linux/drivers/scsi/gdth.h Fri Apr 16 14:28:51 1999 @@ -4,13 +4,13 @@ /* * Header file for the GDT ISA/EISA/PCI Disk Array Controller driver for Linux * - * gdth.h Copyright (C) 1995-98 ICP vortex Computersysteme GmbH, Achim Leubner + * gdth.h Copyright (C) 1995-99 ICP vortex Computersysteme GmbH, Achim Leubner * See gdth.c for further informations and * below for supported controller types * * * - * $Id: gdth.h,v 1.16 1998/12/17 15:54:53 achim Exp $ + * $Id: gdth.h,v 1.21 1999/03/26 09:12:24 achim Exp $ */ #include @@ -29,9 +29,9 @@ /* defines, macros */ /* driver version */ -#define GDTH_VERSION_STR "1.10" +#define GDTH_VERSION_STR "1.14" #define GDTH_VERSION 1 -#define GDTH_SUBVERSION 10 +#define GDTH_SUBVERSION 14 /* protocol version */ #define PROTOCOL_VERSION 1 @@ -129,6 +129,7 @@ #define GDTH_SCRATCH 4096 /* 4KB scratch buffer */ #define GDTH_MAXCMDS 124 #define GDTH_MAXC_P_L 16 /* max. cmds per lun */ +#define GDTH_MAX_RAW 2 /* max. cmds per raw device */ #define MAXOFFSETS 128 #define MAXHA 16 #define MAXID 127 @@ -199,14 +200,27 @@ #define GDT_SCAN_END 20 /* stop device scan */ /* IOCTL command defines */ -#define SCSI_CHAN_CNT 5 /* subfunctions */ -#define GET_IOCHAN_DESC 0x5e -#define L_CTRL_PATTERN 0x20000000L -#define CACHE_INFO 4 -#define CACHE_CONFIG 5 -#define BOARD_INFO 0x28 -#define IO_CHANNEL 0x00020000L /* channels */ -#define INVALID_CHANNEL 0x0000ffffL +#define SCSI_DR_INFO 0x00 /* SCSI drive info */ +#define SCSI_CHAN_CNT 0x05 /* SCSI channel count */ +#define SCSI_DR_LIST 0x06 /* SCSI drive list */ +#define SCSI_DEF_CNT 0x15 /* grown/primary defects */ +#define DSK_STATISTICS 0x4b /* SCSI disk statistics */ +#define IOCHAN_DESC 0x5d /* description of IO channel */ +#define IOCHAN_RAW_DESC 0x5e /* description of raw IO channel */ +#define L_CTRL_PATTERN 0x20000000L /* SCSI IOCTL mask */ +#define ARRAY_INFO 0x12 /* array drive info */ +#define ARRAY_DRV_LIST 0x0f /* array drive list */ +#define LA_CTRL_PATTERN 0x10000000L /* array IOCTL mask */ +#define CACHE_DRV_CNT 0x01 /* cache drive count */ +#define CACHE_DRV_LIST 0x02 /* cache drive list */ +#define CACHE_INFO 0x04 /* cache info */ +#define CACHE_CONFIG 0x05 /* cache configuration */ +#define CACHE_DRV_INFO 0x07 /* cache drive info */ +#define BOARD_FEATURES 0x15 /* controller features */ +#define BOARD_INFO 0x28 /* controller info */ +#define HOST_GET 0x10001L /* get host drive list */ +#define IO_CHANNEL 0x00020000L /* default IO channel */ +#define INVALID_CHANNEL 0x0000ffffL /* invalid channel */ /* IOCTLs */ #define GDTIOCTL_MASK ('J'<<8) @@ -225,8 +239,8 @@ #define S_RAW_ILL 0xff /* raw serv.: illegal */ /* timeout values */ -#define INIT_RETRIES 10000 /* 10000 * 1ms = 10s */ -#define INIT_TIMEOUT 100000 /* 1000 * 1ms = 1s */ +#define INIT_RETRIES 100000 /* 100000 * 1ms = 100s */ +#define INIT_TIMEOUT 100000 /* 100000 * 1ms = 100s */ #define POLL_TIMEOUT 10000 /* 10000 * 1ms = 10s */ /* priorities */ @@ -276,29 +290,171 @@ char msg_text[MSGLEN+2]; /* the message text */ } PACKED gdth_msg_str; -/* get channel count IOCTL */ +/* IOCTL data structures */ +/* SCSI drive info */ +typedef struct { + unchar vendor[8]; /* vendor string */ + unchar product[16]; /* product string */ + unchar revision[4]; /* revision */ + ulong32 sy_rate; /* current rate for sync. tr. */ + ulong32 sy_max_rate; /* max. rate for sync. tr. */ + ulong32 no_ldrive; /* belongs to this logical drv.*/ + ulong32 blkcnt; /* number of blocks */ + ushort blksize; /* size of block in bytes */ + unchar available; /* flag: access is available */ + unchar init; /* medium is initialized */ + unchar devtype; /* SCSI devicetype */ + unchar rm_medium; /* medium is removable */ + unchar wp_medium; /* medium is write protected */ + unchar ansi; /* SCSI I/II or III? */ + unchar protocol; /* same as ansi */ + unchar sync; /* flag: sync. transfer enab. */ + unchar disc; /* flag: disconnect enabled */ + unchar queueing; /* flag: command queing enab. */ + unchar cached; /* flag: caching enabled */ + unchar target_id; /* target ID of device */ + unchar lun; /* LUN id of device */ + unchar orphan; /* flag: drive fragment */ + ulong32 last_error; /* sense key or drive state */ + ulong32 last_result; /* result of last command */ + ulong32 check_errors; /* err. in last surface check */ + unchar percent; /* progress for surface check */ + unchar last_check; /* IOCTRL operation */ + unchar res[2]; + ulong32 flags; /* from 1.19/2.19: raw reserv.*/ + unchar multi_bus; /* multi bus dev? (fibre ch.) */ + unchar mb_status; /* status: available? */ + unchar res2[2]; + unchar mb_alt_status; /* status on second bus */ + unchar mb_alt_bid; /* number of second bus */ + unchar mb_alt_tid; /* target id on second bus */ + unchar res3; + unchar fc_flag; /* from 1.22/2.22: info valid?*/ + unchar res4; + ushort fc_frame_size; /* frame size (bytes) */ + char wwn[8]; /* world wide name */ +} PACKED gdth_diskinfo_str; + +/* get SCSI channel count */ typedef struct { ulong32 channel_no; /* number of channel */ - ulong32 drive_cnt; /* number of drives */ + ulong32 drive_cnt; /* drive count */ unchar siop_id; /* SCSI processor ID */ unchar siop_state; /* SCSI processor state */ } PACKED gdth_getch_str; -/* get raw channel count IOCTL (NEW!) */ +/* get SCSI drive numbers */ typedef struct { - ulong32 version; /* version of information (-1UL: newest) */ - unchar list_entries; /* list entry count */ - unchar first_chan; /* first channel number */ - unchar last_chan; /* last channel number */ - unchar chan_count; /* (R) channel count */ - ulong32 list_offset; /* offset of list[0] */ + ulong32 sc_no; /* SCSI channel */ + ulong32 sc_cnt; /* sc_list[] elements */ + ulong32 sc_list[MAXID]; /* minor device numbers */ +} PACKED gdth_drlist_str; + +/* get grown/primary defect count */ +typedef struct { + unchar sddc_type; /* 0x08: grown, 0x10: prim. */ + unchar sddc_format; /* list entry format */ + unchar sddc_len; /* list entry length */ + unchar sddc_res; + ulong32 sddc_cnt; /* entry count */ +} PACKED gdth_defcnt_str; + +/* disk statistics */ +typedef struct { + ulong32 bid; /* SCSI channel */ + ulong32 first; /* first SCSI disk */ + ulong32 entries; /* number of elements */ + ulong32 count; /* (R) number of init. el. */ + ulong32 mon_time; /* time stamp */ struct { - unchar proc_id; /* processor id */ - unchar proc_defect; /* defect ? */ - unchar reserved[2]; + unchar tid; /* target ID */ + unchar lun; /* LUN */ + unchar res[2]; + ulong32 blk_size; /* block size in bytes */ + ulong32 rd_count; /* bytes read */ + ulong32 wr_count; /* bytes written */ + ulong32 rd_blk_count; /* blocks read */ + ulong32 wr_blk_count; /* blocks written */ + ulong32 retries; /* retries */ + ulong32 reassigns; /* reassigns */ + } PACKED list[1]; +} PACKED gdth_dskstat_str; + +/* IO channel header */ +typedef struct { + ulong32 version; /* version (-1UL: newest) */ + unchar list_entries; /* list entry count */ + unchar first_chan; /* first channel number */ + unchar last_chan; /* last channel number */ + unchar chan_count; /* (R) channel count */ + ulong32 list_offset; /* offset of list[0] */ +} PACKED gdth_iochan_header; + +/* get IO channel description */ +typedef struct { + gdth_iochan_header hdr; + struct { + ulong32 address; /* channel address */ + unchar type; /* type (SCSI, FCAL) */ + unchar local_no; /* local number */ + ushort features; /* channel features */ } PACKED list[MAXBUS]; } PACKED gdth_iochan_str; +/* get raw IO channel description */ +typedef struct { + gdth_iochan_header hdr; + struct { + unchar proc_id; /* processor id */ + unchar proc_defect; /* defect ? */ + unchar reserved[2]; + } PACKED list[MAXBUS]; +} PACKED gdth_raw_iochan_str; + +/* array drive component */ +typedef struct { + ulong32 al_controller; /* controller ID */ + unchar al_cache_drive; /* cache drive number */ + unchar al_status; /* cache drive state */ + unchar al_res[2]; +} PACKED gdth_arraycomp_str; + +/* array drive information */ +typedef struct { + unchar ai_type; /* array type (RAID0,4,5) */ + unchar ai_cache_drive_cnt; /* active cachedrives */ + unchar ai_state; /* array drive state */ + unchar ai_master_cd; /* master cachedrive */ + ulong32 ai_master_controller; /* ID of master controller */ + ulong32 ai_size; /* user capacity [sectors] */ + ulong32 ai_striping_size; /* striping size [sectors] */ + ulong32 ai_secsize; /* sector size [bytes] */ + ulong32 ai_err_info; /* failed cache drive */ + unchar ai_name[8]; /* name of the array drive */ + unchar ai_controller_cnt; /* number of controllers */ + unchar ai_removable; /* flag: removable */ + unchar ai_write_protected; /* flag: write protected */ + unchar ai_devtype; /* type: always direct access */ + gdth_arraycomp_str ai_drives[35]; /* drive components: */ + unchar ai_drive_entries; /* number of drive components */ + unchar ai_protected; /* protection flag */ + unchar ai_verify_state; /* state of a parity verify */ + unchar ai_ext_state; /* extended array drive state */ + unchar ai_expand_state; /* array expand state (>=2.18)*/ + unchar ai_reserved[3]; +} PACKED gdth_arrayinf_str; + +/* get array drive list */ +typedef struct { + ulong32 controller_no; /* controller no. */ + unchar cd_handle; /* master cachedrive */ + unchar is_arrayd; /* Flag: is array drive? */ + unchar is_master; /* Flag: is array master? */ + unchar is_parity; /* Flag: is parity drive? */ + unchar is_hotfix; /* Flag: is hotfix drive? */ + unchar res[3]; +} PACKED gdth_arraylist_str; + /* cache info/config IOCTL */ typedef struct { ulong32 version; /* firmware version */ @@ -322,6 +478,34 @@ gdth_cstat_str cstat; } PACKED gdth_cinfo_str; +/* cache drive info */ +typedef struct { + unchar cd_name[8]; /* cache drive name */ + ulong32 cd_devtype; /* SCSI devicetype */ + ulong32 cd_ldcnt; /* number of log. drives */ + ulong32 cd_last_error; /* last error */ + unchar cd_initialized; /* drive is initialized */ + unchar cd_removable; /* media is removable */ + unchar cd_write_protected; /* write protected */ + unchar cd_flags; /* Pool Hot Fix? */ + ulong32 ld_blkcnt; /* number of blocks */ + ulong32 ld_blksize; /* blocksize */ + ulong32 ld_dcnt; /* number of disks */ + ulong32 ld_slave; /* log. drive index */ + ulong32 ld_dtype; /* type of logical drive */ + ulong32 ld_last_error; /* last error */ + unchar ld_name[8]; /* log. drive name */ + unchar ld_error; /* error */ +} PACKED gdth_cdrinfo_str; + +/* board features */ +typedef struct { + unchar chaining; /* Chaining supported */ + unchar striping; /* Striping (RAID-0) supp. */ + unchar mirroring; /* Mirroring (RAID-1) supp. */ + unchar raid; /* RAID-4/5/10 supported */ +} PACKED gdth_bfeat_str; + /* board info IOCTL */ typedef struct { ulong32 ser_no; /* serial no. */ @@ -351,6 +535,28 @@ unchar ramparity_pres; /* RAM parity check hardware? */ } PACKED gdth_binfo_str; +/* get host drive info */ +typedef struct { + char name[8]; /* host drive name */ + ulong32 size; /* size (sectors) */ + unchar host_drive; /* host drive number */ + unchar log_drive; /* log. drive (master) */ + unchar reserved; + unchar rw_attribs; /* r/w attribs */ + ulong32 start_sec; /* start sector */ +} PACKED gdth_hentry_str; + +typedef struct { + ulong32 entries; /* entry count */ + ulong32 offset; /* offset of entries */ + unchar secs_p_head; /* sectors/head */ + unchar heads_p_cyl; /* heads/cylinder */ + unchar reserved; + unchar clust_drvtype; /* cluster drive type */ + ulong32 location; /* controller number */ + gdth_hentry_str entry[MAX_HDRIVES]; /* entries */ +} PACKED gdth_hget_str; + /* scatter/gather element */ typedef struct { ulong32 sg_ptr; /* address */ @@ -642,16 +848,30 @@ ulong32 info2; /* additional info */ Scsi_Cmnd *req_first; /* top of request queue */ struct { - unchar present; /* host drive present? */ + unchar present; /* Flag: host drive present? */ + unchar is_logdrv; /* Flag: logical drive (master)? */ + unchar is_arraydrv; /* Flag: array drive? */ + unchar is_master; /* Flag: array drive master? */ + unchar is_parity; /* Flag: parity drive? */ + unchar is_hotfix; /* Flag: hotfix drive? */ + unchar master_no; /* number of master drive */ unchar lock; /* drive locked? (hot plug) */ unchar heads; /* mapping */ unchar secs; ushort devtype; /* further information */ ulong32 size; /* capacity */ - } hdr[MAXID]; /* host drives */ + unchar ldr_no; /* log. drive no. */ + unchar rw_attribs; /* r/w attributes */ + ulong32 start_sec; /* start sector */ + } hdr[MAX_HDRIVES]; /* host drives */ struct { unchar lock; /* channel locked? (hot plug) */ - } raw[MAXBUS]; /* raw devices */ + unchar pdev_cnt; /* physical device count */ + unchar local_no; /* local channel number */ + unchar io_cnt[MAXID]; /* current IO count */ + ulong32 address; /* channel address */ + ulong32 id_list[MAXID]; /* IDs of the phys. devices */ + } raw[MAXBUS]; /* SCSI channels */ struct { Scsi_Cmnd *cmnd; /* pending request */ ushort service; /* service */ @@ -659,12 +879,15 @@ unchar bus_cnt; /* SCSI bus count */ unchar tid_cnt; /* Target ID count */ unchar bus_id[MAXBUS]; /* IOP IDs */ + unchar virt_bus; /* number of virtual bus */ + unchar more_proc; /* more /proc info supported */ ushort cmd_cnt; /* command count in DPRAM */ ushort cmd_len; /* length of actual command */ ushort cmd_offs_dpmem; /* actual offset in DPRAM */ ushort ic_all_size; /* sizeof DPRAM interf. area */ gdth_cpar_str cpar; /* controller cache par. */ - char ctr_name[16]; /* controller name */ + gdth_bfeat_str bfeat; /* controller features */ + gdth_binfo_str binfo; /* controller info */ #if LINUX_VERSION_CODE >= 0x02015F spinlock_t smp_lock; #endif diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/gdth_proc.c linux/drivers/scsi/gdth_proc.c --- v2.2.5/linux/drivers/scsi/gdth_proc.c Wed Jan 13 15:00:42 1999 +++ linux/drivers/scsi/gdth_proc.c Mon Apr 12 09:56:16 1999 @@ -1,5 +1,5 @@ /* gdth_proc.c - * $Id: gdth_proc.c,v 1.11 1998/12/17 15:52:35 achim Exp $ + * $Id: gdth_proc.c,v 1.13 1999/03/22 16:12:53 achim Exp $ */ #include "gdth_ioctl.h" @@ -68,7 +68,6 @@ static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Cmnd scp) { int orig_length, drive, wb_mode; - char cmnd[12]; int i, found; gdth_ha_str *ha; gdth_cmd_str gdtcmd; @@ -76,7 +75,6 @@ TRACE2(("gdth_set_asc_info() ha %d\n",hanum)); ha = HADATA(gdth_ctr_tab[hanum]); - memset(cmnd, 0,10); orig_length = length + 5; drive = -1; wb_mode = 0; @@ -107,18 +105,7 @@ gdtcmd.u.cache.DeviceNo = i; gdtcmd.u.cache.BlockNo = 1; gdtcmd.u.cache.sg_canz = 0; - { - struct semaphore sem = MUTEX_LOCKED; - scp.request.rq_status = RQ_SCSI_BUSY; - scp.request.sem = &sem; - scp.SCp.this_residual = IOCTL_PRI; - GDTH_LOCK_SCSI_DOCMD(); - scsi_do_cmd(&scp, cmnd, &gdtcmd, - sizeof(gdth_cmd_str), gdth_scsi_done, - 30*HZ, 1); - GDTH_UNLOCK_SCSI_DOCMD(); - down(&sem); - } + gdth_do_cmd(&scp, &gdtcmd, 30); } } if (!found) @@ -159,13 +146,9 @@ } if (wb_mode) { - pcpar = (gdth_cpar_str *)kmalloc( sizeof(gdth_cpar_str), - GFP_ATOMIC | GFP_DMA ); - if (pcpar == NULL) { - TRACE2(("gdth_set_info(): Unable to allocate memory.\n")); - printk("Unable to allocate memory.\n"); - return(-EINVAL); - } + if (!gdth_ioctl_alloc(hanum, sizeof(gdth_cpar_str))) + return(-EBUSY); + pcpar = (gdth_cpar_str *)ha->pscratch; memcpy( pcpar, &ha->cpar, sizeof(gdth_cpar_str) ); gdtcmd.BoardNode = LOCALBOARD; gdtcmd.Service = CACHESERVICE; @@ -175,18 +158,8 @@ gdtcmd.u.ioctl.subfunc = CACHE_CONFIG; gdtcmd.u.ioctl.channel = INVALID_CHANNEL; pcpar->write_back = wb_mode==1 ? 0:1; - { - struct semaphore sem = MUTEX_LOCKED; - scp.request.rq_status = RQ_SCSI_BUSY; - scp.request.sem = &sem; - scp.SCp.this_residual = IOCTL_PRI; - GDTH_LOCK_SCSI_DOCMD(); - scsi_do_cmd(&scp, cmnd, &gdtcmd, sizeof(gdth_cmd_str), - gdth_scsi_done, 30*HZ, 1); - GDTH_UNLOCK_SCSI_DOCMD(); - down(&sem); - } - kfree( pcpar ); + gdth_do_cmd(&scp, &gdtcmd, 30); + gdth_ioctl_free(hanum); printk("Done.\n"); return(orig_length); } @@ -197,21 +170,23 @@ static int gdth_set_bin_info(char *buffer,int length,int hanum,Scsi_Cmnd scp) { - char cmnd[12]; unchar i, j; gdth_ha_str *ha; gdth_iowr_str *piowr; gdth_iord_str *piord; gdth_cmd_str *pcmd; + gdth_evt_str *pevt; ulong32 *ppadd, add_size; + ulong32 *ppadd2, add_size2; ulong flags; TRACE2(("gdth_set_bin_info() ha %d\n",hanum)); ha = HADATA(gdth_ctr_tab[hanum]); - memset(cmnd, 0,10); piowr = (gdth_iowr_str *)buffer; piord = NULL; pcmd = NULL; + ppadd = ppadd2 = NULL; + add_size = add_size2 = 0; if (length < GDTOFFSOF(gdth_iowr_str,iu)) return(-EINVAL); @@ -238,6 +213,7 @@ } } else if (piowr->service == SCSIRAWSERVICE) { add_size = pcmd->u.raw.sdlen; + add_size2 = pcmd->u.raw.sense_len; if (ha->raw_feat & SCATTER_GATHER) { ppadd = &pcmd->u.raw.sg_lst[0].sg_ptr; pcmd->u.raw.sdata = 0xffffffff; @@ -247,32 +223,26 @@ ppadd = &pcmd->u.raw.sdata; pcmd->u.raw.sg_ranz = 0; } + ppadd2 = &pcmd->u.raw.sense_data; } else { return(-EINVAL); } - if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str) + add_size )) + if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str)+add_size+add_size2 )) return(-EBUSY); piord = (gdth_iord_str *)ha->pscratch; - piord->size = sizeof(gdth_iord_str) + add_size; + piord->size = sizeof(gdth_iord_str) + add_size + add_size2; if (add_size > 0) { memcpy(piord->iu.general.data, piowr->iu.general.data, add_size); *ppadd = virt_to_bus(piord->iu.general.data); } - /* do IOCTL */ - { - struct semaphore sem = MUTEX_LOCKED; - scp.request.rq_status = RQ_SCSI_BUSY; - scp.request.sem = &sem; - scp.SCp.this_residual = IOCTL_PRI; - GDTH_LOCK_SCSI_DOCMD(); - scsi_do_cmd(&scp, cmnd, pcmd, - sizeof(gdth_cmd_str), gdth_scsi_done, - piowr->timeout*HZ, 1); - GDTH_UNLOCK_SCSI_DOCMD(); - down(&sem); - piord->status = (ulong32)scp.SCp.Message; + if (add_size2 > 0) { + memcpy(piord->iu.general.data+add_size, piowr->iu.general.data, add_size2); + *ppadd2 = virt_to_bus(piord->iu.general.data+add_size); } + /* do IOCTL */ + gdth_do_cmd(&scp, pcmd, piowr->timeout); + piord->status = (ulong32)scp.SCp.Message; break; case GDTIOCTL_DRVERS: @@ -381,12 +351,21 @@ return(-EBUSY); piord = (gdth_iord_str *)ha->pscratch; if (piowr->iu.event.erase == 0xff) { - gdth_store_event(ha, - ((gdth_evt_str *)piowr->iu.event.evt)->event_source, - ((gdth_evt_str *)piowr->iu.event.evt)->event_idx, - &((gdth_evt_str *)piowr->iu.event.evt)->event_data); - if (((gdth_evt_str *)piowr->iu.event.evt)->event_source == ES_ASYNC) - gdth_log_event(&((gdth_evt_str *)piowr->iu.event.evt)->event_data); + pevt = (gdth_evt_str *)piowr->iu.event.evt; + if (pevt->event_source == ES_TEST) + pevt->event_data.size = sizeof(pevt->event_data.eu.test); + else if (pevt->event_source == ES_DRIVER) + pevt->event_data.size = sizeof(pevt->event_data.eu.driver); + else if (pevt->event_source == ES_SYNC) + pevt->event_data.size = sizeof(pevt->event_data.eu.sync); + else { + pevt->event_data.size = sizeof(pevt->event_data.eu.async); + gdth_log_event(&pevt->event_data, NULL); + } + GDTH_LOCK_HA(ha, flags); + gdth_store_event(ha, pevt->event_source, pevt->event_idx, + &pevt->event_data); + GDTH_UNLOCK_HA(ha, flags); } else if (piowr->iu.event.erase == 0xfe) { gdth_clear_events(); } else if (piowr->iu.event.erase == 0) { @@ -416,28 +395,98 @@ off_t begin = 0,pos = 0; gdth_ha_str *ha; gdth_iord_str *piord; - int id; + int id, i, j, k, sec, flag; + int no_mdrv = 0, drv_no, is_mirr; + ulong32 cnt; + + gdth_cmd_str gdtcmd; + gdth_evt_str estr; + Scsi_Cmnd scp; + Scsi_Device sdev; + char hrec[161]; + struct timeval tv; + + gdth_dskstat_str *pds; + gdth_diskinfo_str *pdi; + gdth_arrayinf_str *pai; + gdth_defcnt_str *pdef; + gdth_cdrinfo_str *pcdi; + gdth_hget_str *phg; TRACE2(("gdth_get_info() ha %d bus %d\n",hanum,busnum)); ha = HADATA(gdth_ctr_tab[hanum]); id = length; + memset(&sdev,0,sizeof(Scsi_Device)); + memset(&scp, 0,sizeof(Scsi_Cmnd)); + sdev.host = gdth_ctr_vtab[vh]; + sdev.id = sdev.host->this_id; + scp.cmd_len = 12; + scp.host = gdth_ctr_vtab[vh]; + scp.target = sdev.host->this_id; + scp.device = &sdev; + scp.use_sg = 0; + /* look for buffer ID in length */ if (id > 1) { -#if LINUX_VERSION_CODE >= 0x020000 + /* request is i.e. "cat /proc/scsi/gdth/0" */ + /* format: %-15s\t%-10s\t%-15s\t%s */ + /* driver parameters */ + size = sprintf(buffer+len,"Driver Parameters:\n"); + len += size; pos = begin + len; + if (reserve_list[0] == 0xff) + strcpy(hrec, "--"); + else { + sprintf(hrec, "%d", reserve_list[0]); + for (i = 1; i < MAX_RES_ARGS; i++) { + if (reserve_list[i] == 0xff) + break; + sprintf(hrec,"%s,%d", hrec, reserve_list[i]); + } + } size = sprintf(buffer+len, - "%s Disk Array Controller\n", - ha->ctr_name); -#else + " reserve_mode: \t%d \treserve_list: \t%s\n", + reserve_mode, hrec); + len += size; pos = begin + len; size = sprintf(buffer+len, - "%s Disk Array Controller (Bus %d)\n", - ha->ctr_name,busnum); + " max_ids: \t%-3d \thdr_channel: \t%d\n", + max_ids, hdr_channel); + len += size; pos = begin + len; + + if (pos < offset) { + len = 0; + begin = pos; + } + if (pos > offset + length) + goto stop_output; + + /* controller information */ + size = sprintf(buffer+len,"\nDisk Array Controller Information:\n"); + len += size; pos = begin + len; +#if LINUX_VERSION_CODE >= 0x020000 + strcpy(hrec, ha->binfo.type_string); +#else + sprintf(hrec, "%s (Bus %d)", ha->binfo.type_string, busnum); #endif + size = sprintf(buffer+len, + " Number: \t%d \tName: \t%s\n", + hanum, hrec); len += size; pos = begin + len; + + if (ha->more_proc) + sprintf(hrec, "%d.%02d.%02d-%c%03X", + (unchar)(ha->binfo.upd_fw_ver>>24), + (unchar)(ha->binfo.upd_fw_ver>>16), + (unchar)(ha->binfo.upd_fw_ver), + ha->bfeat.raid ? 'R':'N', + ha->binfo.upd_revision); + else + sprintf(hrec, "%d.%02d", (unchar)(ha->cpar.version>>8), + (unchar)(ha->cpar.version)); + size = sprintf(buffer+len, - "Firmware Version: %d.%2d\tDriver Version: %s\n", - (unchar)(ha->cpar.version>>8), - (unchar)(ha->cpar.version),GDTH_VERSION_STR); + " Driver Ver.: \t%-10s\tFirmware Ver.: \t%s\n", + GDTH_VERSION_STR, hrec); len += size; pos = begin + len; if (pos < offset) { @@ -447,7 +496,412 @@ if (pos > offset + length) goto stop_output; + if (ha->more_proc) { + /* more information: 1. about controller */ + size = sprintf(buffer+len, + " Serial No.: \t0x%8X\tCache RAM size:\t%d KB\n", + ha->binfo.ser_no, ha->binfo.memsize / 1024); + len += size; pos = begin + len; + + if (pos < offset) { + len = 0; + begin = pos; + } + if (pos > offset + length) + goto stop_output; + + /* 2. about physical devices */ + size = sprintf(buffer+len,"\nPhysical Devices:"); + len += size; pos = begin + len; + flag = FALSE; + + if (!gdth_ioctl_alloc(hanum, GDTH_SCRATCH)) + goto stop_output; + for (i = 0; i < ha->bus_cnt; ++i) { + /* 2.a statistics (and retries/reassigns) */ + TRACE2(("pdr_statistics() chn %d\n",i)); + pds = (gdth_dskstat_str *)(ha->pscratch + GDTH_SCRATCH/4); + gdtcmd.BoardNode = LOCALBOARD; + gdtcmd.Service = CACHESERVICE; + gdtcmd.OpCode = GDT_IOCTL; + gdtcmd.u.ioctl.p_param = virt_to_bus(pds); + gdtcmd.u.ioctl.param_size = 3*GDTH_SCRATCH/4; + gdtcmd.u.ioctl.subfunc = DSK_STATISTICS | L_CTRL_PATTERN; + gdtcmd.u.ioctl.channel = ha->raw[i].address | INVALID_CHANNEL; + pds->bid = ha->raw[i].local_no; + pds->first = 0; + pds->entries = ha->raw[i].pdev_cnt; + cnt = (3*GDTH_SCRATCH/4 - 5 * sizeof(ulong32)) / + sizeof(pds->list[0]); + if (pds->entries > cnt) + pds->entries = cnt; + gdth_do_cmd(&scp, &gdtcmd, 30); + if (scp.SCp.Message != S_OK) + pds->count = 0; + TRACE2(("pdr_statistics() entries %d status %d\n", + pds->count, scp.SCp.Message)); + + /* other IOCTLs must fit into area GDTH_SCRATCH/4 */ + for (j = 0; j < ha->raw[i].pdev_cnt; ++j) { + /* 2.b drive info */ + TRACE2(("scsi_drv_info() chn %d dev %d\n", + i, ha->raw[i].id_list[j])); + pdi = (gdth_diskinfo_str *)ha->pscratch; + gdtcmd.BoardNode = LOCALBOARD; + gdtcmd.Service = CACHESERVICE; + gdtcmd.OpCode = GDT_IOCTL; + gdtcmd.u.ioctl.p_param = virt_to_bus(pdi); + gdtcmd.u.ioctl.param_size = sizeof(gdth_diskinfo_str); + gdtcmd.u.ioctl.subfunc = SCSI_DR_INFO | L_CTRL_PATTERN; + gdtcmd.u.ioctl.channel = + ha->raw[i].address | ha->raw[i].id_list[j]; + gdth_do_cmd(&scp, &gdtcmd, 30); + if (scp.SCp.Message == S_OK) { + strncpy(hrec,pdi->vendor,8); + strncpy(hrec+8,pdi->product,16); + strncpy(hrec+24,pdi->revision,4); + hrec[28] = 0; + size = sprintf(buffer+len, + "\n Chn/ID/LUN: \t%c/%02d/%d \tName: \t%s\n", + 'A'+i,pdi->target_id,pdi->lun,hrec); + len += size; pos = begin + len; + flag = TRUE; + pdi->no_ldrive &= 0xffff; + if (pdi->no_ldrive == 0xffff) + strcpy(hrec,"--"); + else + sprintf(hrec,"%d",pdi->no_ldrive); + size = sprintf(buffer+len, + " Capacity [MB]:\t%-6d \tTo Log. Drive: \t%s\n", + pdi->blkcnt/(1024*1024/pdi->blksize), + hrec); + len += size; pos = begin + len; + } else { + pdi->devtype = 0xff; + } + + if (pdi->devtype == 0) { + /* search retries/reassigns */ + for (k = 0; k < pds->count; ++k) { + if (pds->list[k].tid == pdi->target_id && + pds->list[k].lun == pdi->lun) { + size = sprintf(buffer+len, + " Retries: \t%-6d \tReassigns: \t%d\n", + pds->list[k].retries, + pds->list[k].reassigns); + len += size; pos = begin + len; + break; + } + } + /* 2.c grown defects */ + TRACE2(("scsi_drv_defcnt() chn %d dev %d\n", + i, ha->raw[i].id_list[j])); + pdef = (gdth_defcnt_str *)ha->pscratch; + gdtcmd.BoardNode = LOCALBOARD; + gdtcmd.Service = CACHESERVICE; + gdtcmd.OpCode = GDT_IOCTL; + gdtcmd.u.ioctl.p_param = virt_to_bus(pdef); + gdtcmd.u.ioctl.param_size = sizeof(gdth_defcnt_str); + gdtcmd.u.ioctl.subfunc = SCSI_DEF_CNT | L_CTRL_PATTERN; + gdtcmd.u.ioctl.channel = + ha->raw[i].address | ha->raw[i].id_list[j]; + pdef->sddc_type = 0x08; + gdth_do_cmd(&scp, &gdtcmd, 30); + if (scp.SCp.Message == S_OK) { + size = sprintf(buffer+len, + " Grown Defects:\t%d\n", + pdef->sddc_cnt); + len += size; pos = begin + len; + } + } + } + } + gdth_ioctl_free(hanum); + + if (!flag) { + size = sprintf(buffer+len, "\n --\n"); + len += size; pos = begin + len; + } + if (pos < offset) { + len = 0; + begin = pos; + } + if (pos > offset + length) + goto stop_output; + + /* 3. about logical drives */ + size = sprintf(buffer+len,"\nLogical Drives:"); + len += size; pos = begin + len; + flag = FALSE; + + if (!gdth_ioctl_alloc(hanum, GDTH_SCRATCH)) + goto stop_output; + for (i = 0; i < MAX_HDRIVES; ++i) { + if (!ha->hdr[i].is_logdrv) + continue; + drv_no = i; + j = k = 0; + is_mirr = FALSE; + do { + /* 3.a log. drive info */ + TRACE2(("cache_drv_info() drive no %d\n",drv_no)); + pcdi = (gdth_cdrinfo_str *)ha->pscratch; + gdtcmd.BoardNode = LOCALBOARD; + gdtcmd.Service = CACHESERVICE; + gdtcmd.OpCode = GDT_IOCTL; + gdtcmd.u.ioctl.p_param = virt_to_bus(pcdi); + gdtcmd.u.ioctl.param_size = sizeof(gdth_cdrinfo_str); + gdtcmd.u.ioctl.subfunc = CACHE_DRV_INFO; + gdtcmd.u.ioctl.channel = drv_no; + gdth_do_cmd(&scp, &gdtcmd, 30); + if (scp.SCp.Message != S_OK) + break; + pcdi->ld_dtype >>= 16; + j++; + if (pcdi->ld_dtype > 2) { + strcpy(hrec, "missing"); + } else if (pcdi->ld_error & 1) { + strcpy(hrec, "fault"); + } else if (pcdi->ld_error & 2) { + strcpy(hrec, "invalid"); + k++; j--; + } else { + strcpy(hrec, "ok"); + } + + if (drv_no == i) { + size = sprintf(buffer+len, + "\n Number: \t%-2d \tStatus: \t%s\n", + drv_no, hrec); + len += size; pos = begin + len; + flag = TRUE; + no_mdrv = pcdi->cd_ldcnt; + if (no_mdrv > 1 || pcdi->ld_slave != -1) { + is_mirr = TRUE; + strcpy(hrec, "RAID-1"); + } else if (pcdi->ld_dtype == 0) { + strcpy(hrec, "Disk"); + } else if (pcdi->ld_dtype == 1) { + strcpy(hrec, "RAID-0"); + } else if (pcdi->ld_dtype == 2) { + strcpy(hrec, "Chain"); + } else { + strcpy(hrec, "???"); + } + size = sprintf(buffer+len, + " Capacity [MB]:\t%-6d \tType: \t%s\n", + pcdi->ld_blkcnt/(1024*1024/pcdi->ld_blksize), + hrec); + len += size; pos = begin + len; + } else { + size = sprintf(buffer+len, + " Slave Number: \t%-2d \tStatus: \t%s\n", + drv_no & 0x7fff, hrec); + len += size; pos = begin + len; + } + drv_no = pcdi->ld_slave; + } while (drv_no != -1); + + if (is_mirr) { + size = sprintf(buffer+len, + " Missing Drv.: \t%-2d \tInvalid Drv.: \t%d\n", + no_mdrv - j - k, k); + len += size; pos = begin + len; + } + + if (!ha->hdr[i].is_arraydrv) + strcpy(hrec, "--"); + else + sprintf(hrec, "%d", ha->hdr[i].master_no); + size = sprintf(buffer+len, + " To Array Drv.:\t%s\n", hrec); + len += size; pos = begin + len; + } + gdth_ioctl_free(hanum); + + if (!flag) { + size = sprintf(buffer+len, "\n --\n"); + len += size; pos = begin + len; + } + if (pos < offset) { + len = 0; + begin = pos; + } + if (pos > offset + length) + goto stop_output; + + /* 4. about array drives */ + size = sprintf(buffer+len,"\nArray Drives:"); + len += size; pos = begin + len; + flag = FALSE; + + if (!gdth_ioctl_alloc(hanum, GDTH_SCRATCH)) + goto stop_output; + for (i = 0; i < MAX_HDRIVES; ++i) { + if (!(ha->hdr[i].is_arraydrv && ha->hdr[i].is_master)) + continue; + /* 4.a array drive info */ + TRACE2(("array_info() drive no %d\n",i)); + pai = (gdth_arrayinf_str *)ha->pscratch; + gdtcmd.BoardNode = LOCALBOARD; + gdtcmd.Service = CACHESERVICE; + gdtcmd.OpCode = GDT_IOCTL; + gdtcmd.u.ioctl.p_param = virt_to_bus(pai); + gdtcmd.u.ioctl.param_size = sizeof(gdth_arrayinf_str); + gdtcmd.u.ioctl.subfunc = ARRAY_INFO | LA_CTRL_PATTERN; + gdtcmd.u.ioctl.channel = i; + gdth_do_cmd(&scp, &gdtcmd, 30); + if (scp.SCp.Message == S_OK) { + if (pai->ai_state == 0) + strcpy(hrec, "idle"); + else if (pai->ai_state == 2) + strcpy(hrec, "build"); + else if (pai->ai_state == 4) + strcpy(hrec, "ready"); + else if (pai->ai_state == 6) + strcpy(hrec, "fail"); + else if (pai->ai_state == 8 || pai->ai_state == 10) + strcpy(hrec, "rebuild"); + else + strcpy(hrec, "error"); + if (pai->ai_ext_state & 0x10) + strcat(hrec, "/expand"); + else if (pai->ai_ext_state & 0x1) + strcat(hrec, "/patch"); + size = sprintf(buffer+len, + "\n Number: \t%-2d \tStatus: \t%s\n", + i,hrec); + len += size; pos = begin + len; + flag = TRUE; + + if (pai->ai_type == 0) + strcpy(hrec, "RAID-0"); + else if (pai->ai_type == 4) + strcpy(hrec, "RAID-4"); + else if (pai->ai_type == 5) + strcpy(hrec, "RAID-5"); + else + strcpy(hrec, "RAID-10"); + size = sprintf(buffer+len, + " Capacity [MB]:\t%-6d \tType: \t%s\n", + pai->ai_size/(1024*1024/pai->ai_secsize), + hrec); + len += size; pos = begin + len; + } + } + gdth_ioctl_free(hanum); + + if (!flag) { + size = sprintf(buffer+len, "\n --\n"); + len += size; pos = begin + len; + } + if (pos < offset) { + len = 0; + begin = pos; + } + if (pos > offset + length) + goto stop_output; + + /* 5. about host drives */ + size = sprintf(buffer+len,"\nHost Drives:"); + len += size; pos = begin + len; + flag = FALSE; + + if (!gdth_ioctl_alloc(hanum, GDTH_SCRATCH)) + goto stop_output; + for (i = 0; i < MAX_HDRIVES; ++i) { + if (!ha->hdr[i].is_logdrv || + (ha->hdr[i].is_arraydrv && !ha->hdr[i].is_master)) + continue; + /* 5.a get host drive list */ + TRACE2(("host_get() drv_no %d\n",i)); + phg = (gdth_hget_str *)ha->pscratch; + gdtcmd.BoardNode = LOCALBOARD; + gdtcmd.Service = CACHESERVICE; + gdtcmd.OpCode = GDT_IOCTL; + gdtcmd.u.ioctl.p_param = virt_to_bus(phg); + gdtcmd.u.ioctl.param_size = sizeof(gdth_hget_str); + gdtcmd.u.ioctl.subfunc = HOST_GET | LA_CTRL_PATTERN; + gdtcmd.u.ioctl.channel = i; + phg->entries = MAX_HDRIVES; + phg->offset = GDTOFFSOF(gdth_hget_str, entry[0]); + gdth_do_cmd(&scp, &gdtcmd, 30); + if (scp.SCp.Message != S_OK) { + ha->hdr[i].ldr_no = i; + ha->hdr[i].rw_attribs = 0; + ha->hdr[i].start_sec = 0; + } else { + for (j = 0; j < phg->entries; ++j) { + k = phg->entry[j].host_drive; + if (k >= MAX_HDRIVES) + continue; + ha->hdr[k].ldr_no = phg->entry[j].log_drive; + ha->hdr[k].rw_attribs = phg->entry[j].rw_attribs; + ha->hdr[k].start_sec = phg->entry[j].start_sec; + } + } + TRACE2(("host_get entries %d status %d\n", + phg->entries, scp.SCp.Message)); + } + gdth_ioctl_free(hanum); + + for (i = 0; i < MAX_HDRIVES; ++i) { + if (!(ha->hdr[i].present)) + continue; + + size = sprintf(buffer+len, + "\n Number: \t%-2d \tArr/Log. Drive:\t%d\n", + i, ha->hdr[i].ldr_no); + len += size; pos = begin + len; + flag = TRUE; + + size = sprintf(buffer+len, + " Capacity [MB]:\t%-6d \tStart Sector: \t%d\n", + ha->hdr[i].size/2048, ha->hdr[i].start_sec); + len += size; pos = begin + len; + } + + if (!flag) { + size = sprintf(buffer+len, "\n --\n"); + len += size; pos = begin + len; + } + if (pos < offset) { + len = 0; + begin = pos; + } + if (pos > offset + length) + goto stop_output; + } + + /* controller events */ + size = sprintf(buffer+len,"\nController Events:\n"); + len += size; pos = begin + len; + + for (id = -1;;) { + id = gdth_read_event(ha, id, &estr); + if (estr.event_source == 0) + break; + if (estr.event_data.eu.driver.ionode == hanum && + estr.event_source == ES_ASYNC) { + gdth_log_event(&estr.event_data, hrec); + do_gettimeofday(&tv); + sec = (int)(tv.tv_sec - estr.first_stamp); + if (sec < 0) sec = 0; + size = sprintf(buffer+len," date- %02d:%02d:%02d\t%s\n", + sec/3600, sec%3600/60, sec%60, hrec); + len += size; pos = begin + len; + if (pos < offset) { + len = 0; + begin = pos; + } + if (pos > offset + length) + goto stop_output; + } + if (id == -1) + break; + } } else { + /* request from tool (GDTMON,..) */ piord = (gdth_iord_str *)ha->pscratch; if (piord == NULL) goto stop_output; @@ -474,6 +928,22 @@ return(len); } +static void gdth_do_cmd(Scsi_Cmnd *scp,gdth_cmd_str *gdtcmd,int timeout) +{ + char cmnd[12]; + struct semaphore sem = MUTEX_LOCKED; + + TRACE2(("gdth_do_cmd()\n")); + memset(cmnd, 0, 12); + scp->request.rq_status = RQ_SCSI_BUSY; + scp->request.sem = &sem; + scp->SCp.this_residual = IOCTL_PRI; + GDTH_LOCK_SCSI_DOCMD(); + scsi_do_cmd(scp, cmnd, gdtcmd, sizeof(gdth_cmd_str), + gdth_scsi_done, timeout*HZ, 1); + GDTH_UNLOCK_SCSI_DOCMD(); + down(&sem); +} void gdth_scsi_done(Scsi_Cmnd *scp) { @@ -492,7 +962,7 @@ int ret_val; if (size == 0 || size > GDTH_SCRATCH) - return -1; + return FALSE; ha = HADATA(gdth_ctr_tab[hanum]); GDTH_LOCK_HA(ha, flags); diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/gdth_proc.h linux/drivers/scsi/gdth_proc.h --- v2.2.5/linux/drivers/scsi/gdth_proc.h Wed Jan 13 15:00:42 1999 +++ linux/drivers/scsi/gdth_proc.h Mon Apr 12 09:56:16 1999 @@ -2,7 +2,7 @@ #define _GDTH_PROC_H /* gdth_proc.h - * $Id: gdth_proc.h,v 1.5 1998/12/17 15:43:53 achim Exp $ + * $Id: gdth_proc.h,v 1.6 1999/03/05 14:32:36 achim Exp $ */ static int gdth_set_info(char *buffer,int length,int vh,int hanum,int busnum); @@ -18,6 +18,7 @@ static void gdth_start_timeout(int hanum, int busnum, int id); static int gdth_update_timeout(int hanum, Scsi_Cmnd *scp, int timeout); +static void gdth_do_cmd(Scsi_Cmnd *scp,gdth_cmd_str *cmd,int timeout); void gdth_scsi_done(Scsi_Cmnd *scp); #endif diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/hosts.c linux/drivers/scsi/hosts.c --- v2.2.5/linux/drivers/scsi/hosts.c Wed Mar 10 15:29:47 1999 +++ linux/drivers/scsi/hosts.c Mon Apr 12 09:51:04 1999 @@ -195,6 +195,10 @@ #include "53c7,8xx.h" #endif +#ifdef CONFIG_SCSI_SYM53C8XX +#include "sym53c8xx.h" +#endif + #ifdef CONFIG_SCSI_NCR53C8XX #include "ncr53c8xx.h" #endif @@ -501,6 +505,9 @@ #endif #ifdef CONFIG_SCSI_NCR53C7xx NCR53c7xx, +#endif +#ifdef CONFIG_SCSI_SYM53C8XX + SYM53C8XX, #endif #ifdef CONFIG_SCSI_NCR53C8XX NCR53C8XX, diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/megaraid.c linux/drivers/scsi/megaraid.c --- v2.2.5/linux/drivers/scsi/megaraid.c Wed Mar 10 15:29:47 1999 +++ linux/drivers/scsi/megaraid.c Fri Apr 16 11:49:00 1999 @@ -114,7 +114,6 @@ #include #include #include /* for kmalloc() */ -#include /* for CONFIG_PCI */ #if LINUX_VERSION_CODE < 0x20100 #include #else @@ -884,7 +883,7 @@ spin_lock_irqsave(&mega_lock,flags); -#if !MULTI_IO +#ifndef CONFIG_MEGARAID_MULTI_IO if (megaCfg->flag & PENDING) { spin_unlock_irqrestore(&mega_lock,flags); return -1; diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/megaraid.h linux/drivers/scsi/megaraid.h --- v2.2.5/linux/drivers/scsi/megaraid.h Wed Mar 10 15:29:47 1999 +++ linux/drivers/scsi/megaraid.h Fri Apr 16 14:28:51 1999 @@ -5,9 +5,6 @@ #include #endif -#define MULTI_IO 0 /* change to 1 for fully parallel I/O to adapter */ - /* works on some systems, not on others yet */ - #define IN_ISR 0x80000000L #define NO_INTR 0x40000000L #define IN_TIMEOUT 0x20000000L diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/ncr53c8xx.c linux/drivers/scsi/ncr53c8xx.c --- v2.2.5/linux/drivers/scsi/ncr53c8xx.c Wed Mar 10 15:29:47 1999 +++ linux/drivers/scsi/ncr53c8xx.c Mon Apr 12 09:51:04 1999 @@ -73,7 +73,7 @@ */ /* -** March 6 1999, version 3.1h +** March 7 1999, version 3.2 ** ** Supported SCSI-II features: ** Synchronous negotiation @@ -98,6 +98,11 @@ ** Shared IRQ (since linux-1.3.72) */ +/* +** Name and version of the driver +*/ +#define SCSI_NCR_DRIVER_NAME "ncr53c8xx - version 3.2" + #define SCSI_NCR_DEBUG_FLAGS (0) /*========================================================== @@ -717,12 +722,12 @@ ** /proc directory entry and proc_info function */ -struct proc_dir_entry proc_scsi_ncr53c8xx = { +static struct proc_dir_entry proc_scsi_ncr53c8xx = { PROC_SCSI_NCR53C8XX, 9, "ncr53c8xx", S_IFDIR | S_IRUGO | S_IXUGO, 2 }; #ifdef SCSI_NCR_PROC_INFO_SUPPORT -int ncr53c8xx_proc_info(char *buffer, char **start, off_t offset, +static int ncr53c8xx_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int func); #endif @@ -732,6 +737,7 @@ ** This structure is initialized from linux config options. ** It can be overridden at boot-up by the boot command line. */ +#define SCSI_NCR_MAX_EXCLUDES 8 struct ncr_driver_setup { u_char master_parity; u_char scsi_parity; @@ -753,6 +759,9 @@ u_char diff_support; u_char irqm; u_char bus_check; + u_char optimize; + u_char recovery; + u_int excludes[SCSI_NCR_MAX_EXCLUDES]; char tag_ctrl[100]; }; @@ -4672,7 +4681,11 @@ if (request_irq(device->slot.irq, ncr53c8xx_intr, ((driver_setup.irqm & 0x10) ? 0 : SA_SHIRQ) | +#if LINUX_VERSION_CODE < LinuxVersionCode(2,2,0) ((driver_setup.irqm & 0x20) ? 0 : SA_INTERRUPT), +#else + 0, +#endif "ncr53c8xx", np)) { #ifdef __sparc__ printk(KERN_ERR "%s: request irq %s failure\n", @@ -4831,7 +4844,7 @@ ** **========================================================== */ -int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd) +static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd) { /* Scsi_Device *device = cmd->device; */ tcb_p tp = &np->target[cmd->target]; @@ -5395,7 +5408,7 @@ ** **========================================================== */ -int ncr_reset_bus (ncb_p np, Scsi_Cmnd *cmd, int sync_reset) +static int ncr_reset_bus (ncb_p np, Scsi_Cmnd *cmd, int sync_reset) { /* Scsi_Device *device = cmd->device; */ ccb_p cp; @@ -5965,7 +5978,7 @@ ** This CCB has been skipped by the NCR. ** Queue it in the correponding unit queue. */ -void ncr_ccb_skipped(ncb_p np, ccb_p cp) +static void ncr_ccb_skipped(ncb_p np, ccb_p cp) { tcb_p tp = &np->target[cp->target]; lcb_p lp = tp->lp[cp->lun]; @@ -9235,6 +9248,7 @@ int val; int base; int c; + int xi = 0; while (cur != NULL && (pc = strchr(cur, ':')) != NULL) { char *pe; @@ -9306,6 +9320,10 @@ else if (!strncmp(cur, "safe:", 5) && val) memcpy(&driver_setup, &driver_safe_setup, sizeof(driver_setup)); + else if (!strncmp(cur, "excl:", 5)) { + if (xi < SCSI_NCR_MAX_EXCLUDES) + driver_setup.excludes[xi++] = val; + } else printk("ncr53c8xx_setup: unexpected boot option '%.*s' ignored\n", (int)(pc-cur+1), cur); @@ -9684,6 +9702,14 @@ &latency_timer); /* + ** If user excludes this chip, donnot initialize it. + */ + for (i = 0 ; i < SCSI_NCR_MAX_EXCLUDES ; i++) { + if (driver_setup.excludes[i] == + (io_port & PCI_BASE_ADDRESS_IO_MASK)) + return -1; + } + /* * Check if the chip is supported */ chip = 0; @@ -10169,6 +10195,14 @@ } /* +** Linux entry point for info() function +*/ +const char *ncr53c8xx_info (struct Scsi_Host *host) +{ + return SCSI_NCR_DRIVER_NAME; +} + +/* ** Linux entry point of queuecommand() function */ @@ -10792,7 +10826,7 @@ ** - func = 1 means write (parse user control command) */ -int ncr53c8xx_proc_info(char *buffer, char **start, off_t offset, +static int ncr53c8xx_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int func) { struct Scsi_Host *host; diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/ncr53c8xx.h linux/drivers/scsi/ncr53c8xx.h --- v2.2.5/linux/drivers/scsi/ncr53c8xx.h Wed Mar 10 15:29:47 1999 +++ linux/drivers/scsi/ncr53c8xx.h Fri Apr 16 14:28:59 1999 @@ -42,214 +42,7 @@ #ifndef NCR53C8XX_H #define NCR53C8XX_H -/* -** Name and revision of the driver -*/ -#define SCSI_NCR_DRIVER_NAME "ncr53c8xx - revision 3.1h" - -/* -** Check supported Linux versions -*/ - -#if !defined(LINUX_VERSION_CODE) -#include -#endif -#include - -#define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s)) - -/* - * No more an option, enabled by default. - */ -#ifndef CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT -#define CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT -#endif - -/* -** These options are not tunable from 'make config' -*/ -#define SCSI_NCR_PROC_INFO_SUPPORT - -/* -** If you want a driver as small as possible, donnot define the -** following options. -*/ -#define SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT -#define SCSI_NCR_DEBUG_INFO_SUPPORT -#define SCSI_NCR_PCI_FIX_UP_SUPPORT -#ifdef SCSI_NCR_PROC_INFO_SUPPORT -# ifdef CONFIG_SCSI_NCR53C8XX_PROFILE -# define SCSI_NCR_PROFILE_SUPPORT -# endif -# define SCSI_NCR_USER_COMMAND_SUPPORT -# define SCSI_NCR_USER_INFO_SUPPORT -#endif - -/*========================================================== -** -** nvram settings - #define SCSI_NCR_NVRAM_SUPPORT to enable -** -**========================================================== -*/ - -#ifdef CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT -#define SCSI_NCR_NVRAM_SUPPORT -/* #define SCSI_NCR_DEBUG_NVRAM */ -#endif - -/* --------------------------------------------------------------------- -** Take into account kernel configured parameters. -** Most of these options can be overridden at startup by a command line. -** --------------------------------------------------------------------- -*/ - -/* - * For Ultra2 SCSI support option, use special features and allow 40Mhz - * synchronous data transfers. - */ -#define SCSI_NCR_SETUP_SPECIAL_FEATURES (3) -#define SCSI_NCR_SETUP_ULTRA_SCSI (2) -#define SCSI_NCR_MAX_SYNC (40) - -/* - * Allow tags from 2 to 64, default 8 - */ -#ifdef CONFIG_SCSI_NCR53C8XX_MAX_TAGS -#if CONFIG_SCSI_NCR53C8XX_MAX_TAGS < 2 -#define SCSI_NCR_MAX_TAGS (2) -#elif CONFIG_SCSI_NCR53C8XX_MAX_TAGS > 64 -#define SCSI_NCR_MAX_TAGS (64) -#else -#define SCSI_NCR_MAX_TAGS CONFIG_SCSI_NCR53C8XX_MAX_TAGS -#endif -#else -#define SCSI_NCR_MAX_TAGS (8) -#endif - -/* - * Allow tagged command queuing support if configured with default number - * of tags set to max (see above). - */ -#ifdef CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS -#define SCSI_NCR_SETUP_DEFAULT_TAGS CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS -#elif defined CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE -#define SCSI_NCR_SETUP_DEFAULT_TAGS SCSI_NCR_MAX_TAGS -#else -#define SCSI_NCR_SETUP_DEFAULT_TAGS (0) -#endif - -/* - * Use normal IO if configured. Forced for alpha and ppc. - */ -#if defined(CONFIG_SCSI_NCR53C8XX_IOMAPPED) -#define SCSI_NCR_IOMAPPED -#elif defined(__alpha__) || defined(__powerpc__) -#define SCSI_NCR_IOMAPPED -#elif defined(__sparc__) -#undef SCSI_NCR_IOMAPPED -#endif - -/* - * Sync transfer frequency at startup. - * Allow from 5Mhz to 40Mhz default 20 Mhz. - */ -#ifndef CONFIG_SCSI_NCR53C8XX_SYNC -#define CONFIG_SCSI_NCR53C8XX_SYNC (20) -#elif CONFIG_SCSI_NCR53C8XX_SYNC > SCSI_NCR_MAX_SYNC -#undef CONFIG_SCSI_NCR53C8XX_SYNC -#define CONFIG_SCSI_NCR53C8XX_SYNC SCSI_NCR_MAX_SYNC -#endif - -#if CONFIG_SCSI_NCR53C8XX_SYNC == 0 -#define SCSI_NCR_SETUP_DEFAULT_SYNC (255) -#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 5 -#define SCSI_NCR_SETUP_DEFAULT_SYNC (50) -#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 20 -#define SCSI_NCR_SETUP_DEFAULT_SYNC (250/(CONFIG_SCSI_NCR53C8XX_SYNC)) -#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 33 -#define SCSI_NCR_SETUP_DEFAULT_SYNC (11) -#else -#define SCSI_NCR_SETUP_DEFAULT_SYNC (10) -#endif - -/* - * Disallow disconnections at boot-up - */ -#ifdef CONFIG_SCSI_NCR53C8XX_NO_DISCONNECT -#define SCSI_NCR_SETUP_DISCONNECTION (0) -#else -#define SCSI_NCR_SETUP_DISCONNECTION (1) -#endif - -/* - * Force synchronous negotiation for all targets - */ -#ifdef CONFIG_SCSI_NCR53C8XX_FORCE_SYNC_NEGO -#define SCSI_NCR_SETUP_FORCE_SYNC_NEGO (1) -#else -#define SCSI_NCR_SETUP_FORCE_SYNC_NEGO (0) -#endif - -/* - * Disable master parity checking (flawed hardwares need that) - */ -#ifdef CONFIG_SCSI_NCR53C8XX_DISABLE_MPARITY_CHECK -#define SCSI_NCR_SETUP_MASTER_PARITY (0) -#else -#define SCSI_NCR_SETUP_MASTER_PARITY (1) -#endif - -/* - * Disable scsi parity checking (flawed devices may need that) - */ -#ifdef CONFIG_SCSI_NCR53C8XX_DISABLE_PARITY_CHECK -#define SCSI_NCR_SETUP_SCSI_PARITY (0) -#else -#define SCSI_NCR_SETUP_SCSI_PARITY (1) -#endif - -/* - * Vendor specific stuff - */ -#ifdef CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT -#define SCSI_NCR_SETUP_LED_PIN (1) -#define SCSI_NCR_SETUP_DIFF_SUPPORT (3) -#else -#define SCSI_NCR_SETUP_LED_PIN (0) -#define SCSI_NCR_SETUP_DIFF_SUPPORT (0) -#endif - -/* - * Settle time after reset at boot-up - */ -#define SCSI_NCR_SETUP_SETTLE_TIME (2) - -/* -** Other parameters not configurable with "make config" -** Avoid to change these constants, unless you know what you are doing. -*/ - -#define SCSI_NCR_ALWAYS_SIMPLE_TAG -#define SCSI_NCR_MAX_SCATTER (127) -#define SCSI_NCR_MAX_TARGET (16) - -/* No need to use a too large adapter queue */ -#if SCSI_NCR_MAX_TAGS <= 32 -#define SCSI_NCR_CAN_QUEUE (7*SCSI_NCR_MAX_TAGS) -#else -#define SCSI_NCR_CAN_QUEUE (250) -#endif - -#define SCSI_NCR_CMD_PER_LUN (SCSI_NCR_MAX_TAGS) -#define SCSI_NCR_SG_TABLESIZE (SCSI_NCR_MAX_SCATTER) - -#define SCSI_NCR_TIMER_INTERVAL (HZ) - -#if 1 /* defined CONFIG_SCSI_MULTI_LUN */ -#define SCSI_NCR_MAX_LUN (8) -#else -#define SCSI_NCR_MAX_LUN (1) -#endif +#include "sym53c8xx_defs.h" /* ** Define Scsi_Host_Template parameters @@ -263,6 +56,7 @@ int ncr53c8xx_abort(Scsi_Cmnd *); int ncr53c8xx_detect(Scsi_Host_Template *tpnt); +const char *ncr53c8xx_info(struct Scsi_Host *host); int ncr53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); int ncr53c8xx_reset(Scsi_Cmnd *, unsigned int); @@ -272,11 +66,13 @@ #define ncr53c8xx_release NULL #endif + #if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,75) -#define NCR53C8XX { name: SCSI_NCR_DRIVER_NAME, \ +#define NCR53C8XX { name: "", \ detect: ncr53c8xx_detect, \ release: ncr53c8xx_release, \ + info: ncr53c8xx_info, \ queuecommand: ncr53c8xx_queue_command,\ abort: ncr53c8xx_abort, \ reset: ncr53c8xx_reset, \ @@ -290,8 +86,8 @@ #else #define NCR53C8XX { NULL, NULL, NULL, NULL, \ - SCSI_NCR_DRIVER_NAME, ncr53c8xx_detect, \ - ncr53c8xx_release, NULL, NULL, \ + NULL, ncr53c8xx_detect, \ + ncr53c8xx_release, ncr53c8xx_info, NULL, \ ncr53c8xx_queue_command,ncr53c8xx_abort, \ ncr53c8xx_reset, NULL, scsicam_bios_param, \ SCSI_NCR_CAN_QUEUE, 7, \ @@ -302,867 +98,4 @@ #endif /* defined(HOSTS_C) || defined(MODULE) */ -#ifndef HOSTS_C - -/* -** IO functions definition for big/little endian support. -** For now, the NCR is only supported in little endian addressing mode, -** and big endian byte ordering is only supported for the PPC. -** MMIO is not used on PPC. -*/ - -#ifdef __BIG_ENDIAN - -#if LINUX_VERSION_CODE < LinuxVersionCode(2,1,0) -#error "BIG ENDIAN byte ordering needs kernel version >= 2.1.0" -#endif - -#if defined(__powerpc__) -#define inw_l2b inw -#define inl_l2b inl -#define outw_b2l outw -#define outl_b2l outl -#elif defined(__sparc__) -#define readw_l2b readw -#define readl_l2b readl -#define writew_b2l writew -#define writel_b2l writel -#else -#error "Support for BIG ENDIAN is only available for PowerPC and SPARC" -#endif - -#else /* Assumed x86 or alpha */ - -#define inw_raw inw -#define inl_raw inl -#define outw_raw outw -#define outl_raw outl -#define readw_raw readw -#define readl_raw readl -#define writew_raw writew -#define writel_raw writel - -#endif - -#ifdef SCSI_NCR_BIG_ENDIAN -#error "The NCR in BIG ENDIAN addressing mode is not (yet) supported" -#endif - -/* -** NCR53C8XX Device Ids -*/ - -#ifndef PCI_DEVICE_ID_NCR_53C810 -#define PCI_DEVICE_ID_NCR_53C810 1 -#endif - -#ifndef PCI_DEVICE_ID_NCR_53C810AP -#define PCI_DEVICE_ID_NCR_53C810AP 5 -#endif - -#ifndef PCI_DEVICE_ID_NCR_53C815 -#define PCI_DEVICE_ID_NCR_53C815 4 -#endif - -#ifndef PCI_DEVICE_ID_NCR_53C820 -#define PCI_DEVICE_ID_NCR_53C820 2 -#endif - -#ifndef PCI_DEVICE_ID_NCR_53C825 -#define PCI_DEVICE_ID_NCR_53C825 3 -#endif - -#ifndef PCI_DEVICE_ID_NCR_53C860 -#define PCI_DEVICE_ID_NCR_53C860 6 -#endif - -#ifndef PCI_DEVICE_ID_NCR_53C875 -#define PCI_DEVICE_ID_NCR_53C875 0xf -#endif - -#ifndef PCI_DEVICE_ID_NCR_53C875J -#define PCI_DEVICE_ID_NCR_53C875J 0x8f -#endif - -#ifndef PCI_DEVICE_ID_NCR_53C885 -#define PCI_DEVICE_ID_NCR_53C885 0xd -#endif - -#ifndef PCI_DEVICE_ID_NCR_53C895 -#define PCI_DEVICE_ID_NCR_53C895 0xc -#endif - -#ifndef PCI_DEVICE_ID_NCR_53C896 -#define PCI_DEVICE_ID_NCR_53C896 0xb -#endif - -/* -** NCR53C8XX devices features table. -*/ -typedef struct { - unsigned short device_id; - unsigned short revision_id; - char *name; - unsigned char burst_max; - unsigned char offset_max; - unsigned char nr_divisor; - unsigned int features; -#define FE_LED0 (1<<0) -#define FE_WIDE (1<<1) -#define FE_ULTRA (1<<2) -#define FE_ULTRA2 (1<<3) -#define FE_DBLR (1<<4) -#define FE_QUAD (1<<5) -#define FE_ERL (1<<6) -#define FE_CLSE (1<<7) -#define FE_WRIE (1<<8) -#define FE_ERMP (1<<9) -#define FE_BOF (1<<10) -#define FE_DFS (1<<11) -#define FE_PFEN (1<<12) -#define FE_LDSTR (1<<13) -#define FE_RAM (1<<14) -#define FE_CLK80 (1<<15) -#define FE_RAM8K (1<<16) -#define FE_64BIT (1<<17) -#define FE_IO256 (1<<18) -#define FE_NOPM (1<<19) -#define FE_CACHE_SET (FE_ERL|FE_CLSE|FE_WRIE|FE_ERMP) -#define FE_SCSI_SET (FE_WIDE|FE_ULTRA|FE_ULTRA2|FE_DBLR|FE_QUAD|F_CLK80) -#define FE_SPECIAL_SET (FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM) -} ncr_chip; - -/* -** DEL 397 - 53C875 Rev 3 - Part Number 609-0392410 - ITEM 3. -** Memory Read transaction terminated by a retry followed by -** Memory Read Line command. -*/ -#define FE_CACHE0_SET (FE_CACHE_SET & ~FE_ERL) - -/* -** DEL 397 - 53C875 Rev 3 - Part Number 609-0392410 - ITEM 5. -** On paper, this errata is harmless. But it is a good reason for -** using a shorter programmed burst length (64 DWORDS instead of 128). -*/ - -#define SCSI_NCR_CHIP_TABLE \ -{ \ - {PCI_DEVICE_ID_NCR_53C810, 0x0f, "810", 4, 8, 4, \ - FE_ERL} \ - , \ - {PCI_DEVICE_ID_NCR_53C810, 0xff, "810a", 4, 8, 4, \ - FE_CACHE_SET|FE_LDSTR|FE_PFEN|FE_BOF} \ - , \ - {PCI_DEVICE_ID_NCR_53C815, 0xff, "815", 4, 8, 4, \ - FE_ERL|FE_BOF} \ - , \ - {PCI_DEVICE_ID_NCR_53C820, 0xff, "820", 4, 8, 4, \ - FE_WIDE|FE_ERL} \ - , \ - {PCI_DEVICE_ID_NCR_53C825, 0x0f, "825", 4, 8, 4, \ - FE_WIDE|FE_ERL|FE_BOF} \ - , \ - {PCI_DEVICE_ID_NCR_53C825, 0xff, "825a", 6, 8, 4, \ - FE_WIDE|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM} \ - , \ - {PCI_DEVICE_ID_NCR_53C860, 0xff, "860", 4, 8, 5, \ - FE_ULTRA|FE_CLK80|FE_CACHE_SET|FE_BOF|FE_LDSTR|FE_PFEN} \ - , \ - {PCI_DEVICE_ID_NCR_53C875, 0x01, "875", 6, 16, 5, \ - FE_WIDE|FE_ULTRA|FE_CLK80|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ - , \ - {PCI_DEVICE_ID_NCR_53C875, 0x0f, "875", 6, 16, 5, \ - FE_WIDE|FE_ULTRA|FE_DBLR|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ - , \ - {PCI_DEVICE_ID_NCR_53C875, 0xff, "876", 6, 16, 5, \ - FE_WIDE|FE_ULTRA|FE_DBLR|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ - , \ - {PCI_DEVICE_ID_NCR_53C875J,0xff, "875J", 6, 16, 5, \ - FE_WIDE|FE_ULTRA|FE_DBLR|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ - , \ - {PCI_DEVICE_ID_NCR_53C885, 0xff, "885", 6, 16, 5, \ - FE_WIDE|FE_ULTRA|FE_DBLR|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ - , \ - {PCI_DEVICE_ID_NCR_53C895, 0xff, "895", 7, 31, 7, \ - FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ - , \ - {PCI_DEVICE_ID_NCR_53C896, 0xff, "896", 7, 31, 7, \ - FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM|\ - FE_RAM8K|FE_64BIT|FE_IO256|FE_NOPM}\ -} - -/* - * List of supported NCR chip ids - */ -#define SCSI_NCR_CHIP_IDS \ -{ \ - PCI_DEVICE_ID_NCR_53C810, \ - PCI_DEVICE_ID_NCR_53C815, \ - PCI_DEVICE_ID_NCR_53C820, \ - PCI_DEVICE_ID_NCR_53C825, \ - PCI_DEVICE_ID_NCR_53C860, \ - PCI_DEVICE_ID_NCR_53C875, \ - PCI_DEVICE_ID_NCR_53C875J, \ - PCI_DEVICE_ID_NCR_53C885, \ - PCI_DEVICE_ID_NCR_53C895, \ - PCI_DEVICE_ID_NCR_53C896 \ -} - -/* -** Initial setup. -** Can be overriden at startup by a command line. -*/ -#define SCSI_NCR_DRIVER_SETUP \ -{ \ - SCSI_NCR_SETUP_MASTER_PARITY, \ - SCSI_NCR_SETUP_SCSI_PARITY, \ - SCSI_NCR_SETUP_DISCONNECTION, \ - SCSI_NCR_SETUP_SPECIAL_FEATURES, \ - SCSI_NCR_SETUP_ULTRA_SCSI, \ - SCSI_NCR_SETUP_FORCE_SYNC_NEGO, \ - 0, \ - 0, \ - 1, \ - 1, \ - SCSI_NCR_SETUP_DEFAULT_TAGS, \ - SCSI_NCR_SETUP_DEFAULT_SYNC, \ - 0x00, \ - 7, \ - SCSI_NCR_SETUP_LED_PIN, \ - 1, \ - SCSI_NCR_SETUP_SETTLE_TIME, \ - SCSI_NCR_SETUP_DIFF_SUPPORT, \ - 0, \ - 1 \ -} - -/* -** Boot fail safe setup. -** Override initial setup from boot command line: -** ncr53c8xx=safe:y -*/ -#define SCSI_NCR_DRIVER_SAFE_SETUP \ -{ \ - 0, \ - 1, \ - 0, \ - 0, \ - 0, \ - 0, \ - 0, \ - 0, \ - 1, \ - 2, \ - 0, \ - 255, \ - 0x00, \ - 255, \ - 0, \ - 0, \ - 10, \ - 1, \ - 1, \ - 1 \ -} - -/**************** ORIGINAL CONTENT of ncrreg.h from FreeBSD ******************/ - -/*----------------------------------------------------------------- -** -** The ncr 53c810 register structure. -** -**----------------------------------------------------------------- -*/ - -struct ncr_reg { -/*00*/ u_char nc_scntl0; /* full arb., ena parity, par->ATN */ - -/*01*/ u_char nc_scntl1; /* no reset */ - #define ISCON 0x10 /* connected to scsi */ - #define CRST 0x08 /* force reset */ - -/*02*/ u_char nc_scntl2; /* no disconnect expected */ - #define SDU 0x80 /* cmd: disconnect will raise error */ - #define CHM 0x40 /* sta: chained mode */ - #define WSS 0x08 /* sta: wide scsi send [W]*/ - #define WSR 0x01 /* sta: wide scsi received [W]*/ - -/*03*/ u_char nc_scntl3; /* cnf system clock dependent */ - #define EWS 0x08 /* cmd: enable wide scsi [W]*/ - #define ULTRA 0x80 /* cmd: ULTRA enable */ - -/*04*/ u_char nc_scid; /* cnf host adapter scsi address */ - #define RRE 0x40 /* r/w:e enable response to resel. */ - #define SRE 0x20 /* r/w:e enable response to select */ - -/*05*/ u_char nc_sxfer; /* ### Sync speed and count */ - -/*06*/ u_char nc_sdid; /* ### Destination-ID */ - -/*07*/ u_char nc_gpreg; /* ??? IO-Pins */ - -/*08*/ u_char nc_sfbr; /* ### First byte in phase */ - -/*09*/ u_char nc_socl; - #define CREQ 0x80 /* r/w: SCSI-REQ */ - #define CACK 0x40 /* r/w: SCSI-ACK */ - #define CBSY 0x20 /* r/w: SCSI-BSY */ - #define CSEL 0x10 /* r/w: SCSI-SEL */ - #define CATN 0x08 /* r/w: SCSI-ATN */ - #define CMSG 0x04 /* r/w: SCSI-MSG */ - #define CC_D 0x02 /* r/w: SCSI-C_D */ - #define CI_O 0x01 /* r/w: SCSI-I_O */ - -/*0a*/ u_char nc_ssid; - -/*0b*/ u_char nc_sbcl; - -/*0c*/ u_char nc_dstat; - #define DFE 0x80 /* sta: dma fifo empty */ - #define MDPE 0x40 /* int: master data parity error */ - #define BF 0x20 /* int: script: bus fault */ - #define ABRT 0x10 /* int: script: command aborted */ - #define SSI 0x08 /* int: script: single step */ - #define SIR 0x04 /* int: script: interrupt instruct. */ - #define IID 0x01 /* int: script: illegal instruct. */ - -/*0d*/ u_char nc_sstat0; - #define ILF 0x80 /* sta: data in SIDL register lsb */ - #define ORF 0x40 /* sta: data in SODR register lsb */ - #define OLF 0x20 /* sta: data in SODL register lsb */ - #define AIP 0x10 /* sta: arbitration in progress */ - #define LOA 0x08 /* sta: arbitration lost */ - #define WOA 0x04 /* sta: arbitration won */ - #define IRST 0x02 /* sta: scsi reset signal */ - #define SDP 0x01 /* sta: scsi parity signal */ - -/*0e*/ u_char nc_sstat1; - #define FF3210 0xf0 /* sta: bytes in the scsi fifo */ - -/*0f*/ u_char nc_sstat2; - #define ILF1 0x80 /* sta: data in SIDL register msb[W]*/ - #define ORF1 0x40 /* sta: data in SODR register msb[W]*/ - #define OLF1 0x20 /* sta: data in SODL register msb[W]*/ - #define DM 0x04 /* sta: DIFFSENS mismatch (895/6 only) */ - #define LDSC 0x02 /* sta: disconnect & reconnect */ - -/*10*/ u_int32 nc_dsa; /* --> Base page */ - -/*14*/ u_char nc_istat; /* --> Main Command and status */ - #define CABRT 0x80 /* cmd: abort current operation */ - #define SRST 0x40 /* mod: reset chip */ - #define SIGP 0x20 /* r/w: message from host to ncr */ - #define SEM 0x10 /* r/w: message between host + ncr */ - #define CON 0x08 /* sta: connected to scsi */ - #define INTF 0x04 /* sta: int on the fly (reset by wr)*/ - #define SIP 0x02 /* sta: scsi-interrupt */ - #define DIP 0x01 /* sta: host/script interrupt */ - -/*15*/ u_char nc_15_; -/*16*/ u_char nc_16_; -/*17*/ u_char nc_17_; - -/*18*/ u_char nc_ctest0; -/*19*/ u_char nc_ctest1; - -/*1a*/ u_char nc_ctest2; - #define CSIGP 0x40 - -/*1b*/ u_char nc_ctest3; - #define FLF 0x08 /* cmd: flush dma fifo */ - #define CLF 0x04 /* cmd: clear dma fifo */ - #define FM 0x02 /* mod: fetch pin mode */ - #define WRIE 0x01 /* mod: write and invalidate enable */ - -/*1c*/ u_int32 nc_temp; /* ### Temporary stack */ - -/*20*/ u_char nc_dfifo; -/*21*/ u_char nc_ctest4; - #define BDIS 0x80 /* mod: burst disable */ - #define MPEE 0x08 /* mod: master parity error enable */ - -/*22*/ u_char nc_ctest5; - #define DFS 0x20 /* mod: dma fifo size */ -/*23*/ u_char nc_ctest6; - -/*24*/ u_int32 nc_dbc; /* ### Byte count and command */ -/*28*/ u_int32 nc_dnad; /* ### Next command register */ -/*2c*/ u_int32 nc_dsp; /* --> Script Pointer */ -/*30*/ u_int32 nc_dsps; /* --> Script pointer save/opcode#2 */ - -/*34*/ u_char nc_scratcha; /* Temporary register a */ -/*35*/ u_char nc_scratcha1; -/*36*/ u_char nc_scratcha2; -/*37*/ u_char nc_scratcha3; - -/*38*/ u_char nc_dmode; - #define BL_2 0x80 /* mod: burst length shift value +2 */ - #define BL_1 0x40 /* mod: burst length shift value +1 */ - #define ERL 0x08 /* mod: enable read line */ - #define ERMP 0x04 /* mod: enable read multiple */ - #define BOF 0x02 /* mod: burst op code fetch */ - -/*39*/ u_char nc_dien; -/*3a*/ u_char nc_dwt; - -/*3b*/ u_char nc_dcntl; /* --> Script execution control */ - - #define CLSE 0x80 /* mod: cache line size enable */ - #define PFF 0x40 /* cmd: pre-fetch flush */ - #define PFEN 0x20 /* mod: pre-fetch enable */ - #define SSM 0x10 /* mod: single step mode */ - #define IRQM 0x08 /* mod: irq mode (1 = totem pole !) */ - #define STD 0x04 /* cmd: start dma mode */ - #define IRQD 0x02 /* mod: irq disable */ - #define NOCOM 0x01 /* cmd: protect sfbr while reselect */ - -/*3c*/ u_int32 nc_adder; - -/*40*/ u_short nc_sien; /* -->: interrupt enable */ -/*42*/ u_short nc_sist; /* <--: interrupt status */ - #define SBMC 0x1000/* sta: SCSI Bus Mode Change (895/6 only) */ - #define STO 0x0400/* sta: timeout (select) */ - #define GEN 0x0200/* sta: timeout (general) */ - #define HTH 0x0100/* sta: timeout (handshake) */ - #define MA 0x80 /* sta: phase mismatch */ - #define CMP 0x40 /* sta: arbitration complete */ - #define SEL 0x20 /* sta: selected by another device */ - #define RSL 0x10 /* sta: reselected by another device*/ - #define SGE 0x08 /* sta: gross error (over/underflow)*/ - #define UDC 0x04 /* sta: unexpected disconnect */ - #define RST 0x02 /* sta: scsi bus reset detected */ - #define PAR 0x01 /* sta: scsi parity error */ - -/*44*/ u_char nc_slpar; -/*45*/ u_char nc_swide; -/*46*/ u_char nc_macntl; -/*47*/ u_char nc_gpcntl; -/*48*/ u_char nc_stime0; /* cmd: timeout for select&handshake*/ -/*49*/ u_char nc_stime1; /* cmd: timeout user defined */ -/*4a*/ u_short nc_respid; /* sta: Reselect-IDs */ - -/*4c*/ u_char nc_stest0; - -/*4d*/ u_char nc_stest1; - #define DBLEN 0x08 /* clock doubler running */ - #define DBLSEL 0x04 /* clock doubler selected */ - - -/*4e*/ u_char nc_stest2; - #define ROF 0x40 /* reset scsi offset (after gross error!) */ - #define EXT 0x02 /* extended filtering */ - -/*4f*/ u_char nc_stest3; - #define TE 0x80 /* c: tolerAnt enable */ - #define HSC 0x20 /* c: Halt SCSI Clock */ - #define CSF 0x02 /* c: clear scsi fifo */ - -/*50*/ u_short nc_sidl; /* Lowlevel: latched from scsi data */ -/*52*/ u_char nc_stest4; - #define SMODE 0xc0 /* SCSI bus mode (895/6 only) */ - #define SMODE_HVD 0x40 /* High Voltage Differential */ - #define SMODE_SE 0x80 /* Single Ended */ - #define SMODE_LVD 0xc0 /* Low Voltage Differential */ - #define LCKFRQ 0x20 /* Frequency Lock (895/6 only) */ - -/*53*/ u_char nc_53_; -/*54*/ u_short nc_sodl; /* Lowlevel: data out to scsi data */ -/*56*/ u_char nc_ccntl0; /* Chip Control 0 (896) */ - #define ENPMJ 0x80 /* Enable Phase Mismatch Jump */ - #define PMJCTL 0x40 /* Phase Mismatch Jump Control */ - #define ENNDJ 0x20 /* Enable Non Data PM Jump */ - #define DISFC 0x10 /* Disable Auto FIFO Clear */ - #define DILS 0x02 /* Disable Internal Load/Store */ - #define DPR 0x01 /* Disable Pipe Req */ - -/*57*/ u_char nc_ccntl1; /* Chip Control 1 (896) */ - #define ZMOD 0x80 /* High Impedance Mode */ - #define DDAC 0x08 /* Disable Dual Address Cycle */ - #define XTIMOD 0x04 /* 64-bit Table Ind. Indexing Mode */ - #define EXTIBMV 0x02 /* Enable 64-bit Table Ind. BMOV */ - #define EXDBMV 0x01 /* Enable 64-bit Direct BMOV */ -/*58*/ u_short nc_sbdl; /* Lowlevel: data from scsi data */ -/*5a*/ u_short nc_5a_; -/*5c*/ u_char nc_scr0; /* Working register B */ -/*5d*/ u_char nc_scr1; /* */ -/*5e*/ u_char nc_scr2; /* */ -/*5f*/ u_char nc_scr3; /* */ -/*60*/ -}; - -/*----------------------------------------------------------- -** -** Utility macros for the script. -** -**----------------------------------------------------------- -*/ - -#define REGJ(p,r) (offsetof(struct ncr_reg, p ## r)) -#define REG(r) REGJ (nc_, r) - -#ifndef TARGET_MODE -#define TARGET_MODE 0 -#endif - -typedef u_int32 ncrcmd; - -/*----------------------------------------------------------- -** -** SCSI phases -** -**----------------------------------------------------------- -*/ - -#define SCR_DATA_OUT 0x00000000 -#define SCR_DATA_IN 0x01000000 -#define SCR_COMMAND 0x02000000 -#define SCR_STATUS 0x03000000 -#define SCR_ILG_OUT 0x04000000 -#define SCR_ILG_IN 0x05000000 -#define SCR_MSG_OUT 0x06000000 -#define SCR_MSG_IN 0x07000000 - -/*----------------------------------------------------------- -** -** Data transfer via SCSI. -** -**----------------------------------------------------------- -** -** MOVE_ABS (LEN) -** <> -** -** MOVE_IND (LEN) -** <> -** -** MOVE_TBL -** <> -** -**----------------------------------------------------------- -*/ - -#define SCR_MOVE_ABS(l) ((0x08000000 ^ (TARGET_MODE << 1ul)) | (l)) -#define SCR_MOVE_IND(l) ((0x28000000 ^ (TARGET_MODE << 1ul)) | (l)) -#define SCR_MOVE_TBL (0x18000000 ^ (TARGET_MODE << 1ul)) - -struct scr_tblmove { - u_int32 size; - u_int32 addr; -}; - -/*----------------------------------------------------------- -** -** Selection -** -**----------------------------------------------------------- -** -** SEL_ABS | SCR_ID (0..7) [ | REL_JMP] -** <> -** -** SEL_TBL | << dnad_offset>> [ | REL_JMP] -** <> -** -**----------------------------------------------------------- -*/ - -#define SCR_SEL_ABS 0x40000000 -#define SCR_SEL_ABS_ATN 0x41000000 -#define SCR_SEL_TBL 0x42000000 -#define SCR_SEL_TBL_ATN 0x43000000 - -struct scr_tblsel { - u_char sel_0; - u_char sel_sxfer; - u_char sel_id; - u_char sel_scntl3; -}; - -#define SCR_JMP_REL 0x04000000 -#define SCR_ID(id) (((u_int32)(id)) << 16) - -/*----------------------------------------------------------- -** -** Waiting for Disconnect or Reselect -** -**----------------------------------------------------------- -** -** WAIT_DISC -** dummy: <> -** -** WAIT_RESEL -** <> -** -**----------------------------------------------------------- -*/ - -#define SCR_WAIT_DISC 0x48000000 -#define SCR_WAIT_RESEL 0x50000000 - -/*----------------------------------------------------------- -** -** Bit Set / Reset -** -**----------------------------------------------------------- -** -** SET (flags {|.. }) -** -** CLR (flags {|.. }) -** -**----------------------------------------------------------- -*/ - -#define SCR_SET(f) (0x58000000 | (f)) -#define SCR_CLR(f) (0x60000000 | (f)) - -#define SCR_CARRY 0x00000400 -#define SCR_TRG 0x00000200 -#define SCR_ACK 0x00000040 -#define SCR_ATN 0x00000008 - - - - -/*----------------------------------------------------------- -** -** Memory to memory move -** -**----------------------------------------------------------- -** -** COPY (bytecount) -** << source_address >> -** << destination_address >> -** -** SCR_COPY sets the NO FLUSH option by default. -** SCR_COPY_F does not set this option. -** -** For chips which do not support this option, -** ncr_copy_and_bind() will remove this bit. -**----------------------------------------------------------- -*/ - -#define SCR_NO_FLUSH 0x01000000 - -#define SCR_COPY(n) (0xc0000000 | SCR_NO_FLUSH | (n)) -#define SCR_COPY_F(n) (0xc0000000 | (n)) - -/*----------------------------------------------------------- -** -** Register move and binary operations -** -**----------------------------------------------------------- -** -** SFBR_REG (reg, op, data) reg = SFBR op data -** << 0 >> -** -** REG_SFBR (reg, op, data) SFBR = reg op data -** << 0 >> -** -** REG_REG (reg, op, data) reg = reg op data -** << 0 >> -** -**----------------------------------------------------------- -*/ - -#define SCR_REG_OFS(ofs) ((ofs) << 16ul) - -#define SCR_SFBR_REG(reg,op,data) \ - (0x68000000 | (SCR_REG_OFS(REG(reg))) | (op) | ((data)<<8ul)) - -#define SCR_REG_SFBR(reg,op,data) \ - (0x70000000 | (SCR_REG_OFS(REG(reg))) | (op) | ((data)<<8ul)) - -#define SCR_REG_REG(reg,op,data) \ - (0x78000000 | (SCR_REG_OFS(REG(reg))) | (op) | ((data)<<8ul)) - - -#define SCR_LOAD 0x00000000 -#define SCR_SHL 0x01000000 -#define SCR_OR 0x02000000 -#define SCR_XOR 0x03000000 -#define SCR_AND 0x04000000 -#define SCR_SHR 0x05000000 -#define SCR_ADD 0x06000000 -#define SCR_ADDC 0x07000000 - -/*----------------------------------------------------------- -** -** FROM_REG (reg) SFBR = reg -** << 0 >> -** -** TO_REG (reg) reg = SFBR -** << 0 >> -** -** LOAD_REG (reg, data) reg = -** << 0 >> -** -** LOAD_SFBR(data) SFBR = -** << 0 >> -** -**----------------------------------------------------------- -*/ - -#define SCR_FROM_REG(reg) \ - SCR_REG_SFBR(reg,SCR_OR,0) - -#define SCR_TO_REG(reg) \ - SCR_SFBR_REG(reg,SCR_OR,0) - -#define SCR_LOAD_REG(reg,data) \ - SCR_REG_REG(reg,SCR_LOAD,data) - -#define SCR_LOAD_SFBR(data) \ - (SCR_REG_SFBR (gpreg, SCR_LOAD, data)) - -/*----------------------------------------------------------- -** -** LOAD from memory to register. -** STORE from register to memory. -** -**----------------------------------------------------------- -** -** LOAD_ABS (LEN) -** <> -** -** LOAD_REL (LEN) (DSA relative) -** <> -** -**----------------------------------------------------------- -*/ - -#define SCR_NO_FLUSH2 0x02000000 -#define SCR_DSA_REL2 0x10000000 - -#define SCR_LOAD_R(reg, how, n) \ - (0xe1000000 | how | (SCR_REG_OFS(REG(reg))) | (n)) - -#define SCR_STORE_R(reg, how, n) \ - (0xe0000000 | how | (SCR_REG_OFS(REG(reg))) | (n)) - -#define SCR_LOAD_ABS(reg, n) SCR_LOAD_R(reg, SCR_NO_FLUSH2, n) -#define SCR_LOAD_REL(reg, n) SCR_LOAD_R(reg, SCR_NO_FLUSH2|SCR_DSA_REL2, n) -#define SCR_LOAD_ABS_F(reg, n) SCR_LOAD_R(reg, 0, n) -#define SCR_LOAD_REL_F(reg, n) SCR_LOAD_R(reg, SCR_DSA_REL2, n) - -#define SCR_STORE_ABS(reg, n) SCR_STORE_R(reg, SCR_NO_FLUSH2, n) -#define SCR_STORE_REL(reg, n) SCR_STORE_R(reg, SCR_NO_FLUSH2|SCR_DSA_REL2,n) -#define SCR_STORE_ABS_F(reg, n) SCR_STORE_R(reg, 0, n) -#define SCR_STORE_REL_F(reg, n) SCR_STORE_R(reg, SCR_DSA_REL2, n) - - -/*----------------------------------------------------------- -** -** Waiting for Disconnect or Reselect -** -**----------------------------------------------------------- -** -** JUMP [ | IFTRUE/IFFALSE ( ... ) ] -** <
> -** -** JUMPR [ | IFTRUE/IFFALSE ( ... ) ] -** <> -** -** CALL [ | IFTRUE/IFFALSE ( ... ) ] -** <
> -** -** CALLR [ | IFTRUE/IFFALSE ( ... ) ] -** <> -** -** RETURN [ | IFTRUE/IFFALSE ( ... ) ] -** <> -** -** INT [ | IFTRUE/IFFALSE ( ... ) ] -** <> -** -** INT_FLY [ | IFTRUE/IFFALSE ( ... ) ] -** <> -** -** Conditions: -** WHEN (phase) -** IF (phase) -** CARRY -** DATA (data, mask) -** -**----------------------------------------------------------- -*/ - -#define SCR_NO_OP 0x80000000 -#define SCR_JUMP 0x80080000 -#define SCR_JUMPR 0x80880000 -#define SCR_CALL 0x88080000 -#define SCR_CALLR 0x88880000 -#define SCR_RETURN 0x90080000 -#define SCR_INT 0x98080000 -#define SCR_INT_FLY 0x98180000 - -#define IFFALSE(arg) (0x00080000 | (arg)) -#define IFTRUE(arg) (0x00000000 | (arg)) - -#define WHEN(phase) (0x00030000 | (phase)) -#define IF(phase) (0x00020000 | (phase)) - -#define DATA(D) (0x00040000 | ((D) & 0xff)) -#define MASK(D,M) (0x00040000 | (((M ^ 0xff) & 0xff) << 8ul)|((D) & 0xff)) - -#define CARRYSET (0x00200000) - -/*----------------------------------------------------------- -** -** SCSI constants. -** -**----------------------------------------------------------- -*/ - -/* -** Messages -*/ - -#define M_COMPLETE (0x00) -#define M_EXTENDED (0x01) -#define M_SAVE_DP (0x02) -#define M_RESTORE_DP (0x03) -#define M_DISCONNECT (0x04) -#define M_ID_ERROR (0x05) -#define M_ABORT (0x06) -#define M_REJECT (0x07) -#define M_NOOP (0x08) -#define M_PARITY (0x09) -#define M_LCOMPLETE (0x0a) -#define M_FCOMPLETE (0x0b) -#define M_RESET (0x0c) -#define M_ABORT_TAG (0x0d) -#define M_CLEAR_QUEUE (0x0e) -#define M_INIT_REC (0x0f) -#define M_REL_REC (0x10) -#define M_TERMINATE (0x11) -#define M_SIMPLE_TAG (0x20) -#define M_HEAD_TAG (0x21) -#define M_ORDERED_TAG (0x22) -#define M_IGN_RESIDUE (0x23) -#define M_IDENTIFY (0x80) - -#define M_X_MODIFY_DP (0x00) -#define M_X_SYNC_REQ (0x01) -#define M_X_WIDE_REQ (0x03) - -/* -** Status -*/ - -#define S_GOOD (0x00) -#define S_CHECK_COND (0x02) -#define S_COND_MET (0x04) -#define S_BUSY (0x08) -#define S_INT (0x10) -#define S_INT_COND_MET (0x14) -#define S_CONFLICT (0x18) -#define S_TERMINATED (0x20) -#define S_QUEUE_FULL (0x28) -#define S_ILLEGAL (0xff) -#define S_SENSE (0x80) - -/* - * End of ncrreg from FreeBSD - */ - -#endif /* !defined HOSTS_C */ - -#endif /* defined NCR53C8XX_H */ +#endif /* NCR53C8XX_H */ diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/pci2000.c linux/drivers/scsi/pci2000.c --- v2.2.5/linux/drivers/scsi/pci2000.c Tue Mar 23 14:35:48 1999 +++ linux/drivers/scsi/pci2000.c Tue Apr 13 07:54:02 1999 @@ -1,24 +1,22 @@ -/*+M************************************************************************* - * Perceptive Solutions, Inc. PCI-2000 device driver proc support for Linux. +/**************************************************************************** + * Perceptive Solutions, Inc. PCI-2000 device driver for Linux. * - * Copyright (c) 1999 Perceptive Solutions, Inc. + * pci2000.c - Linux Host Driver for PCI-2000 IntelliCache SCSI Adapters * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Copyright (c) 1997-1999 Perceptive Solutions, Inc. + * All Rights Reserved. * - * 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. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that redistributions of source + * code retain the above copyright notice and this comment without + * modification. * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * Technical updates and product information at: + * http://www.psidisk.com * + * Please send questions, comments, bug reports to: + * tech@psidisk.com Technical Support * - * File Name: pci2000i.c * * Revisions 1.10 Jan-21-1999 * - Fixed sign on message to reflect proper controller name. @@ -28,16 +26,17 @@ * - Fixed control timeout to not lock up the entire system if * controller goes offline completely. * - *-M*************************************************************************/ -#define PCI2000_VERSION "1.11" + * Revisions 1.12 Mar-26-1999 + * - Fixed spinlock and PCI configuration. + * + ****************************************************************************/ +#define PCI2000_VERSION "1.12" #include #include -#include #include #include -#include #include #include #include @@ -49,11 +48,17 @@ #include #include "scsi.h" #include "hosts.h" +#include #include "pci2000.h" #include "psi_roy.h" -#include +#if LINUX_VERSION_CODE >= LINUXVERSION(2,1,95) +#include +#endif +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,93) +#include +#endif struct proc_dir_entry Proc_Scsi_Pci2000 = { PROC_SCSI_PCI2000, 7, "pci2000", S_IFDIR | S_IRUGO | S_IXUGO, 2 }; @@ -91,6 +96,7 @@ USHORT mb4; USHORT cmd; USHORT tag; + ULONG irqOwned; DEV2000 dev[MAX_BUS][MAX_UNITS]; } ADAPTER2000, *PADAPTER2000; @@ -234,6 +240,23 @@ int pun; int bus; int z; +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + int flags; +#else /* version >= v2.1.95 */ + unsigned long flags; +#endif /* version >= v2.1.95 */ + +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + /* Disable interrupts, if they aren't already disabled. */ + save_flags (flags); + cli (); +#else /* version >= v2.1.95 */ + /* + * Disable interrupts, if they aren't already disabled and acquire + * the I/O spinlock. + */ + spin_lock_irqsave (&io_request_lock, flags); +#endif /* version >= v2.1.95 */ DEB(printk ("\npci2000 recieved interrupt ")); for ( z = 0; z < NumAdapters; z++ ) // scan for interrupt to process @@ -252,7 +275,7 @@ if ( !shost ) { DEB (printk ("\npci2000: not my interrupt")); - return; + goto irq_return; } padapter = HOSTDATA(shost); @@ -276,7 +299,7 @@ outb_p (0xFF, padapter->tag); // clear the op interrupt outb_p (CMD_DONE, padapter->cmd); // complete the op - return; // done, but, with what? + goto irq_return;; // done, but, with what? irqProceed:; if ( tag & ERR08_TAGGED ) // is there an error here? @@ -284,7 +307,7 @@ if ( WaitReady (padapter) ) { OpDone (SCpnt, DID_TIME_OUT << 16); - return; + goto irq_return;; } outb_p (tag0, padapter->mb0); // get real error code @@ -292,7 +315,7 @@ if ( WaitReady (padapter) ) // wait for controller to suck up the op { OpDone (SCpnt, DID_TIME_OUT << 16); - return; + goto irq_return;; } error = inl (padapter->mb0); // get error data @@ -305,24 +328,40 @@ if ( bus ) // are we doint SCSI commands? { OpDone (SCpnt, (DID_OK << 16) | 2); - return; + goto irq_return;; } if ( *SCpnt->cmnd == SCSIOP_TEST_UNIT_READY ) OpDone (SCpnt, (DRIVER_SENSE << 24) | (DID_OK << 16) | 2); // test caller we have sense data too else OpDone (SCpnt, DID_ERROR << 16); - return; + goto irq_return;; } OpDone (SCpnt, DID_ERROR << 16); - return; + goto irq_return;; } outb_p (0xFF, padapter->tag); // clear the op interrupt outb_p (CMD_DONE, padapter->cmd); // complete the op OpDone (SCpnt, DID_OK << 16); + +irq_return:; +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + /* + * Restore the original flags which will enable interrupts + * if and only if they were enabled on entry. + */ + restore_flags (flags); +#else /* version >= v2.1.95 */ + /* + * 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.1.95 */ } /**************************************************************** - * Name: Pci2220i_QueueCommand + * Name: Pci2000_QueueCommand * * Description: Process a queued command from the SCSI manager. * @@ -511,7 +550,7 @@ if ( cmd ) break; default: - DEB (printk ("pci2220i_queuecommand: Unsupported command %02X\n", *cdb)); + DEB (printk ("pci2000_queuecommand: Unsupported command %02X\n", *cdb)); OpDone (SCpnt, DID_ERROR << 16); return 0; } @@ -538,7 +577,7 @@ SCpnt->SCp.Status++; } /**************************************************************** - * Name: Pci2220i_Command + * Name: Pci2000_Command * * Description: Process a command from the SCSI manager. * @@ -559,90 +598,121 @@ return SCpnt->result; } /**************************************************************** - * Name: Pci2220i_Detect + * Name: Pci2000_Detect * * Description: Detect and initialize our boards. * * Parameters: tpnt - Pointer to SCSI host template structure. * - * Returns: Number of adapters found. + * Returns: Number of adapters installed. * ****************************************************************/ int Pci2000_Detect (Scsi_Host_Template *tpnt) { - int pci_index = 0; + int found = 0; + int installed = 0; struct Scsi_Host *pshost; PADAPTER2000 padapter; int z, zz; int setirq; +#if LINUX_VERSION_CODE > LINUXVERSION(2,1,92) + struct pci_dev *pdev = NULL; +#else + UCHAR pci_bus, pci_device_fn; +#endif - if ( pcibios_present () ) +#if LINUX_VERSION_CODE > LINUXVERSION(2,1,92) + if ( !pci_present () ) +#else + if ( !pcibios_present () ) +#endif { - for ( pci_index = 0; pci_index <= MAXADAPTER; ++pci_index ) - { - UCHAR pci_bus, pci_device_fn; + printk ("pci2000: PCI BIOS not present\n"); + return 0; + } - if ( pcibios_find_device (VENDOR_PSI, DEVICE_ROY_1, pci_index, &pci_bus, &pci_device_fn) != 0 ) - break; +#if LINUX_VERSION_CODE > LINUXVERSION(2,1,92) + while ( (pdev = pci_find_device (VENDOR_PSI, DEVICE_ROY_1, pdev)) != NULL ) +#else + while ( !pcibios_find_device (VENDOR_PSI, DEVICE_ROY_1, found, &pci_bus, &pci_device_fn) ) +#endif + { + pshost = scsi_register (tpnt, sizeof(ADAPTER2000)); + padapter = HOSTDATA(pshost); - pshost = scsi_register (tpnt, sizeof(ADAPTER2000)); - padapter = HOSTDATA(pshost); +#if LINUX_VERSION_CODE > LINUXVERSION(2,1,92) + padapter->basePort = pdev->base_address[1] & 0xFFFE; +#else + pcibios_read_config_word (pci_bus, pci_device_fn, PCI_BASE_ADDRESS_1, &padapter->basePort); + padapter->basePort &= 0xFFFE; +#endif + DEB (printk ("\nBase Regs = %#04X", padapter->basePort)); // get the base I/O port address + padapter->mb0 = padapter->basePort + RTR_MAILBOX; // get the 32 bit mail boxes + padapter->mb1 = padapter->basePort + RTR_MAILBOX + 4; + padapter->mb2 = padapter->basePort + RTR_MAILBOX + 8; + padapter->mb3 = padapter->basePort + RTR_MAILBOX + 12; + padapter->mb4 = padapter->basePort + RTR_MAILBOX + 16; + padapter->cmd = padapter->basePort + RTR_LOCAL_DOORBELL; // command register + padapter->tag = padapter->basePort + RTR_PCI_DOORBELL; // tag/response register - pcibios_read_config_word (pci_bus, pci_device_fn, PCI_BASE_ADDRESS_1, &padapter->basePort); - padapter->basePort &= 0xFFFE; - DEB (printk ("\nBase Regs = %#04X", padapter->basePort)); // get the base I/O port address - padapter->mb0 = padapter->basePort + RTR_MAILBOX; // get the 32 bit mail boxes - padapter->mb1 = padapter->basePort + RTR_MAILBOX + 4; - padapter->mb2 = padapter->basePort + RTR_MAILBOX + 8; - padapter->mb3 = padapter->basePort + RTR_MAILBOX + 12; - padapter->mb4 = padapter->basePort + RTR_MAILBOX + 16; - padapter->cmd = padapter->basePort + RTR_LOCAL_DOORBELL; // command register - padapter->tag = padapter->basePort + RTR_PCI_DOORBELL; // tag/response register - - if ( WaitReady (padapter) ) - goto unregister; - outb_p (0x84, padapter->mb0); - outb_p (CMD_SPECIFY, padapter->cmd); - if ( WaitReady (padapter) ) - goto unregister; - - pcibios_read_config_byte (pci_bus, pci_device_fn, PCI_INTERRUPT_LINE, &pshost->irq); - setirq = 1; - for ( z = 0; z < pci_index; z++ ) // scan for shared interrupts - { - if ( PsiHost[z]->irq == pshost->irq ) // if shared then, don't posses - setirq = 0; - } - if ( setirq ) // if not shared, posses + if ( WaitReady (padapter) ) + goto unregister; + outb_p (0x84, padapter->mb0); + outb_p (CMD_SPECIFY, padapter->cmd); + if ( WaitReady (padapter) ) + goto unregister; + +#if LINUX_VERSION_CODE > LINUXVERSION(2,1,92) + pshost->irq = pdev->irq; +#else + pcibios_read_config_byte (pci_bus, pci_device_fn, PCI_INTERRUPT_LINE, &pshost->irq); +#endif + setirq = 1; + padapter->irqOwned = 0; + for ( z = 0; z < installed; z++ ) // scan for shared interrupts + { + if ( PsiHost[z]->irq == pshost->irq ) // if shared then, don't posses + setirq = 0; + } + if ( setirq ) // if not shared, posses + { + if ( request_irq (pshost->irq, Irq_Handler, SA_SHIRQ, "pci2000", padapter) < 0 ) { - if ( request_irq (pshost->irq, Irq_Handler, 0, "pci2000", NULL) ) + if ( request_irq (pshost->irq, Irq_Handler, SA_INTERRUPT | SA_SHIRQ, "pci2000", padapter) < 0 ) { - printk ("Unable to allocate IRQ for PSI-2000 controller.\n"); + printk ("Unable to allocate IRQ for PCI-2000 controller.\n"); goto unregister; } } - PsiHost[pci_index] = pshost; // save SCSI_HOST pointer + padapter->irqOwned = pshost->irq; // set IRQ as owned + } + PsiHost[installed] = pshost; // save SCSI_HOST pointer - pshost->unique_id = padapter->basePort; - pshost->max_id = 16; - pshost->max_channel = 1; - - for ( zz = 0; zz < MAX_BUS; zz++ ) - for ( z = 0; z < MAX_UNITS; z++ ) - padapter->dev[zz][z].tag = 0; + pshost->io_port = padapter->basePort; + pshost->n_io_port = 0xFF; + pshost->unique_id = padapter->basePort; + pshost->max_id = 16; + pshost->max_channel = 1; + + for ( zz = 0; zz < MAX_BUS; zz++ ) + for ( z = 0; z < MAX_UNITS; z++ ) + padapter->dev[zz][z].tag = 0; - printk("\nPSI-2000 Intelligent Storage SCSI CONTROLLER: at I/O = %X IRQ = %d\n", padapter->basePort, pshost->irq); - printk("Version %s, Compiled %s %s\n\n", PCI2000_VERSION, __DATE__, __TIME__); + printk("\nPSI-2000 Intelligent Storage SCSI CONTROLLER: at I/O = %X IRQ = %d\n", padapter->basePort, pshost->irq); + printk("Version %s, Compiled %s %s\n\n", PCI2000_VERSION, __DATE__, __TIME__); + found++; + if ( ++installed < MAXADAPTER ) continue; + break; unregister:; - scsi_unregister (pshost); - } + scsi_unregister (pshost); + found++; } - NumAdapters = pci_index; - return pci_index; + NumAdapters = installed; + return installed; } /**************************************************************** - * Name: Pci2220i_Abort + * Name: Pci2000_Abort * * Description: Process the Abort command from the SCSI manager. * @@ -657,7 +727,7 @@ return SCSI_ABORT_SNOOZE; } /**************************************************************** - * Name: Pci2220i_Reset + * Name: Pci2000_Reset * * Description: Process the Reset command from the SCSI manager. * @@ -675,11 +745,34 @@ { return SCSI_RESET_PUNT; } +/**************************************************************** + * Name: Pci2000_Release + * + * Description: Release resources allocated for a single each adapter. + * + * Parameters: pshost - Pointer to SCSI command structure. + * + * Returns: zero. + * + ****************************************************************/ +int Pci2000_Release (struct Scsi_Host *pshost) + { + PADAPTER2000 padapter = HOSTDATA (pshost); -#include "sd.h" + if ( padapter->irqOwned ) +#if LINUX_VERSION_CODE < LINUXVERSION(1,3,70) + free_irq (pshost->irq); +#else /* version >= v1.3.70 */ + free_irq (pshost->irq, padapter); +#endif /* version >= v1.3.70 */ + release_region (pshost->io_port, pshost->n_io_port); + scsi_unregister(pshost); + return 0; + } +#include "sd.h" /**************************************************************** - * Name: Pci2220i_BiosParam + * Name: Pci2000_BiosParam * * Description: Process the biosparam request from the SCSI manager to * return C/H/S data. @@ -713,7 +806,7 @@ #ifdef MODULE /* Eventually this will go into an include file, but this will be later */ -Scsi_Host_Template driver_template = PCI2220I; +Scsi_Host_Template driver_template = PCI2000; #include "scsi_module.c" #endif diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/pci2000.h linux/drivers/scsi/pci2000.h --- v2.2.5/linux/drivers/scsi/pci2000.h Tue Mar 23 14:35:48 1999 +++ linux/drivers/scsi/pci2000.h Fri Apr 16 14:28:51 1999 @@ -1,29 +1,23 @@ -/*+M************************************************************************* - * Perceptive Solutions, Inc. PCI-2000 device driver proc support for Linux. +/**************************************************************************** + * Perceptive Solutions, Inc. PCI-2000 device driver for Linux. * - * Copyright (c) 1997 Perceptive Solutions, Inc. + * pci2000.h - Linux Host Driver for PCI-2000 IntelliCache SCSI Adapters * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Copyright (c) 1997-1999 Perceptive Solutions, Inc. + * All Rights Reserved. * - * 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. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that redistributions of source + * code retain the above copyright notice and this comment without + * modification. * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * Technical updates and product information at: + * http://www.psidisk.com * + * Please send questions, comments, bug reports to: + * tech@psidisk.com Technical Support * - * File Name: pci2000.h - * - * Description: Header file for the SCSI driver for the PCI-2000 - * interface card. - * - *-M*************************************************************************/ + ****************************************************************************/ #ifndef _PCI2000_H #define _PCI2000_H @@ -33,6 +27,11 @@ #ifndef PSI_EIDE_SCSIOP #define PSI_EIDE_SCSIOP 1 +#ifndef LINUX_VERSION_CODE +#include +#endif +#define LINUXVERSION(v,p,s) (((v)<<16) + ((p)<<8) + (s)) + /************************************************/ /* definition of standard data types */ /************************************************/ @@ -194,6 +193,7 @@ int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)); int Pci2000_Abort (Scsi_Cmnd *SCpnt); int Pci2000_Reset (Scsi_Cmnd *SCpnt, unsigned int flags); +int Pci2000_Release (struct Scsi_Host *pshost); int Pci2000_BiosParam (Disk *disk, kdev_t dev, int geom[]); #ifndef NULL @@ -202,12 +202,43 @@ extern struct proc_dir_entry Proc_Scsi_Pci2000; +#if LINUX_VERSION_CODE >= LINUXVERSION(2,1,75) +#define PCI2000 { \ + next: NULL, \ + module: NULL, \ + proc_dir: &Proc_Scsi_Pci2000, \ + proc_info: NULL, /* let's not bloat the kernel */ \ + name: "PCI-2000 SCSI Intelligent Disk Controller",\ + detect: Pci2000_Detect, \ + release: Pci2000_Release, \ + info: NULL, /* let's not bloat the kernel */ \ + command: Pci2000_Command, \ + queuecommand: Pci2000_QueueCommand, \ + eh_strategy_handler: NULL, \ + eh_abort_handler: NULL, \ + eh_device_reset_handler: NULL, \ + eh_bus_reset_handler: NULL, \ + eh_host_reset_handler: NULL, \ + abort: Pci2000_Abort, \ + reset: Pci2000_Reset, \ + slave_attach: NULL, \ + bios_param: Pci2000_BiosParam, \ + can_queue: 16, \ + this_id: -1, \ + sg_tablesize: 16, \ + cmd_per_lun: 1, \ + present: 0, \ + unchecked_isa_dma: 0, \ + use_clustering: DISABLE_CLUSTERING, \ + use_new_eh_code: 0 \ + } +#else #define PCI2000 { NULL, NULL, \ &Proc_Scsi_Pci2000,/* proc_dir_entry */ \ NULL, \ "PCI-2000 SCSI Intelligent Disk Controller",\ Pci2000_Detect, \ - NULL, \ + Pci2000_Release, \ NULL, \ Pci2000_Command, \ Pci2000_QueueCommand, \ @@ -222,5 +253,6 @@ 0, \ 0, \ DISABLE_CLUSTERING } +#endif #endif diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/pci2220i.c linux/drivers/scsi/pci2220i.c --- v2.2.5/linux/drivers/scsi/pci2220i.c Tue Mar 23 14:35:48 1999 +++ linux/drivers/scsi/pci2220i.c Tue Apr 13 07:54:02 1999 @@ -1,35 +1,36 @@ -/*+M************************************************************************* - * Perceptive Solutions, Inc. PCI-22220I device driver proc support for Linux. +/**************************************************************************** + * Perceptive Solutions, Inc. PCI-2220I device driver for Linux. * - * Copyright (c) 1999 Perceptive Solutions, Inc. + * pci2220i.c - Linux Host Driver for PCI-2220I EIDE RAID Adapters * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Copyright (c) 1997-1999 Perceptive Solutions, Inc. + * All Rights Reserved. * - * 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. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that redistributions of source + * code retain the above copyright notice and this comment without + * modification. * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * Technical updates and product information at: + * http://www.psidisk.com * + * Please send questions, comments, bug reports to: + * tech@psidisk.com Technical Support * - * File Name: pci2220i.c * - * Description: SCSI driver for the PCI2220I EIDE interface card. + * Revisions 1.10 Mar-26-1999 + * - Updated driver for RAID and hot reconstruct support. * - *-M*************************************************************************/ + * Revisions 1.11 Mar-26-1999 + * - Fixed spinlock and PCI configuration. + * + ****************************************************************************/ #include #include -#include #include #include -#include +#include #include #include #include @@ -46,7 +47,14 @@ #include "hosts.h" #include "pci2220i.h" -#define PCI2220I_VERSION "1.10" +#if LINUX_VERSION_CODE >= LINUXVERSION(2,1,95) +#include +#endif +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,93) +#include +#endif + +#define PCI2220I_VERSION "1.11" //#define READ_CMD IDE_COMMAND_READ //#define WRITE_CMD IDE_COMMAND_WRITE //#define MAX_BUS_MASTER_BLOCKS 1 // This is the maximum we can bus master @@ -119,6 +127,7 @@ USHORT timingMode; // timing mode currently set for adapter USHORT timingPIO; // TRUE if PIO timing is active ULONG timingAddress; // address to use on adapter for current timing mode + ULONG irqOwned; // owned IRQ or zero if shared OUR_DEVICE device[DALE_MAXDRIVES]; DISK_MIRROR *raidData[8]; ULONG startSector; @@ -135,9 +144,9 @@ USHORT demoFail; // flag for RAID failure demonstration USHORT survivor; USHORT failinprog; - USHORT timeoutReconRetry; struct timer_list reconTimer; struct timer_list timer; + UCHAR *kBuffer; } ADAPTER2220I, *PADAPTER2220I; #define HOSTDATA(host) ((PADAPTER2220I)&host->hostdata) @@ -155,7 +164,6 @@ static SETUP DaleSetup; static DISK_MIRROR DiskMirror[2]; static ULONG ModeArray[] = {DALE_DATA_MODE2, DALE_DATA_MODE3, DALE_DATA_MODE4, DALE_DATA_MODE4P}; -static UCHAR Buffer[SECTORSXFER * BYTES_PER_SECTOR]; static void ReconTimerExpiry (unsigned long data); @@ -523,7 +531,7 @@ ****************************************************************/ static ULONG InlineIdentify (PADAPTER2220I padapter, UCHAR spigot, UCHAR device) { - PIDENTIFY_DATA pid = (PIDENTIFY_DATA)Buffer; + PIDENTIFY_DATA pid = (PIDENTIFY_DATA)padapter->kBuffer; SelectSpigot (padapter, spigot | 0x80); // select the spigot outb_p (device << 4, padapter->regLba24); // select the drive @@ -532,10 +540,51 @@ WriteCommand (padapter, IDE_COMMAND_IDENTIFY); if ( WaitDrq (padapter) ) return 0; - insw (padapter->regData, Buffer, sizeof (IDENTIFY_DATA) >> 1); + insw (padapter->regData, padapter->kBuffer, sizeof (IDENTIFY_DATA) >> 1); return (pid->LBATotalSectors - 1); } /**************************************************************** + * Name: InlineReadSignature :LOCAL + * + * Description: Do an inline read RAID sigature. + * + * Parameters: padapter - Pointer adapter data structure. + * pdev - Pointer to device. + * index - index of data to read. + * + * Returns: Zero if no error or status register contents on error. + * + ****************************************************************/ +static UCHAR InlineReadSignature (PADAPTER2220I padapter, POUR_DEVICE pdev, int index) + { + UCHAR status; + UCHAR spigot = 1 << index; + ULONG zl = pdev->lastsectorlba[index]; + + SelectSpigot (padapter, spigot | 0x80); // select the spigot without interrupts + outb_p (pdev->byte6 | ((UCHAR *)&zl)[3], padapter->regLba24); + status = WaitReady (padapter); + if ( !status ) + { + outb_p (((UCHAR *)&zl)[2], padapter->regLba16); + outb_p (((UCHAR *)&zl)[1], padapter->regLba8); + outb_p (((UCHAR *)&zl)[0], padapter->regLba0); + outb_p (1, padapter->regSectCount); + WriteCommand (padapter, IDE_COMMAND_READ); + status = WaitDrq (padapter); + if ( !status ) + { + insw (padapter->regData, padapter->kBuffer, BYTES_PER_SECTOR / 2); + ((ULONG *)(&pdev->DiskMirror[index]))[0] = ((ULONG *)(&padapter->kBuffer[DISK_MIRROR_POSITION]))[0]; + ((ULONG *)(&pdev->DiskMirror[index]))[1] = ((ULONG *)(&padapter->kBuffer[DISK_MIRROR_POSITION]))[1]; + // some drives assert DRQ before IRQ so let's make sure we clear the IRQ + WaitReady (padapter); + return 0; + } + } + return status; + } +/**************************************************************** * Name: DecodeError :LOCAL * * Description: Decode and process device errors. @@ -619,9 +668,9 @@ StartTimer (padapter); padapter->expectingIRQ = TRUE; - outsw (padapter->regData, Buffer, DISK_MIRROR_POSITION / 2); - outsw (padapter->regData, &pdev->DiskMirror[index], sizeof (DISK_MIRROR) / 2); - outsw (padapter->regData, Buffer, ((512 - (DISK_MIRROR_POSITION + sizeof (DISK_MIRROR))) / 2)); + ((ULONG *)(&padapter->kBuffer[DISK_MIRROR_POSITION]))[0] = ((ULONG *)(&pdev->DiskMirror[index]))[0]; + ((ULONG *)(&padapter->kBuffer[DISK_MIRROR_POSITION]))[1] = ((ULONG *)(&pdev->DiskMirror[index]))[1]; + outsw (padapter->regData, padapter->kBuffer, BYTES_PER_SECTOR / 2); return FALSE; } /******************************************************************************************************* @@ -640,7 +689,7 @@ { UCHAR spigot; - DEB (printk ("\npci2000i: Initialize failover process - survivor = %d", padapter->survivor)); + DEB (printk ("\npci2220i: Initialize failover process - survivor = %d", padapter->survivor)); pdev->raid = FALSE; //initializes system for non raid mode pdev->hotRecon = 0; padapter->reconOn = FALSE; @@ -674,71 +723,75 @@ { PADAPTER2220I padapter = (PADAPTER2220I)data; POUR_DEVICE pdev = padapter->pdev; - ULONG flags; UCHAR status = IDE_STATUS_BUSY; UCHAR temp, temp1; - +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + int flags; +#else /* version >= v2.1.95 */ + unsigned long flags; +#endif /* version >= v2.1.95 */ + +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + /* Disable interrupts, if they aren't already disabled. */ + save_flags (flags); + cli (); +#else /* version >= v2.1.95 */ + /* + * Disable interrupts, if they aren't already disabled and acquire + * the I/O spinlock. + */ + spin_lock_irqsave (&io_request_lock, flags); +#endif /* version >= v2.1.95 */ DEB (printk ("\nPCI2220I: Timeout expired ")); - save_flags (flags); - cli (); if ( padapter->failinprog ) { DEB (printk ("in failover process")); - restore_flags (flags); OpDone (padapter, DecodeError (padapter, inb_p (padapter->regStatCmd))); - return; + goto timerExpiryDone; } while ( padapter->reconPhase ) { DEB (printk ("in recon phase %X", padapter->reconPhase)); - if ( --padapter->timeoutReconRetry ) - { - StartTimer (padapter); - return; - } switch ( padapter->reconPhase ) { case RECON_PHASE_MARKING: case RECON_PHASE_LAST: padapter->survivor = (pdev->spigot ^ 3) >> 1; - restore_flags (flags); DEB (printk ("\npci2220i: FAILURE 1")); if ( InitFailover (padapter, pdev) ) OpDone (padapter, DID_ERROR << 16); - return; + goto timerExpiryDone; case RECON_PHASE_READY: OpDone (padapter, DID_ERROR << 16); - return; + goto timerExpiryDone; case RECON_PHASE_COPY: padapter->survivor = (pdev->spigot) >> 1; - restore_flags (flags); DEB (printk ("\npci2220i: FAILURE 2")); + DEB (printk ("\n spig/stat = %X", inb_p (padapter->regStatSel)); if ( InitFailover (padapter, pdev) ) OpDone (padapter, DID_ERROR << 16); - return; + goto timerExpiryDone; case RECON_PHASE_UPDATE: padapter->survivor = (pdev->spigot) >> 1; - restore_flags (flags); - DEB (printk ("\npci2220i: FAILURE 3")); + DEB (printk ("\npci2220i: FAILURE 3"))); if ( InitFailover (padapter, pdev) ) OpDone (padapter, DID_ERROR << 16); - return; + goto timerExpiryDone; case RECON_PHASE_END: padapter->survivor = (pdev->spigot) >> 1; - restore_flags (flags); DEB (printk ("\npci2220i: FAILURE 4")); if ( InitFailover (padapter, pdev) ) OpDone (padapter, DID_ERROR << 16); - return; + goto timerExpiryDone; default: - return; + goto timerExpiryDone; } } @@ -779,14 +832,13 @@ padapter->survivor = 1; else padapter->survivor = 0; - restore_flags (flags); - DEB (printk ("\npci2220i: FAILURE 5")); + DEB (printk ("\npci2220i: FAILURE 5")); if ( InitFailover (padapter, pdev) ) { status = inb_p (padapter->regStatCmd); break; } - return; + goto timerExpiryDone; } } } @@ -794,14 +846,13 @@ { DEB (printk ("in RAID read operation")); padapter->survivor = (pdev->spigot ^ 3) >> 1; - restore_flags (flags); DEB (printk ("\npci2220i: FAILURE 6")); if ( InitFailover (padapter, pdev) ) { status = inb_p (padapter->regStatCmd); break; } - return; + goto timerExpiryDone; } } else @@ -812,8 +863,23 @@ break; } - restore_flags (flags); OpDone (padapter, DecodeError (padapter, status)); + +timerExpiryDone:; +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + /* + * Restore the original flags which will enable interrupts + * if and only if they were enabled on entry. + */ + restore_flags (flags); +#else /* version >= v2.1.95 */ + /* + * 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.1.95 */ } /**************************************************************** * Name: SetReconstruct :LOCAL @@ -854,15 +920,31 @@ USHORT minmode; ULONG zl; UCHAR zc; +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + int flags; +#else /* version >= v2.1.95 */ + unsigned long flags; +#endif /* version >= v2.1.95 */ + +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + /* Disable interrupts, if they aren't already disabled. */ + save_flags (flags); + cli (); +#else /* version >= v2.1.95 */ + /* + * Disable interrupts, if they aren't already disabled and acquire + * the I/O spinlock. + */ + spin_lock_irqsave (&io_request_lock, flags); +#endif /* version >= v2.1.95 */ padapter = (PADAPTER2220I)data; if ( padapter->SCpnt ) - return; + goto reconTimerExpiry; pdev = padapter->device; - pid = (PIDENTIFY_DATA)Buffer; + pid = (PIDENTIFY_DATA)padapter->kBuffer; padapter->reconTimer.data = 0; - padapter->timeoutReconRetry = 2; padapter->pdev = pdev; if ( padapter->reconIsStarting ) { @@ -875,7 +957,7 @@ { if ( (pdev->DiskMirror[0].status & UCBF_MATCHED) && (pdev->DiskMirror[1].status & UCBF_MATCHED) ) { - return; + goto reconTimerExpiry; } if ( pdev->DiskMirror[0].status & UCBF_SURVIVOR ) // is first drive survivor? @@ -900,7 +982,7 @@ } if ( !pdev->hotRecon ) - return; + goto reconTimerExpiry; zc = ((inb_p (padapter->regStatSel) >> 3) | inb_p (padapter->regStatSel)) & 0x83; // mute the alarm outb_p (zc | pdev->hotRecon | 0x40, padapter->regFail); @@ -976,15 +1058,15 @@ padapter->reconPhase = RECON_PHASE_FAILOVER; DEB (printk ("\npci2220i: FAILURE 7")); InitFailover (padapter, pdev); - return; + goto reconTimerExpiry; } pdev->raid = TRUE; if ( WriteSignature (padapter, pdev, pdev->spigot, pdev->mirrorRecon ^ 1) ) - return; + goto reconTimerExpiry; padapter->reconPhase = RECON_PHASE_MARKING; - return; + goto reconTimerExpiry; } //********************************** @@ -999,10 +1081,10 @@ padapter->reconPhase = RECON_PHASE_FAILOVER; DEB (printk ("\npci2220i: FAILURE 8")); InitFailover (padapter, pdev); - return; + goto reconTimerExpiry; } padapter->reconPhase = RECON_PHASE_UPDATE; - return; + goto reconTimerExpiry; } zl = pdev->DiskMirror[pdev->mirrorRecon].reconstructPoint; @@ -1016,7 +1098,7 @@ outb_p (pdev->byte6 | ((UCHAR *)(&zl))[3], padapter->regLba24);// select the drive SelectSpigot (padapter, pdev->spigot); if ( WaitReady (padapter) ) - return; + goto reconTimerExpiry; SelectSpigot (padapter, pdev->hotRecon); if ( WaitReady (padapter) ) @@ -1025,7 +1107,7 @@ padapter->reconPhase = RECON_PHASE_FAILOVER; DEB (printk ("\npci2220i: FAILURE 9")); InitFailover (padapter, pdev); - return; + goto reconTimerExpiry; } SelectSpigot (padapter, 3); @@ -1040,15 +1122,30 @@ StartTimer (padapter); SelectSpigot (padapter, pdev->spigot); WriteCommand (padapter, READ_CMD); - return; + goto reconTimerExpiry; } pdev->DiskMirror[pdev->mirrorRecon].status = UCBF_MIRRORED | UCBF_MATCHED; pdev->DiskMirror[pdev->mirrorRecon ^ 1].status = UCBF_MIRRORED | UCBF_MATCHED; if ( WriteSignature (padapter, pdev, pdev->spigot, pdev->mirrorRecon ^ 1) ) - return; + goto reconTimerExpiry; padapter->reconPhase = RECON_PHASE_LAST; - return; + +reconTimerExpiry:; +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + /* + * Restore the original flags which will enable interrupts + * if and only if they were enabled on entry. + */ + restore_flags (flags); +#else /* version >= v2.1.95 */ + /* + * 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.1.95 */ } /**************************************************************** * Name: Irq_Handler :LOCAL @@ -1072,6 +1169,23 @@ UCHAR status1; int z; ULONG zl; +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + int flags; +#else /* version >= v2.1.95 */ + unsigned long flags; +#endif /* version >= v2.1.95 */ + +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + /* Disable interrupts, if they aren't already disabled. */ + save_flags (flags); + cli (); +#else /* version >= v2.1.95 */ + /* + * Disable interrupts, if they aren't already disabled and acquire + * the I/O spinlock. + */ + spin_lock_irqsave (&io_request_lock, flags); +#endif /* version >= v2.1.95 */ // DEB (printk ("\npci2220i recieved interrupt\n")); @@ -1090,7 +1204,7 @@ if ( !shost ) { DEB (printk ("\npci2220i: not my interrupt")); - return; + goto irq_return; } padapter = HOSTDATA(shost); @@ -1101,7 +1215,7 @@ { DEB(printk ("\npci2220i Unsolicited interrupt\n")); STOP_HERE (); - return; + goto irq_return; } padapter->expectingIRQ = 0; outb_p (0x08, padapter->regDmaCmdStat); // cancel interrupt from DMA engine @@ -1125,7 +1239,7 @@ OpDone (padapter, DID_OK << 16); else Pci2220i_QueueCommand (SCpnt, SCpnt->scsi_done); - return; + goto irq_return; } } @@ -1142,24 +1256,24 @@ if ( status & (IDE_STATUS_ERROR | IDE_STATUS_WRITE_FAULT) ) { padapter->survivor = (pdev->spigot ^ 3) >> 1; - DEB (printk ("\npci2220i: FAILURE 10")); + DEB (printk ("\npci2220i: FAILURE 10")); if ( InitFailover (padapter, pdev) ) OpDone (padapter, DecodeError (padapter, status)); - return; + goto irq_return; } if ( WriteSignature (padapter, pdev, pdev->hotRecon, pdev->mirrorRecon) ) { padapter->survivor = (pdev->spigot) >> 1; - DEB (printk ("\npci2220i: FAILURE 11")); + DEB (printk ("\npci2220i: FAILURE 11")); if ( InitFailover (padapter, pdev) ) OpDone (padapter, DecodeError (padapter, status)); - return; + goto irq_return; } padapter->reconPhase = RECON_PHASE_END; - return; + goto irq_return; } OpDone (padapter, DID_OK << 16); - return; + goto irq_return; case RECON_PHASE_READY: status = inb_p (padapter->regStatCmd); // read the device status @@ -1167,7 +1281,7 @@ { del_timer (&padapter->timer); OpDone (padapter, DecodeError (padapter, status)); - return; + goto irq_return; } SelectSpigot (padapter, pdev->hotRecon); if ( WaitDrq (padapter) ) @@ -1177,25 +1291,25 @@ DEB (printk ("\npci2220i: FAILURE 12")); if ( InitFailover (padapter, pdev) ) OpDone (padapter, DecodeError (padapter, status)); - return; + goto irq_return; } SelectSpigot (padapter, pdev->spigot | 0x40); padapter->reconPhase = RECON_PHASE_COPY; padapter->expectingIRQ = TRUE; if ( padapter->timingPIO ) { - insw (padapter->regData, Buffer, padapter->reconSize * (BYTES_PER_SECTOR / 2)); + insw (padapter->regData, padapter->kBuffer, padapter->reconSize * (BYTES_PER_SECTOR / 2)); } else { outl (padapter->timingAddress, padapter->regDmaAddrLoc); - outl (virt_to_bus (Buffer), padapter->regDmaAddrPci); + outl (virt_to_bus (padapter->kBuffer), padapter->regDmaAddrPci); outl (padapter->reconSize * BYTES_PER_SECTOR, padapter->regDmaCount); outb_p (8, padapter->regDmaDesc); // read operation outb_p (1, padapter->regDmaMode); // no interrupt outb_p (0x03, padapter->regDmaCmdStat); // kick the DMA engine in gear } - return; + goto irq_return; case RECON_PHASE_COPY: pdev->DiskMirror[pdev->mirrorRecon].reconstructPoint += padapter->reconSize; @@ -1207,14 +1321,13 @@ if ( status & (IDE_STATUS_ERROR | IDE_STATUS_WRITE_FAULT) ) { padapter->survivor = (pdev->spigot) >> 1; - DEB (printk ("\npci2220i: FAILURE 13")); - DEB (printk (" status = %X error = %X", status, inb_p (padapter->regError))); + DEB (printk ("\npci2220i: FAILURE 13")); if ( InitFailover (padapter, pdev) ) OpDone (padapter, DecodeError (padapter, status)); - return; + goto irq_return; } OpDone (padapter, DID_OK << 16); - return; + goto irq_return; case RECON_PHASE_END: status = inb_p (padapter->regStatCmd); // read the device status @@ -1225,15 +1338,15 @@ DEB (printk ("\npci2220i: FAILURE 14")); if ( InitFailover (padapter, pdev) ) OpDone (padapter, DecodeError (padapter, status)); - return; + goto irq_return; } padapter->reconOn = FALSE; pdev->hotRecon = 0; OpDone (padapter, DID_OK << 16); - return; + goto irq_return; default: - return; + goto irq_return; } } @@ -1251,7 +1364,7 @@ del_timer (&padapter->timer); DEB (printk ("\npci2220i: FAILURE 15")); if ( !InitFailover (padapter, pdev) ) - return; + goto irq_return; } break; } @@ -1270,7 +1383,7 @@ else BusMaster (padapter, 1, 1); padapter->expectingIRQ = TRUE; - return; + goto irq_return; } status = 0; break; @@ -1295,7 +1408,7 @@ SelectSpigot (padapter, pdev->spigot | 0x80); DEB (printk ("\npci2220i: FAILURE 16 status = %X error = %X", status, inb_p (padapter->regError))); if ( !InitFailover (padapter, pdev) ) - return; + goto irq_return; } break; } @@ -1307,7 +1420,7 @@ del_timer (&padapter->timer); DEB (printk ("\npci2220i: FAILURE 17 status = %X error = %X", status1, inb_p (padapter->regError))); if ( !InitFailover (padapter, pdev) ) - return; + goto irq_return; status = status1; break; } @@ -1320,13 +1433,13 @@ del_timer (&padapter->timer); DEB (printk ("\npci2220i: FAILURE 18")); if ( !InitFailover (padapter, pdev) ) - return; + goto irq_return; SelectSpigot (padapter, status | 0x80); status = inb_p (padapter->regStatCmd); // read the device status break; } padapter->expectingIRQ = TRUE; - return; + goto irq_return; } status = 0; break; @@ -1338,7 +1451,7 @@ if ( status ) break; padapter->expectingIRQ = TRUE; - return; + goto irq_return; } status = 0; break; @@ -1346,7 +1459,7 @@ case IDE_COMMAND_IDENTIFY: { PINQUIRYDATA pinquiryData = SCpnt->request_buffer; - PIDENTIFY_DATA pid = (PIDENTIFY_DATA)Buffer; + PIDENTIFY_DATA pid = (PIDENTIFY_DATA)padapter->kBuffer; status = inb_p (padapter->regStatCmd); if ( status & IDE_STATUS_DRQ ) @@ -1399,6 +1512,21 @@ zl = DID_OK << 16; OpDone (padapter, zl); +irq_return:; +#if LINUX_VERSION_CODE < LINUXVERSION(2,1,95) + /* + * Restore the original flags which will enable interrupts + * if and only if they were enabled on entry. + */ + restore_flags (flags); +#else /* version >= v2.1.95 */ + /* + * 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.1.95 */ } /**************************************************************** * Name: Pci2220i_QueueCommand @@ -1652,12 +1780,13 @@ * * Parameters: tpnt - Pointer to SCSI host template structure. * - * Returns: Number of adapters found. + * Returns: Number of adapters installed. * ****************************************************************/ int Pci2220i_Detect (Scsi_Host_Template *tpnt) { - int pci_index = 0; + int found = 0; + int installed = 0; struct Scsi_Host *pshost; PADAPTER2220I padapter; int unit; @@ -1667,174 +1796,223 @@ int setirq; UCHAR spigot1 = FALSE; UCHAR spigot2 = FALSE; +#if LINUX_VERSION_CODE > LINUXVERSION(2,1,92) + struct pci_dev *pdev = NULL; +#else + UCHAR pci_bus, pci_device_fn; +#endif - if ( pcibios_present () ) +#if LINUX_VERSION_CODE > LINUXVERSION(2,1,92) + if ( !pci_present () ) +#else + if ( !pcibios_present () ) +#endif { - for ( pci_index = 0; pci_index <= MAXADAPTER; ++pci_index ) - { - UCHAR pci_bus, pci_device_fn; + printk ("pci2220i: PCI BIOS not present\n"); + return 0; + } - if ( pcibios_find_device (VENDOR_PSI, DEVICE_DALE_1, pci_index, &pci_bus, &pci_device_fn) != 0 ) - break; +#if LINUX_VERSION_CODE > LINUXVERSION(2,1,92) + while ( (pdev = pci_find_device (VENDOR_PSI, DEVICE_DALE_1, pdev)) != NULL ) +#else + while ( !pcibios_find_device (VENDOR_PSI, DEVICE_DALE_1, found, &pci_bus, &pci_device_fn) ) +#endif + { + pshost = scsi_register (tpnt, sizeof(ADAPTER2220I)); + padapter = HOSTDATA(pshost); + memset (padapter, 0, sizeof (ADAPTER2220I)); - pshost = scsi_register (tpnt, sizeof(ADAPTER2220I)); - padapter = HOSTDATA(pshost); - memset (padapter, 0, sizeof (ADAPTER2220I)); - - pcibios_read_config_word (pci_bus, pci_device_fn, PCI_BASE_ADDRESS_1, &zs); - zs &= 0xFFFE; - padapter->basePort = zs; - padapter->regRemap = zs + RTR_LOCAL_REMAP; // 32 bit local space remap - padapter->regDesc = zs + RTR_REGIONS; // 32 bit local region descriptor - padapter->regRange = zs + RTR_LOCAL_RANGE; // 32 bit local range - padapter->regIrqControl = zs + RTR_INT_CONTROL_STATUS; // 16 bit interupt control and status - padapter->regScratchPad = zs + RTR_MAILBOX; // 16 byte scratchpad I/O base address - - pcibios_read_config_word (pci_bus, pci_device_fn, PCI_BASE_ADDRESS_2, &zs); - zs &= 0xFFFE; - padapter->regBase = zs; - padapter->regData = zs + REG_DATA; // data register I/O address - padapter->regError = zs + REG_ERROR; // error register I/O address - padapter->regSectCount = zs + REG_SECTOR_COUNT; // sector count register I/O address - padapter->regLba0 = zs + REG_LBA_0; // least significant byte of LBA - padapter->regLba8 = zs + REG_LBA_8; // next least significant byte of LBA - padapter->regLba16 = zs + REG_LBA_16; // next most significan byte of LBA - padapter->regLba24 = zs + REG_LBA_24; // head and most 4 significant bits of LBA - padapter->regStatCmd = zs + REG_STAT_CMD; // status on read and command on write register - padapter->regStatSel = zs + REG_STAT_SEL; // board status on read and spigot select on write register - padapter->regFail = zs + REG_FAIL; - padapter->regAltStat = zs + REG_ALT_STAT; - - padapter->regDmaDesc = zs + RTL_DMA1_DESC_PTR; // address of the DMA discriptor register for direction of transfer - padapter->regDmaCmdStat = zs + RTL_DMA_COMMAND_STATUS + 1; // Byte #1 of DMA command status register - padapter->regDmaAddrPci = zs + RTL_DMA1_PCI_ADDR; // 32 bit register for PCI address of DMA - padapter->regDmaAddrLoc = zs + RTL_DMA1_LOCAL_ADDR; // 32 bit register for local bus address of DMA - padapter->regDmaCount = zs + RTL_DMA1_COUNT; // 32 bit register for DMA transfer count - padapter->regDmaMode = zs + RTL_DMA1_MODE + 1; // 32 bit register for DMA mode control - - if ( !inb_p (padapter->regScratchPad + DALE_NUM_DRIVES) ) // if no devices on this board - goto unregister; - - pcibios_read_config_byte (pci_bus, pci_device_fn, PCI_INTERRUPT_LINE, &pshost->irq); - setirq = 1; - for ( z = 0; z < pci_index; z++ ) // scan for shared interrupts - { - if ( PsiHost[z]->irq == pshost->irq ) // if shared then, don't posses - setirq = 0; - } - if ( setirq ) // if not shared, posses +#if LINUX_VERSION_CODE > LINUXVERSION(2,1,92) + zs = pdev->base_address[1] & 0xFFFE; +#else + pcibios_read_config_word (pci_bus, pci_device_fn, PCI_BASE_ADDRESS_1, &zs); + zs &= 0xFFFE; +#endif + padapter->basePort = zs; + padapter->regRemap = zs + RTR_LOCAL_REMAP; // 32 bit local space remap + padapter->regDesc = zs + RTR_REGIONS; // 32 bit local region descriptor + padapter->regRange = zs + RTR_LOCAL_RANGE; // 32 bit local range + padapter->regIrqControl = zs + RTR_INT_CONTROL_STATUS; // 16 bit interupt control and status + padapter->regScratchPad = zs + RTR_MAILBOX; // 16 byte scratchpad I/O base address + +#if LINUX_VERSION_CODE > LINUXVERSION(2,1,92) + zs = pdev->base_address[2] & 0xFFFE; +#else + pcibios_read_config_word (pci_bus, pci_device_fn, PCI_BASE_ADDRESS_2, &zs); + zs &= 0xFFFE; +#endif + padapter->regBase = zs; + padapter->regData = zs + REG_DATA; // data register I/O address + padapter->regError = zs + REG_ERROR; // error register I/O address + padapter->regSectCount = zs + REG_SECTOR_COUNT; // sector count register I/O address + padapter->regLba0 = zs + REG_LBA_0; // least significant byte of LBA + padapter->regLba8 = zs + REG_LBA_8; // next least significant byte of LBA + padapter->regLba16 = zs + REG_LBA_16; // next most significan byte of LBA + padapter->regLba24 = zs + REG_LBA_24; // head and most 4 significant bits of LBA + padapter->regStatCmd = zs + REG_STAT_CMD; // status on read and command on write register + padapter->regStatSel = zs + REG_STAT_SEL; // board status on read and spigot select on write register + padapter->regFail = zs + REG_FAIL; + padapter->regAltStat = zs + REG_ALT_STAT; + + padapter->regDmaDesc = zs + RTL_DMA1_DESC_PTR; // address of the DMA discriptor register for direction of transfer + padapter->regDmaCmdStat = zs + RTL_DMA_COMMAND_STATUS + 1; // Byte #1 of DMA command status register + padapter->regDmaAddrPci = zs + RTL_DMA1_PCI_ADDR; // 32 bit register for PCI address of DMA + padapter->regDmaAddrLoc = zs + RTL_DMA1_LOCAL_ADDR; // 32 bit register for local bus address of DMA + padapter->regDmaCount = zs + RTL_DMA1_COUNT; // 32 bit register for DMA transfer count + padapter->regDmaMode = zs + RTL_DMA1_MODE + 1; // 32 bit register for DMA mode control + + if ( !inb_p (padapter->regScratchPad + DALE_NUM_DRIVES) ) // if no devices on this board + goto unregister; + +#if LINUX_VERSION_CODE > LINUXVERSION(2,1,92) + pshost->irq = pdev->irq; +#else + pcibios_read_config_byte (pci_bus, pci_device_fn, PCI_INTERRUPT_LINE, &pshost->irq); +#endif + setirq = 1; + for ( z = 0; z < installed; z++ ) // scan for shared interrupts + { + if ( PsiHost[z]->irq == pshost->irq ) // if shared then, don't posses + setirq = 0; + } + if ( setirq ) // if not shared, posses + { + if ( request_irq (pshost->irq, Irq_Handler, SA_SHIRQ, "pci2220i", padapter) < 0 ) { - if ( request_irq (pshost->irq, Irq_Handler, 0, "pci2220i", NULL) ) + if ( request_irq (pshost->irq, Irq_Handler, SA_INTERRUPT | SA_SHIRQ, "pci2220i", padapter) < 0 ) { - printk ("Unable to allocate IRQ for PSI-2220I controller.\n"); + printk ("Unable to allocate IRQ for PCI-2220I controller.\n"); goto unregister; } } - PsiHost[pci_index] = pshost; // save SCSI_HOST pointer - - pshost->unique_id = padapter->regBase; - pshost->max_id = 4; - - outb_p (0x01, padapter->regRange); // fix our range register because other drivers want to tromp on it - - padapter->timingMode = inb_p (padapter->regScratchPad + DALE_TIMING_MODE); - if ( padapter->timingMode >= 2 ) - padapter->timingAddress = ModeArray[padapter->timingMode - 2]; - else - padapter->timingPIO = TRUE; + padapter->irqOwned = pshost->irq; // set IRQ as owned + } + padapter->kBuffer = kmalloc (SECTORSXFER * BYTES_PER_SECTOR, GFP_DMA | GFP_ATOMIC); + if ( !padapter->kBuffer ) + { + printk ("Unable to allocate DMA buffer for PCI-2220I controller.\n"); +#if LINUX_VERSION_CODE < LINUXVERSION(1,3,70) + free_irq (pshost->irq); +#else /* version >= v1.3.70 */ + free_irq (pshost->irq, padapter); +#endif /* version >= v1.3.70 */ + goto unregister; + } + PsiHost[installed] = pshost; // save SCSI_HOST pointer + + pshost->io_port = padapter->basePort; + pshost->n_io_port = 0xFF; + pshost->unique_id = padapter->regBase; + pshost->max_id = 4; + + outb_p (0x01, padapter->regRange); // fix our range register because other drivers want to tromp on it + + padapter->timingMode = inb_p (padapter->regScratchPad + DALE_TIMING_MODE); + if ( padapter->timingMode >= 2 ) + padapter->timingAddress = ModeArray[padapter->timingMode - 2]; + else + padapter->timingPIO = TRUE; - ReadFlash (padapter, &DaleSetup, DALE_FLASH_SETUP, sizeof (SETUP)); - for ( z = 0; z < inb_p (padapter->regScratchPad + DALE_NUM_DRIVES); ++z ) - { - unit = inb_p (padapter->regScratchPad + DALE_CHANNEL_DEVICE_0 + z) & 0x0F; - padapter->device[z].device = inb_p (padapter->regScratchPad + DALE_SCRATH_DEVICE_0 + unit); - padapter->device[z].byte6 = (UCHAR)(((unit & 1) << 4) | 0xE0); - padapter->device[z].spigot = (UCHAR)(1 << (unit >> 1)); - padapter->device[z].sectors = DaleSetup.setupDevice[unit].sectors; - padapter->device[z].heads = DaleSetup.setupDevice[unit].heads; - padapter->device[z].cylinders = DaleSetup.setupDevice[unit].cylinders; - padapter->device[z].blocks = DaleSetup.setupDevice[unit].blocks; - - if ( !z ) - { - ReadFlash (padapter, &DiskMirror, DALE_FLASH_RAID, sizeof (DiskMirror)); - DiskMirror[0].status = inb_p (padapter->regScratchPad + DALE_RAID_0_STATUS); - DiskMirror[1].status = inb_p (padapter->regScratchPad + DALE_RAID_1_STATUS); - if ( (DiskMirror[0].signature == SIGNATURE) && (DiskMirror[1].signature == SIGNATURE) && - (DiskMirror[0].pairIdentifier == (DiskMirror[1].pairIdentifier ^ 1)) ) - { - raidon = TRUE; - } - - memcpy (padapter->device[z].DiskMirror, DiskMirror, sizeof (DiskMirror)); - padapter->raidData[0] = &padapter->device[z].DiskMirror[0]; - padapter->raidData[2] = &padapter->device[z].DiskMirror[1]; + ReadFlash (padapter, &DaleSetup, DALE_FLASH_SETUP, sizeof (SETUP)); + for ( z = 0; z < inb_p (padapter->regScratchPad + DALE_NUM_DRIVES); ++z ) + { + unit = inb_p (padapter->regScratchPad + DALE_CHANNEL_DEVICE_0 + z) & 0x0F; + padapter->device[z].device = inb_p (padapter->regScratchPad + DALE_SCRATH_DEVICE_0 + unit); + padapter->device[z].byte6 = (UCHAR)(((unit & 1) << 4) | 0xE0); + padapter->device[z].spigot = (UCHAR)(1 << (unit >> 1)); + padapter->device[z].sectors = DaleSetup.setupDevice[unit].sectors; + padapter->device[z].heads = DaleSetup.setupDevice[unit].heads; + padapter->device[z].cylinders = DaleSetup.setupDevice[unit].cylinders; + padapter->device[z].blocks = DaleSetup.setupDevice[unit].blocks; + + if ( !z ) + { + ReadFlash (padapter, &DiskMirror, DALE_FLASH_RAID, sizeof (DiskMirror)); + DiskMirror[0].status = inb_p (padapter->regScratchPad + DALE_RAID_0_STATUS); + DiskMirror[1].status = inb_p (padapter->regScratchPad + DALE_RAID_1_STATUS); + if ( (DiskMirror[0].signature == SIGNATURE) && (DiskMirror[1].signature == SIGNATURE) && + (DiskMirror[0].pairIdentifier == (DiskMirror[1].pairIdentifier ^ 1)) ) + { + raidon = TRUE; + } + + memcpy (padapter->device[z].DiskMirror, DiskMirror, sizeof (DiskMirror)); + padapter->raidData[0] = &padapter->device[z].DiskMirror[0]; + padapter->raidData[2] = &padapter->device[z].DiskMirror[1]; - if ( raidon ) - { - padapter->device[z].lastsectorlba[0] = InlineIdentify (padapter, 1, 0); - padapter->device[z].lastsectorlba[1] = InlineIdentify (padapter, 2, 0); + if ( raidon ) + { + padapter->device[z].lastsectorlba[0] = InlineIdentify (padapter, 1, 0); + padapter->device[z].lastsectorlba[1] = InlineIdentify (padapter, 2, 0); - if ( !(DiskMirror[1].status & UCBF_SURVIVOR) && padapter->device[z].lastsectorlba[0] ) - spigot1 = TRUE; - if ( !(DiskMirror[0].status & UCBF_SURVIVOR) && padapter->device[z].lastsectorlba[1] ) - spigot2 = TRUE; - if ( DiskMirror[0].status & UCBF_SURVIVOR & DiskMirror[1].status & UCBF_SURVIVOR ) - spigot1 = TRUE; + if ( !(DiskMirror[1].status & UCBF_SURVIVOR) && padapter->device[z].lastsectorlba[0] ) + spigot1 = TRUE; + if ( !(DiskMirror[0].status & UCBF_SURVIVOR) && padapter->device[z].lastsectorlba[1] ) + spigot2 = TRUE; + if ( DiskMirror[0].status & UCBF_SURVIVOR & DiskMirror[1].status & UCBF_SURVIVOR ) + spigot1 = TRUE; + + if ( spigot1 && (DiskMirror[0].status & UCBF_REBUILD) ) + InlineReadSignature (padapter, &padapter->device[z], 0); + if ( spigot2 && (DiskMirror[1].status & UCBF_REBUILD) ) + InlineReadSignature (padapter, &padapter->device[z], 1); - if ( spigot1 && spigot2 ) + if ( spigot1 && spigot2 ) + { + padapter->device[z].raid = 1; + if ( DiskMirror[0].status & UCBF_REBUILD ) + padapter->device[z].spigot = 2; + else + padapter->device[z].spigot = 1; + if ( (DiskMirror[0].status & UCBF_REBUILD) || (DiskMirror[1].status & UCBF_REBUILD) ) + { + padapter->reconOn = padapter->reconIsStarting = TRUE; + } + } + else + { + if ( spigot1 ) { - padapter->device[z].raid = 1; if ( DiskMirror[0].status & UCBF_REBUILD ) - padapter->device[z].spigot = 2; - else - padapter->device[z].spigot = 1; - if ( (DiskMirror[0].status & UCBF_REBUILD) || (DiskMirror[1].status & UCBF_REBUILD) ) - { - padapter->reconOn = padapter->reconIsStarting = TRUE; - } + goto unregister; + DiskMirror[0].status = UCBF_MIRRORED | UCBF_SURVIVOR; + padapter->device[z].spigot = 1; } else { - if ( spigot1 ) - { - if ( DiskMirror[0].status & UCBF_REBUILD ) - goto unregister; - DiskMirror[0].status = UCBF_MIRRORED | UCBF_SURVIVOR; - padapter->device[z].spigot = 1; - } - else - { - if ( DiskMirror[1].status & UCBF_REBUILD ) - goto unregister; - DiskMirror[1].status = UCBF_MIRRORED | UCBF_SURVIVOR; - padapter->device[z].spigot = 2; - } - if ( DaleSetup.rebootRebuil ) - padapter->reconOn = padapter->reconIsStarting = TRUE; + if ( DiskMirror[1].status & UCBF_REBUILD ) + goto unregister; + DiskMirror[1].status = UCBF_MIRRORED | UCBF_SURVIVOR; + padapter->device[z].spigot = 2; } - - break; + if ( DaleSetup.rebootRebuil ) + padapter->reconOn = padapter->reconIsStarting = TRUE; } + + break; } } + } - init_timer (&padapter->timer); - padapter->timer.function = TimerExpiry; - padapter->timer.data = (unsigned long)padapter; - init_timer (&padapter->reconTimer); - padapter->reconTimer.function = ReconTimerExpiry; - padapter->reconTimer.data = (unsigned long)padapter; - printk("\nPCI-2220I EIDE CONTROLLER: at I/O = %X/%X IRQ = %d\n", padapter->basePort, padapter->regBase, pshost->irq); - printk("Version %s, Compiled %s %s\n\n", PCI2220I_VERSION, __DATE__, __TIME__); - NumAdapters++; + init_timer (&padapter->timer); + padapter->timer.function = TimerExpiry; + padapter->timer.data = (unsigned long)padapter; + init_timer (&padapter->reconTimer); + padapter->reconTimer.function = ReconTimerExpiry; + padapter->reconTimer.data = (unsigned long)padapter; + printk("\nPCI-2220I EIDE CONTROLLER: at I/O = %X/%X IRQ = %d\n", padapter->basePort, padapter->regBase, pshost->irq); + printk("Version %s, Compiled %s %s\n\n", PCI2220I_VERSION, __DATE__, __TIME__); + found++; + if ( ++installed < MAXADAPTER ) continue; + break;; unregister:; - scsi_unregister (pshost); - } + scsi_unregister (pshost); + found++; } - return NumAdapters; + NumAdapters = installed; + return installed; } /**************************************************************** * Name: Pci2220i_Abort @@ -1868,6 +2046,47 @@ int Pci2220i_Reset (Scsi_Cmnd *SCpnt, unsigned int reset_flags) { return SCSI_RESET_PUNT; + } +/**************************************************************** + * Name: Pci2220i_Release + * + * Description: Release resources allocated for a single each adapter. + * + * Parameters: pshost - Pointer to SCSI command structure. + * + * Returns: zero. + * + ****************************************************************/ +int Pci2220i_Release (struct Scsi_Host *pshost) + { + PADAPTER2220I padapter = HOSTDATA (pshost); + + if ( padapter->reconOn ) + { + padapter->reconOn = FALSE; // shut down the hot reconstruct + if ( padapter->reconPhase ) + udelay (300000); + if ( padapter->reconTimer.data ) // is the timer running? + { + del_timer (&padapter->reconTimer); + padapter->reconTimer.data = 0; + } + } + + // save RAID status on the board + outb_p (DiskMirror[0].status, padapter->regScratchPad + DALE_RAID_0_STATUS); + outb_p (DiskMirror[1].status, padapter->regScratchPad + DALE_RAID_1_STATUS); + + if ( padapter->irqOwned ) +#if LINUX_VERSION_CODE < LINUXVERSION(1,3,70) + free_irq (pshost->irq); +#else /* version >= v1.3.70 */ + free_irq (pshost->irq, padapter); +#endif /* version >= v1.3.70 */ + release_region (pshost->io_port, pshost->n_io_port); + kfree (padapter->kBuffer); + scsi_unregister(pshost); + return 0; } #include "sd.h" diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/pci2220i.h linux/drivers/scsi/pci2220i.h --- v2.2.5/linux/drivers/scsi/pci2220i.h Tue Mar 23 14:35:48 1999 +++ linux/drivers/scsi/pci2220i.h Fri Apr 16 14:28:53 1999 @@ -1,33 +1,34 @@ -/*+M************************************************************************* - * Perceptive Solutions, Inc. PCI-2000 device driver proc support for Linux. +/**************************************************************************** + * Perceptive Solutions, Inc. PCI-2220I device driver for Linux. * - * Copyright (c) 1999 Perceptive Solutions, Inc. + * pci2220i.h - Linux Host Driver for PCI-2220i EIDE Adapters * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Copyright (c) 1997-1999 Perceptive Solutions, Inc. + * All Rights Reserved. * - * 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. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that redistributions of source + * code retain the above copyright notice and this comment without + * modification. * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * Technical updates and product information at: + * http://www.psidisk.com * + * Please send questions, comments, bug reports to: + * tech@psidisk.com Technical Support * - * File Name: pci2220i.h - * - * Description: Header file for the SCSI driver for the PCI2220I - * EIDE interface card. - * - *-M*************************************************************************/ + ****************************************************************************/ +#ifndef _PCI2220I_H +#define _PCI2220I_H #ifndef PSI_EIDE_SCSIOP #define PSI_EIDE_SCSIOP 1 +#ifndef LINUX_VERSION_CODE +#include +#endif +#define LINUXVERSION(v,p,s) (((v)<<16) + ((p)<<8) + (s)) + /************************************************/ /* Some defines that we like */ /************************************************/ @@ -281,10 +282,11 @@ // function prototypes int Pci2220i_Detect (Scsi_Host_Template *tpnt); -int Pci2220i_Command (Scsi_Cmnd *SCpnt); +int Pci2220i_Command (Scsi_Cmnd *SCpnt); int Pci2220i_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)); int Pci2220i_Abort (Scsi_Cmnd *SCpnt); int Pci2220i_Reset (Scsi_Cmnd *SCpnt, unsigned int flags); +int Pci2220i_Release (struct Scsi_Host *pshost); int Pci2220i_BiosParam (Disk *disk, kdev_t dev, int geom[]); #ifndef NULL @@ -293,12 +295,43 @@ extern struct proc_dir_entry Proc_Scsi_Pci2220i; +#if LINUX_VERSION_CODE >= LINUXVERSION(2,1,75) +#define PCI2220I { \ + next: NULL, \ + module: NULL, \ + proc_dir: &Proc_Scsi_Pci2220i, \ + proc_info: NULL, /* let's not bloat the kernel */\ + name: "PCI-2220I EIDE Disk Controller", \ + detect: Pci2220i_Detect, \ + release: Pci2220i_Release, \ + info: NULL, /* let's not bloat the kernel */\ + command: Pci2220i_Command, \ + queuecommand: Pci2220i_QueueCommand, \ + eh_strategy_handler: NULL, \ + eh_abort_handler: NULL, \ + eh_device_reset_handler: NULL, \ + eh_bus_reset_handler: NULL, \ + eh_host_reset_handler: NULL, \ + abort: Pci2220i_Abort, \ + reset: Pci2220i_Reset, \ + slave_attach: NULL, \ + bios_param: Pci2220i_BiosParam, \ + can_queue: 1, \ + this_id: -1, \ + sg_tablesize: SG_NONE, \ + cmd_per_lun: 1, \ + present: 0, \ + unchecked_isa_dma: 0, \ + use_clustering: DISABLE_CLUSTERING, \ + use_new_eh_code: 0 \ + } +#else #define PCI2220I { NULL, NULL, \ &Proc_Scsi_Pci2220i,/* proc_dir_entry */\ NULL, \ "PCI-2220I EIDE Disk Controller", \ Pci2220i_Detect, \ - NULL, \ + Pci2220i_Release, \ NULL, \ Pci2220i_Command, \ Pci2220i_QueueCommand, \ @@ -313,4 +346,6 @@ 0, \ 0, \ DISABLE_CLUSTERING } +#endif +#endif diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/psi240i.c linux/drivers/scsi/psi240i.c --- v2.2.5/linux/drivers/scsi/psi240i.c Wed Sep 9 14:51:09 1998 +++ linux/drivers/scsi/psi240i.c Tue Apr 13 07:54:02 1999 @@ -129,7 +129,7 @@ outsw (pports[PORT_DATA], padapter->buffer, (USHORT)padapter->ide.ide.ide[2] * 256); return 0; } - } while ( timer > jiffies ); // test for timeout + } while ( time_after(timer, jiffies) ); // test for timeout padapter->ide.ide.ides.cmd = 0; // null out the command byte return 1; @@ -169,7 +169,7 @@ return 0; } - } while ( timer > jiffies ); // test for timeout + } while ( time_after(timer, jiffies) ); // test for timeout padapter->ide.ide.ides.cmd = 0; // null out the command byte return status; @@ -264,7 +264,7 @@ UCHAR status; int z; - DEB(printk ("\npsi240i recieved interrupt\n")); + DEB(printk ("\npsi240i received interrupt\n")); shost = PsiHost[irq - 10]; if ( !shost ) diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/psi_dale.h linux/drivers/scsi/psi_dale.h --- v2.2.5/linux/drivers/scsi/psi_dale.h Tue Mar 23 14:35:48 1999 +++ linux/drivers/scsi/psi_dale.h Tue Apr 13 07:54:02 1999 @@ -1,29 +1,23 @@ -/*+M************************************************************************* - * Perceptive Solutions, Inc. PCI-2000 device driver proc support for Linux. +/**************************************************************************** + * Perceptive Solutions, Inc. PCI-2220I device driver for Linux. * - * Copyright (c) 1999 Perceptive Solutions, Inc. + * psi_dalei.h - Linux Host Driver for PCI-2220i EIDE Adapters * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Copyright (c) 1997-1999 Perceptive Solutions, Inc. + * All Rights Reserved. * - * 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. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that redistributions of source + * code retain the above copyright notice and this comment without + * modification. * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * Technical updates and product information at: + * http://www.psidisk.com * + * Please send questions, comments, bug reports to: + * tech@psidisk.com Technical Support * - * File Name: psi_dale.h - * - * Description: This file contains the interface defines and - * error codes. - * - *-M*************************************************************************/ + ****************************************************************************/ /************************************************/ /* Dale PCI setup */ diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/psi_roy.h linux/drivers/scsi/psi_roy.h --- v2.2.5/linux/drivers/scsi/psi_roy.h Tue Mar 23 14:35:48 1999 +++ linux/drivers/scsi/psi_roy.h Tue Apr 13 07:54:02 1999 @@ -1,29 +1,23 @@ -/*+M************************************************************************* - * Perceptive Solutions, Inc. PCI-2000 device driver proc support for Linux. +/**************************************************************************** + * Perceptive Solutions, Inc. PCI-2000 device driver for Linux. * - * Copyright (c) 1997 Perceptive Solutions, Inc. + * psi_roy.h - Linux Host Driver for PCI-2000 IntelliCache SCSI Adapters * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Copyright (c) 1997-1999 Perceptive Solutions, Inc. + * All Rights Reserved. * - * 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. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that redistributions of source + * code retain the above copyright notice and this comment without + * modification. * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * Technical updates and product information at: + * http://www.psidisk.com * + * Please send questions, comments, bug reports to: + * tech@psidisk.com Technical Support * - * File Name: psi_roy.h - * - * Description: This file contains the host interface command and - * error codes. - * - *-M*************************************************************************/ + ****************************************************************************/ #ifndef ROY_HOST #define ROY_HOST diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/qlogicfc.c linux/drivers/scsi/qlogicfc.c --- v2.2.5/linux/drivers/scsi/qlogicfc.c Wed Mar 10 15:29:47 1999 +++ linux/drivers/scsi/qlogicfc.c Thu Apr 15 05:42:43 1999 @@ -64,12 +64,13 @@ /* Configuration section **************************************************** */ /* Set the following macro to 1 to reload the ISP2100's firmware. This is - version 1.13 of the firmware. */ + version 1.15.19 of the firmware. */ #define RELOAD_FIRMWARE 1 #define USE_NVRAM_DEFAULTS 1 +#define ISP2100_PORTDB 1 /* Set the following to 1 to include fabric support, fabric support is * currently not as well tested as the other aspects of the driver */ @@ -316,16 +317,13 @@ /* status entry completion status definitions */ #define CS_COMPLETE 0x0000 -#define CS_INCOMPLETE 0x0001 #define CS_DMA_ERROR 0x0002 -#define CS_TRANSPORT_ERROR 0x0003 #define CS_RESET_OCCURRED 0x0004 #define CS_ABORTED 0x0005 #define CS_TIMEOUT 0x0006 #define CS_DATA_OVERRUN 0x0007 -#define CS_ABORT_MSG_FAILED 0x000e -#define CS_REJECT_MSG_FAILED 0x000f #define CS_DATA_UNDERRUN 0x0015 +#define CS_QUEUE_FULL 0x001c #define CS_PORT_UNAVAILABLE 0x0028 #define CS_PORT_LOGGED_OUT 0x0029 #define CS_PORT_CONFIG_CHANGED 0x002a @@ -645,9 +643,7 @@ static void isp2100_print_scsi_cmd(Scsi_Cmnd *); #endif -#if DEBUG_ISP2100_INTR static void isp2100_print_status_entry(struct Status_Entry *); -#endif static struct proc_dir_entry proc_scsi_isp2100 = { @@ -721,7 +717,7 @@ scsi_unregister(host); continue; } - host->this_id = tmpt->this_id; + host->this_id = 0; if (request_irq(host->irq, do_isp2100_intr_handler, SA_INTERRUPT | SA_SHIRQ, "qlogicfc", host)) { printk("qlogicfc : interrupt %d already in use\n", @@ -743,7 +739,7 @@ outw(HCCR_CLEAR_RISC_INTR, host->io_port + HOST_HCCR); isp2100_enable_irqs(host); /* wait for the loop to come up */ - for (wait_time = jiffies + 20 * HZ; wait_time > jiffies && hostdata->loop_up == 0;) + for (wait_time = jiffies + 10 * HZ; wait_time > jiffies && hostdata->loop_up == 0;) barrier(); if (hostdata->loop_up == 0) { @@ -805,13 +801,17 @@ isp2100_mbox_command(host, param); if (param[0] == MBOX_COMMAND_COMPLETE) { - host->this_id = param[1]; hostdata->port_id = ((u_int) param[3]) << 16; hostdata->port_id |= param[2]; + temp[0].loop_id = param[1]; + temp[0].wwn = hostdata->wwn; + } + else { + printk("qlogicfc: error getting scsi id.\n"); } - for (i = 0, j = 0; i <= QLOGICFC_MAX_ID; i++) { - temp[i].loop_id = host->this_id; + for (i = 1, j = 1; i <= QLOGICFC_MAX_ID; i++) { + temp[i].loop_id = temp[0].loop_id; param[0] = MBOX_GET_PORT_NAME; param[1] = (i << 8) & 0xff00; @@ -848,7 +848,7 @@ } } if (j == QLOGICFC_MAX_ID + 1) - hostdata->port_db[i].loop_id = host->this_id; + hostdata->port_db[i].loop_id = temp[0].loop_id; for (j = 0; j <= QLOGICFC_MAX_ID; j++) { if (hostdata->port_db[j].wwn == temp[i].wwn || !hostdata->port_db[j].wwn) { @@ -1046,6 +1046,7 @@ host->max_id = 0; return 0; } + out_ptr = inw(host->io_port + MBOX4); in_ptr = hostdata->req_in_ptr; @@ -1099,10 +1100,13 @@ cmd->hdr.entry_type = ENTRY_COMMAND; cmd->hdr.entry_cnt = 1; cmd->target_lun = Cmnd->lun; +#if ISP2100_PORTDB cmd->target_id = hostdata->port_db[Cmnd->target].loop_id; +#else + cmd->target_id = Cmnd->target; +#endif cmd->total_byte_cnt = (u_int) Cmnd->request_bufflen; - cmd->time_out = SCSI_TIMEOUT / HZ; - + cmd->time_out = (SCSI_TIMEOUT / HZ) * 5; memcpy(cmd->cdb, Cmnd->cmnd, Cmnd->cmd_len); if (Cmnd->use_sg) { @@ -1173,41 +1177,38 @@ if (Cmnd->device->tagged_supported) { - switch (Cmnd->tag) { - case SIMPLE_QUEUE_TAG: - cmd->control_flags |= CFLAG_SIMPLE_TAG; - break; - case HEAD_OF_QUEUE_TAG: - cmd->control_flags |= CFLAG_HEAD_TAG; - break; - case ORDERED_QUEUE_TAG: + if ((jiffies - hostdata->tag_ages[Cmnd->target]) > (2 * SCSI_TIMEOUT)) { cmd->control_flags |= CFLAG_ORDERED_TAG; - break; - default: - if ((jiffies - hostdata->tag_ages[Cmnd->target]) > (5 * HZ)) { + hostdata->tag_ages[Cmnd->target] = jiffies; + } else + switch (Cmnd->tag) { + case HEAD_OF_QUEUE_TAG: + cmd->control_flags |= CFLAG_HEAD_TAG; + break; + case ORDERED_QUEUE_TAG: cmd->control_flags |= CFLAG_ORDERED_TAG; - hostdata->tag_ages[Cmnd->target] = jiffies; - } else + break; + default: cmd->control_flags |= CFLAG_SIMPLE_TAG; + break; } } outw(in_ptr, host->io_port + MBOX4); hostdata->req_in_ptr = in_ptr; hostdata->queued++; - num_free = QLOGICFC_REQ_QUEUE_LEN - REQ_QUEUE_DEPTH(in_ptr, out_ptr); - num_free = num_free - 2; + num_free = (num_free > 2) ? num_free - 2 : 0; host->can_queue = hostdata->queued + num_free; if (host->can_queue > QLOGICFC_REQ_QUEUE_LEN) host->can_queue = QLOGICFC_REQ_QUEUE_LEN; host->sg_tablesize = QLOGICFC_MAX_SG(num_free); /* this is really gross */ - if (host->can_queue < host->host_busy){ + if (host->can_queue <= host->host_busy){ if (host->can_queue+2 < host->host_busy) - printk("qlogicfc.c crosses its fingers.\n"); - host->can_queue = host->host_busy; + DEBUG(printk("qlogicfc.c crosses its fingers.\n")); + host->can_queue = host->host_busy + 1; } LEAVE("isp2100_queuecommand"); @@ -1310,22 +1311,20 @@ while (out_ptr != in_ptr) { sts = (struct Status_Entry *) &hostdata->res[out_ptr][0]; out_ptr = (out_ptr + 1) & RES_QUEUE_LEN; - Cmnd = hostdata->handle_ptrs[sts->handle]; - - hostdata->handle_ptrs[sts->handle] = NULL; - - if (hostdata->handle_serials[sts->handle] != Cmnd->serial_number) { - hostdata->queued--; - hostdata->handle_serials[sts->handle] = 0; - outw(out_ptr, host->io_port + MBOX5); - continue; - } - hostdata->handle_serials[sts->handle] = 0; - + TRACE("done", out_ptr, Cmnd); DEBUG_INTR(isp2100_print_status_entry(sts)); if (sts->hdr.entry_type == ENTRY_STATUS) { + Cmnd = hostdata->handle_ptrs[sts->handle]; Cmnd->result = isp2100_return_status(sts); + hostdata->handle_ptrs[sts->handle] = NULL; + hostdata->queued--; + if (hostdata->handle_serials[sts->handle] != Cmnd->serial_number) { + hostdata->handle_serials[sts->handle] = 0; + outw(out_ptr, host->io_port + MBOX5); + continue; + } + hostdata->handle_serials[sts->handle] = 0; } else { outw(out_ptr, host->io_port + MBOX5); continue; @@ -1336,13 +1335,13 @@ || (sts->status_flags & STF_BUS_RESET)) hostdata->send_marker = 1; + memset(Cmnd->sense_buffer, 0, sizeof(Cmnd->sense_buffer)); if (sts->scsi_status & 0x0200) memcpy(Cmnd->sense_buffer, sts->req_sense_data, sizeof(Cmnd->sense_buffer)); outw(out_ptr, host->io_port + MBOX5); - hostdata->queued--; if (Cmnd->scsi_done != NULL) { (*Cmnd->scsi_done) (Cmnd); } else @@ -1356,16 +1355,16 @@ in_ptr = hostdata->req_in_ptr; num_free = QLOGICFC_REQ_QUEUE_LEN - REQ_QUEUE_DEPTH(in_ptr, out_ptr); - num_free = num_free-2; + num_free = (num_free > 2) ? num_free - 2 : 0; host->can_queue = hostdata->queued + num_free; if (host->can_queue > QLOGICFC_REQ_QUEUE_LEN) host->can_queue = QLOGICFC_REQ_QUEUE_LEN; host->sg_tablesize = QLOGICFC_MAX_SG(num_free); - if (host->can_queue < host->host_busy){ + if (host->can_queue <= host->host_busy){ if (host->can_queue+2 < host->host_busy) DEBUG(printk("qlogicfc crosses its fingers.\n")); - host->can_queue = host->host_busy; + host->can_queue = host->host_busy + 1; } outw(HCCR_CLEAR_RISC_INTR, host->io_port + HOST_HCCR); @@ -1401,16 +1400,7 @@ case CS_COMPLETE: host_status = DID_OK; break; - case CS_INCOMPLETE: - if (!(sts->state_flags & SF_SENT_CDB)) - host_status = DID_ERROR; - else if (!(sts->state_flags & SF_TRANSFERRED_DATA)) - host_status = DID_ERROR; - else if (!(sts->state_flags & SF_GOT_STATUS)) - host_status = DID_ERROR; - break; case CS_DMA_ERROR: - case CS_TRANSPORT_ERROR: host_status = DID_ERROR; break; case CS_RESET_OCCURRED: @@ -1423,7 +1413,6 @@ host_status = DID_TIME_OUT; break; case CS_DATA_OVERRUN: - case CS_ABORT_MSG_FAILED: host_status = DID_ERROR; break; case CS_DATA_UNDERRUN: @@ -1434,6 +1423,9 @@ case CS_PORT_CONFIG_CHANGED: host_status = DID_BAD_TARGET; break; + case CS_QUEUE_FULL: + host_status = DID_ERROR; + break; default: printk("qlogicfc : unknown completion status 0x%04x\n", sts->completion_status); @@ -1539,8 +1531,6 @@ ip[0] = 255; ip[1] = 63; ip[2] = size / (ip[0] * ip[1]); - if (ip[2] > 1023) - ip[2] = 1023; } LEAVE("isp2100_biosparam"); @@ -1678,9 +1668,6 @@ if (isp2100_read_nvram_word(host, 0) != 0x5349) return 1; - control_block->max_frame_len = isp2100_read_nvram_word(host, 5); - control_block->max_iocb = isp2100_read_nvram_word(host, 6); - control_block->exec_throttle = isp2100_read_nvram_word(host, 7); value = isp2100_read_nvram_word(host, 8); control_block->node_name[0] = isp2100_read_nvram_word(host, 9); control_block->node_name[1] = isp2100_read_nvram_word(host, 10); @@ -1892,8 +1879,6 @@ } -#if DEBUG_ISP2100_INTR - void isp2100_print_status_entry(struct Status_Entry *status) { printk("qlogicfc : entry count = 0x%02x, type = 0x%02x, flags = 0x%02x\n", @@ -1908,7 +1893,6 @@ } -#endif /* DEBUG_ISP2100_INTR */ #if DEBUG_ISP2100 diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/qlogicfc_asm.c linux/drivers/scsi/qlogicfc_asm.c --- v2.2.5/linux/drivers/scsi/qlogicfc_asm.c Wed Mar 10 15:29:47 1999 +++ linux/drivers/scsi/qlogicfc_asm.c Thu Apr 15 05:42:43 1999 @@ -3,2983 +3,3290 @@ * --- ISP2100 Fabric Initiator/Target Firmware --- * * * * * - * * + ************************************************************************ + * * + * NOTICE * + * * + * COPYRIGHT 1998 QLOGIC CORPORATION * + * ALL RIGHTS RESERVED * + * * ************************************************************************ */ + /* - * Firmware Version 1.13.00 (18:06 May 04, 1998) + * Firmware Version 1.15.19 (14:58 Jan 19, 1999) */ -unsigned short risc_code_version = 1*1024+13; +unsigned short risc_code_version = 1*1024+15; + +unsigned char firmware_version[] = {1,15,19}; -unsigned char firmware_version[] = {1,13,0}; +#define FW_VERSION_STRING "1.15.19" unsigned short risc_code_addr01 = 0x1000 ; unsigned short risc_code01[] = { - 0x0078, 0x1029, 0x0000, 0x5c95, 0x0000, 0x2043, 0x4f50, 0x5952, + 0x0078, 0x1029, 0x0000, 0x65e6, 0x0000, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2031, 0x3939, 0x3620, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350, 0x3231, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056, - 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3133, 0x2020, 0x2020, - 0x2400, 0x20c1, 0x0021, 0x20a1, 0x6c95, 0x2009, 0x0000, 0x20a9, - 0x076b, 0x41a4, 0x3400, 0x20c9, 0x71ff, 0x2091, 0x2000, 0x2059, - 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x1e36, 0x2051, 0x6d00, - 0x2a70, 0x705b, 0x8c00, 0x705f, 0xffff, 0x7057, 0x8bf9, 0x7063, - 0x0300, 0x1078, 0x1264, 0x20a1, 0x7400, 0x715c, 0x810d, 0x810d, + 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3135, 0x2020, 0x2020, + 0x2400, 0x20c1, 0x0021, 0x20a1, 0x75e6, 0x2009, 0x0000, 0x20a9, + 0x071a, 0x41a4, 0x3400, 0x20c9, 0x7aff, 0x2091, 0x2000, 0x2059, + 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x20a0, 0x2051, 0x7600, + 0x2a70, 0x705b, 0x9500, 0x705f, 0xffff, 0x7057, 0x94f9, 0x7063, + 0x0300, 0x1078, 0x1282, 0x20a1, 0x7d00, 0x715c, 0x810d, 0x810d, 0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0007, 0xa112, 0xa00e, 0x21a8, 0x41a4, 0x3400, 0x8211, 0x00c0, 0x1058, 0x715c, 0x3400, 0xa102, 0x0040, 0x1068, 0x0048, 0x1068, 0x20a8, 0xa00e, 0x41a4, - 0x1078, 0x122b, 0x1078, 0x134e, 0x1078, 0x14d3, 0x1078, 0x17d7, - 0x1078, 0x324a, 0x1078, 0x54fc, 0x1078, 0x12d9, 0x1078, 0x2191, - 0x1078, 0x3875, 0x1078, 0x3655, 0x1078, 0x4064, 0x1078, 0x1c35, - 0x1078, 0x4213, 0x1078, 0x3d73, 0x1078, 0x1b5d, 0x1078, 0x1c14, + 0x1078, 0x1249, 0x1078, 0x136e, 0x1078, 0x14f3, 0x1078, 0x19c8, + 0x1078, 0x3615, 0x1078, 0x5b94, 0x1078, 0x12f9, 0x1078, 0x242f, + 0x1078, 0x3c56, 0x1078, 0x3a2e, 0x1078, 0x4494, 0x1078, 0x1e5b, + 0x1078, 0x46d3, 0x1078, 0x4174, 0x1078, 0x1d7a, 0x1078, 0x1e3a, 0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x109d, 0x7820, 0xa086, 0x0002, 0x00c0, 0x109d, 0x7823, 0x4000, 0x0068, 0x1095, 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000, 0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000, 0xa08e, 0x0003, - 0x00c0, 0x10bd, 0x1078, 0x2a96, 0x1078, 0x21b9, 0x1078, 0x38c5, - 0x1078, 0x373c, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, - 0x10c1, 0x1078, 0x4078, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078, - 0x10aa, 0x1078, 0x52d8, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x1151, - 0x10cd, 0x11aa, 0x1228, 0x1229, 0x122a, 0x1078, 0x12b7, 0x007c, - 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2aec, 0x2079, 0x0100, - 0x7844, 0xa005, 0x00c0, 0x1142, 0x2011, 0x318e, 0x1078, 0x40d1, + 0x00c0, 0x10bd, 0x1078, 0x2d8d, 0x1078, 0x2457, 0x1078, 0x3ca6, + 0x1078, 0x3b19, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, + 0x10c1, 0x1078, 0x44ac, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078, + 0x10aa, 0x1078, 0x5866, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x114b, + 0x10cd, 0x11c6, 0x1246, 0x1247, 0x1248, 0x1078, 0x12d5, 0x007c, + 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2eb2, 0x2079, 0x0100, + 0x7844, 0xa005, 0x00c0, 0x113c, 0x2011, 0x3542, 0x1078, 0x456e, 0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, 0x8010, - 0x73b8, 0x1078, 0x2a53, 0x1078, 0x5129, 0x2011, 0x0004, 0x1078, - 0x6135, 0x1078, 0x35ef, 0x70c7, 0x0000, 0x70bf, 0x0000, 0x70c3, - 0x0000, 0x1078, 0x1145, 0x2011, 0x0000, 0x2079, 0x6d51, 0x7804, + 0x73b8, 0x1078, 0x2d4a, 0x1078, 0x56b1, 0x2011, 0x0004, 0x1078, + 0x6953, 0x1078, 0x39c8, 0x70c7, 0x0000, 0x70bf, 0x0000, 0x70c3, + 0x0000, 0x1078, 0x113f, 0x2011, 0x0000, 0x2079, 0x7651, 0x7804, 0xd0ac, 0x0040, 0x1104, 0xc295, 0x70a4, 0xa005, 0x0040, 0x1109, 0xc29d, 0x72be, 0xa296, 0x0004, 0x0040, 0x112a, 0x2011, 0x0001, - 0x1078, 0x6135, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002, - 0x0f7f, 0x1078, 0x1ee6, 0x2011, 0x0005, 0x1078, 0x5232, 0x1078, - 0x476a, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x127f, - 0x0078, 0x1144, 0x7003, 0x0003, 0x2001, 0x0000, 0x1078, 0x1dc9, - 0x2011, 0x0000, 0x1078, 0x5232, 0x2011, 0x0000, 0x1078, 0x523c, - 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x1078, 0x476a, - 0x1078, 0x4821, 0x0f7f, 0x127f, 0x007c, 0x0c7e, 0x20a9, 0x0082, - 0x2009, 0x007e, 0x1078, 0x342f, 0x8108, 0x00f0, 0x114a, 0x0c7f, - 0x007c, 0x127e, 0x2091, 0x8000, 0x708c, 0xa086, 0xffff, 0x0040, - 0x115f, 0x1078, 0x1ee6, 0x1078, 0x476a, 0x0078, 0x11a8, 0x70bc, - 0xd09c, 0x0040, 0x1187, 0xd084, 0x0040, 0x1187, 0x0f7e, 0x2079, - 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c, 0x0040, 0x1187, - 0x70c0, 0xa086, 0xffff, 0x0040, 0x1183, 0x1078, 0x1fdb, 0x1078, - 0x476a, 0x2011, 0x0001, 0x2019, 0x0000, 0x1078, 0x2013, 0x1078, - 0x476a, 0x0078, 0x11a8, 0x70c4, 0xa005, 0x00c0, 0x11a8, 0x7088, - 0xa005, 0x00c0, 0x11a8, 0x7003, 0x0003, 0x708f, 0xffff, 0x2001, - 0x0000, 0x1078, 0x1dc9, 0x1078, 0x2ad1, 0x2001, 0x6f11, 0x2004, - 0xa086, 0x0005, 0x00c0, 0x11a0, 0x2011, 0x0000, 0x1078, 0x5232, - 0x2011, 0x0000, 0x1078, 0x523c, 0x1078, 0x476a, 0x1078, 0x4821, - 0x127f, 0x007c, 0x017e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, - 0x0100, 0x7843, 0x0000, 0x7924, 0xd1b4, 0x0040, 0x11b9, 0x7827, - 0x0040, 0xd19c, 0x0040, 0x11be, 0x7827, 0x0008, 0x007e, 0x037e, - 0x157e, 0x7900, 0xa18a, 0x0003, 0x0050, 0x11e4, 0x7954, 0xd1ac, - 0x00c0, 0x11e4, 0x2009, 0x00f8, 0x1078, 0x3233, 0x7843, 0x0090, - 0x7843, 0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11dc, - 0x7824, 0xd0ac, 0x00c0, 0x1218, 0x00f0, 0x11d4, 0x2001, 0x0001, - 0x1078, 0x1dc9, 0x0078, 0x1221, 0x7853, 0x0000, 0x782f, 0x0020, - 0x20a9, 0x0008, 0x00e0, 0x11ea, 0x2091, 0x6000, 0x00f0, 0x11ea, - 0x7853, 0x0400, 0x782f, 0x0000, 0x2009, 0x00f8, 0x1078, 0x3233, - 0x20a9, 0x000e, 0x0005, 0x00f0, 0x11fa, 0x7853, 0x1400, 0x7843, - 0x0090, 0x7843, 0x0010, 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, - 0xd08c, 0x0040, 0x120f, 0x7824, 0xd0ac, 0x00c0, 0x1218, 0x8319, - 0x00c0, 0x1205, 0x2001, 0x0001, 0x1078, 0x1dc9, 0x0078, 0x121f, - 0x7828, 0xc09d, 0x782a, 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, - 0x0400, 0x157f, 0x037f, 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, - 0x007c, 0x007c, 0x007c, 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, - 0x0002, 0x0048, 0x1237, 0x704f, 0xffff, 0x0078, 0x1239, 0x704f, - 0x0000, 0x7053, 0xffff, 0x7067, 0x0000, 0x706b, 0x0000, 0x2061, - 0x6f00, 0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, - 0x0200, 0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, - 0x07d0, 0x2061, 0x6f08, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, - 0x0000, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, - 0x0001, 0x601f, 0x0000, 0x007c, 0x1078, 0x128a, 0x2011, 0x0000, - 0x81ff, 0x0040, 0x1289, 0xa186, 0x0001, 0x00c0, 0x1279, 0x705f, - 0x8fff, 0x7057, 0x7c01, 0x7063, 0x0100, 0x705b, 0x7c00, 0x0078, - 0x1287, 0xa186, 0x0002, 0x00c0, 0x1281, 0x2011, 0x0000, 0x0078, - 0x1287, 0xa186, 0x0005, 0x00c0, 0x1287, 0x2011, 0x0001, 0x1078, - 0x12b1, 0x007c, 0x2009, 0x0000, 0x2011, 0x0000, 0x1078, 0x12b1, - 0x2019, 0xaaaa, 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061, 0x7fff, - 0x2c04, 0xa406, 0x0040, 0x129f, 0xc18d, 0x0078, 0x12ac, 0xc185, - 0x2011, 0x0001, 0x1078, 0x12b1, 0x2061, 0xffff, 0x2362, 0x2c04, - 0xa306, 0x00c0, 0x12ac, 0xc195, 0x2011, 0x0001, 0x1078, 0x12b1, - 0x007c, 0x3800, 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c, 0x2091, - 0x8000, 0x0068, 0x12b9, 0x007e, 0x017e, 0x2079, 0x0000, 0x7818, - 0xa084, 0x0000, 0x00c0, 0x12bf, 0x017f, 0x792e, 0x007f, 0x782a, - 0x007f, 0x7826, 0x7823, 0x8002, 0x781b, 0x0001, 0x2091, 0x5000, - 0x2091, 0x4080, 0x2079, 0x6d00, 0x7803, 0x0005, 0x0078, 0x12d6, - 0x007c, 0x2071, 0x6d00, 0x7158, 0x712e, 0x2021, 0x0001, 0xa190, - 0x002d, 0xa298, 0x002d, 0x0048, 0x12ef, 0x705c, 0xa302, 0x00c8, - 0x12ef, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078, 0x12e1, 0x200b, + 0x1078, 0x6953, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002, + 0x0f7f, 0x1078, 0x2150, 0x2011, 0x0005, 0x1078, 0x57c0, 0x1078, + 0x4c7a, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x127f, + 0x0078, 0x113e, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002, + 0x2011, 0x0005, 0x1078, 0x57c0, 0x1078, 0x4c7a, 0x0c7e, 0x2061, + 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x0f7f, 0x127f, 0x007c, 0x0c7e, + 0x20a9, 0x0082, 0x2009, 0x007e, 0x1078, 0x380d, 0x8108, 0x00f0, + 0x1144, 0x0c7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x708c, 0xa086, + 0xffff, 0x0040, 0x1159, 0x1078, 0x2150, 0x1078, 0x4c7a, 0x0078, + 0x11c4, 0x70bc, 0xd09c, 0x0040, 0x1181, 0xd084, 0x0040, 0x1181, + 0x0f7e, 0x2079, 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c, + 0x0040, 0x1181, 0x70c0, 0xa086, 0xffff, 0x0040, 0x117d, 0x1078, + 0x2245, 0x1078, 0x4c7a, 0x2011, 0x0001, 0x2019, 0x0000, 0x1078, + 0x227d, 0x1078, 0x4c7a, 0x0078, 0x11c4, 0x70c4, 0xa005, 0x00c0, + 0x11c4, 0x7088, 0xa005, 0x00c0, 0x11c4, 0x2001, 0x7652, 0x2004, + 0xd0ac, 0x0040, 0x11a7, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009, + 0x0000, 0x017e, 0x1078, 0x3825, 0x00c0, 0x119a, 0x6000, 0xd0ec, + 0x00c0, 0x11a2, 0x017f, 0x8108, 0x00f0, 0x1191, 0x0c7f, 0x157f, + 0x0078, 0x11a7, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x11c4, 0x7003, + 0x0003, 0x708f, 0xffff, 0x2001, 0x0000, 0x1078, 0x202b, 0x1078, + 0x2dc8, 0x2001, 0x7837, 0x2004, 0xa086, 0x0005, 0x00c0, 0x11bc, + 0x2011, 0x0000, 0x1078, 0x57c0, 0x2011, 0x0000, 0x1078, 0x57ca, + 0x1078, 0x4c7a, 0x1078, 0x4d3a, 0x127f, 0x007c, 0x017e, 0x0f7e, + 0x127e, 0x2091, 0x8000, 0x2079, 0x0100, 0x7940, 0xa18c, 0x0010, + 0x7942, 0x7924, 0xd1b4, 0x0040, 0x11d7, 0x7827, 0x0040, 0xd19c, + 0x0040, 0x11dc, 0x7827, 0x0008, 0x007e, 0x037e, 0x157e, 0x7900, + 0xa18a, 0x0003, 0x0050, 0x1202, 0x7954, 0xd1ac, 0x00c0, 0x1202, + 0x2009, 0x00f8, 0x1078, 0x35e4, 0x7843, 0x0090, 0x7843, 0x0010, + 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11fa, 0x7824, 0xd0ac, + 0x00c0, 0x1236, 0x00f0, 0x11f2, 0x2001, 0x0001, 0x1078, 0x202b, + 0x0078, 0x123f, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0008, + 0x00e0, 0x1208, 0x2091, 0x6000, 0x00f0, 0x1208, 0x7853, 0x0400, + 0x782f, 0x0000, 0x2009, 0x00f8, 0x1078, 0x35e4, 0x20a9, 0x000e, + 0x0005, 0x00f0, 0x1218, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843, + 0x0010, 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040, + 0x122d, 0x7824, 0xd0ac, 0x00c0, 0x1236, 0x8319, 0x00c0, 0x1223, + 0x2001, 0x0001, 0x1078, 0x202b, 0x0078, 0x123d, 0x7828, 0xc09d, + 0x782a, 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, 0x0400, 0x157f, + 0x037f, 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c, + 0x007c, 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, + 0x1255, 0x704f, 0xffff, 0x0078, 0x1257, 0x704f, 0x0000, 0x7053, + 0xffff, 0x7067, 0x0000, 0x706b, 0x0000, 0x2061, 0x7820, 0x6003, + 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013, + 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061, + 0x7828, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000, 0x600f, + 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001, 0x601f, + 0x0000, 0x007c, 0x1078, 0x12a8, 0x2011, 0x0000, 0x81ff, 0x0040, + 0x12a7, 0xa186, 0x0001, 0x00c0, 0x1297, 0x705f, 0x8fff, 0x7057, + 0x8501, 0x7063, 0x0100, 0x705b, 0x8500, 0x0078, 0x12a5, 0xa186, + 0x0002, 0x00c0, 0x129f, 0x2011, 0x0000, 0x0078, 0x12a5, 0xa186, + 0x0005, 0x00c0, 0x12a5, 0x2011, 0x0001, 0x1078, 0x12cf, 0x007c, + 0x2009, 0x0000, 0x2011, 0x0000, 0x1078, 0x12cf, 0x2019, 0xaaaa, + 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061, 0x7fff, 0x2c04, 0xa406, + 0x0040, 0x12bd, 0xc18d, 0x0078, 0x12ca, 0xc185, 0x2011, 0x0001, + 0x1078, 0x12cf, 0x2061, 0xffff, 0x2362, 0x2c04, 0xa306, 0x00c0, + 0x12ca, 0xc195, 0x2011, 0x0001, 0x1078, 0x12cf, 0x007c, 0x3800, + 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c, 0x2091, 0x8000, 0x0068, + 0x12d7, 0x007e, 0x017e, 0x2079, 0x0000, 0x7818, 0xa084, 0x0000, + 0x00c0, 0x12dd, 0x017f, 0x792e, 0x007f, 0x782a, 0x007f, 0x7826, + 0x3900, 0x783a, 0x7823, 0x8002, 0x781b, 0x0001, 0x2091, 0x5000, + 0x2091, 0x4080, 0x2079, 0x7600, 0x7803, 0x0005, 0x0078, 0x12f6, + 0x007c, 0x2071, 0x7600, 0x7158, 0x712e, 0x2021, 0x0001, 0xa190, + 0x002d, 0xa298, 0x002d, 0x0048, 0x130f, 0x705c, 0xa302, 0x00c8, + 0x130f, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078, 0x1301, 0x200b, 0x0000, 0x749e, 0x74a2, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000, - 0x2071, 0x6d00, 0x70a0, 0xa0ea, 0x0010, 0x00c8, 0x1302, 0xa06e, - 0x0078, 0x130c, 0x8001, 0x70a2, 0x702c, 0x2068, 0x2d04, 0x702e, + 0x2071, 0x7600, 0x70a0, 0xa0ea, 0x0010, 0x00c8, 0x1322, 0xa06e, + 0x0078, 0x132c, 0x8001, 0x70a2, 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c, 0x0e7e, - 0x2071, 0x6d00, 0x127e, 0x2091, 0x8000, 0x70a0, 0x8001, 0x00c8, - 0x131c, 0xa06e, 0x0078, 0x1325, 0x70a2, 0x702c, 0x2068, 0x2d04, + 0x2071, 0x7600, 0x127e, 0x2091, 0x8000, 0x70a0, 0x8001, 0x00c8, + 0x133c, 0xa06e, 0x0078, 0x1345, 0x70a2, 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c, - 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x6d00, 0x702c, 0x206a, + 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7600, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70a0, 0x8000, 0x70a2, 0x127f, 0x0e7f, 0x007c, - 0x8dff, 0x0040, 0x1344, 0x6804, 0x6807, 0x0000, 0x007e, 0x1078, - 0x1328, 0x0d7f, 0x0078, 0x1338, 0x007c, 0x0e7e, 0x2071, 0x6d00, + 0x8dff, 0x0040, 0x1364, 0x6804, 0x6807, 0x0000, 0x007e, 0x1078, + 0x1348, 0x0d7f, 0x0078, 0x1358, 0x007c, 0x0e7e, 0x2071, 0x7600, 0x70a0, 0xa08a, 0x0010, 0xa00d, 0x0e7f, 0x007c, 0x0e7e, 0x2071, - 0x6f31, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x2071, + 0x7859, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x2071, 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x0e7f, 0x007c, 0x0e7e, - 0x2270, 0x700b, 0x0000, 0x2071, 0x6f31, 0x7018, 0xa088, 0x6f3a, + 0x2270, 0x700b, 0x0000, 0x2071, 0x7859, 0x7018, 0xa088, 0x7862, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005, 0x00c0, - 0x1377, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1388, 0x0f7f, 0x0e7f, - 0x007c, 0x0e7e, 0x2071, 0x6f31, 0x7004, 0xa005, 0x00c0, 0x1386, - 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1388, 0x0f7f, 0x0e7f, 0x007c, - 0x7000, 0x0079, 0x138b, 0x138f, 0x13f9, 0x1416, 0x1416, 0x7018, - 0x711c, 0xa106, 0x00c0, 0x1397, 0x7007, 0x0000, 0x007c, 0x0d7e, - 0xa180, 0x6f3a, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c, 0x0007, + 0x1397, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13a8, 0x0f7f, 0x0e7f, + 0x007c, 0x0e7e, 0x2071, 0x7859, 0x7004, 0xa005, 0x00c0, 0x13a6, + 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13a8, 0x0f7f, 0x0e7f, 0x007c, + 0x7000, 0x0079, 0x13ab, 0x13af, 0x1419, 0x1436, 0x1436, 0x7018, + 0x711c, 0xa106, 0x00c0, 0x13b7, 0x7007, 0x0000, 0x007c, 0x0d7e, + 0xa180, 0x7862, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c, 0x0007, 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, 0x7836, 0x682c, 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, 0x7016, 0x6804, - 0x0d7f, 0xd084, 0x0040, 0x13b9, 0x7007, 0x0001, 0x1078, 0x13be, - 0x007c, 0x7007, 0x0002, 0x1078, 0x13d4, 0x007c, 0x017e, 0x027e, - 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13c9, 0x2110, + 0x0d7f, 0xd084, 0x0040, 0x13d9, 0x7007, 0x0001, 0x1078, 0x13de, + 0x007c, 0x7007, 0x0002, 0x1078, 0x13f4, 0x007c, 0x017e, 0x027e, + 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13e9, 0x2110, 0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803, 0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, 0x137e, 0x147e, 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026, 0x710c, - 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13e8, 0x2110, 0xa006, + 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x1408, 0x2110, 0xa006, 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803, 0x0001, 0x3300, 0x7016, 0x157f, 0x147f, 0x137f, 0x027f, 0x017f, - 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0x6dc5, 0x20a1, 0x0018, + 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0x76e5, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000, 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x700b, - 0x6dc0, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e, 0x147e, - 0x157e, 0x2001, 0x6df4, 0x209c, 0x20a1, 0x0014, 0x7803, 0x0026, - 0x2001, 0x6df5, 0x20ac, 0x53a6, 0x2099, 0x6df6, 0x20a1, 0x0018, + 0x76e0, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e, 0x147e, + 0x157e, 0x2001, 0x7714, 0x209c, 0x20a1, 0x0014, 0x7803, 0x0026, + 0x2001, 0x7715, 0x20ac, 0x53a6, 0x2099, 0x7716, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000, 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002, 0x700b, - 0x6df1, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e, 0x0e7e, - 0x2071, 0x6f31, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803, 0x0002, - 0xd1fc, 0x0040, 0x1459, 0xa18c, 0x0700, 0x0040, 0x1456, 0x7008, - 0xa080, 0x0002, 0x2003, 0x0200, 0x0078, 0x1459, 0x7004, 0x1079, - 0x145d, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x1388, 0x1465, 0x1487, - 0x14a1, 0x14ca, 0x1463, 0x0078, 0x1463, 0x137e, 0x147e, 0x157e, + 0x7711, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e, 0x0e7e, + 0x2071, 0x7859, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803, 0x0002, + 0xd1fc, 0x0040, 0x1479, 0xa18c, 0x0700, 0x0040, 0x1476, 0x7008, + 0xa080, 0x0002, 0x2003, 0x0200, 0x0078, 0x1479, 0x7004, 0x1079, + 0x147d, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x13a8, 0x1485, 0x14a7, + 0x14c1, 0x14ea, 0x1483, 0x0078, 0x1483, 0x137e, 0x147e, 0x157e, 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x7010, 0x20a8, 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f, 0x137f, 0x700c, 0xa005, - 0x0040, 0x148e, 0x1078, 0x13be, 0x007c, 0x7008, 0xa080, 0x0002, - 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x1388, 0x007c, 0x700c, - 0xa005, 0x0040, 0x148e, 0x1078, 0x13d4, 0x007c, 0x0d7e, 0x7008, + 0x0040, 0x14ae, 0x1078, 0x13de, 0x007c, 0x7008, 0xa080, 0x0002, + 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x13a8, 0x007c, 0x700c, + 0xa005, 0x0040, 0x14ae, 0x1078, 0x13f4, 0x007c, 0x0d7e, 0x7008, 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, 0x682e, 0x783c, - 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078, 0x1388, - 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x6dc3, 0x2004, 0xa080, + 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078, 0x13a8, + 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x76e3, 0x2004, 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9, 0x0020, - 0x53a5, 0x2001, 0x6dc5, 0x2004, 0xd0bc, 0x0040, 0x14c0, 0x2001, - 0x6dce, 0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5, - 0x157f, 0x147f, 0x137f, 0x7007, 0x0000, 0x1078, 0x396e, 0x1078, - 0x1388, 0x007c, 0x2001, 0x6df3, 0x2003, 0x0100, 0x7007, 0x0000, - 0x1078, 0x1388, 0x007c, 0x127e, 0x2091, 0x2100, 0x2079, 0x0030, - 0x2071, 0x6f42, 0x7003, 0x0000, 0x700f, 0x6f48, 0x7013, 0x6f48, + 0x53a5, 0x2001, 0x76e5, 0x2004, 0xd0bc, 0x0040, 0x14e0, 0x2001, + 0x76ee, 0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5, + 0x157f, 0x147f, 0x137f, 0x7007, 0x0000, 0x1078, 0x3d4f, 0x1078, + 0x13a8, 0x007c, 0x2001, 0x7713, 0x2003, 0x0100, 0x7007, 0x0000, + 0x1078, 0x13a8, 0x007c, 0x127e, 0x2091, 0x2100, 0x2079, 0x0030, + 0x2071, 0x786a, 0x7003, 0x0000, 0x700f, 0x7870, 0x7013, 0x7870, 0x780f, 0x0070, 0x127f, 0x007c, 0x6934, 0xa184, 0x0007, 0x0079, - 0x14e9, 0x14f1, 0x151b, 0x14f1, 0x14f1, 0x14f1, 0x1500, 0x14f1, - 0x14f5, 0xa085, 0x0001, 0x0078, 0x1531, 0x684c, 0xd0bc, 0x0040, - 0x14f1, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078, 0x1523, - 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x14f1, 0x684c, 0xd0ac, - 0x0040, 0x14f1, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, - 0x000f, 0xa080, 0x1a82, 0x2004, 0x6832, 0xa006, 0x682e, 0x682a, - 0x6858, 0x0078, 0x152b, 0x684c, 0xd0ac, 0x0040, 0x14f1, 0xa006, - 0x682e, 0x682a, 0x6858, 0xa18c, 0x000f, 0xa188, 0x1a82, 0x210c, - 0x6932, 0x2d08, 0x691a, 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006, - 0x680a, 0x007c, 0x82ff, 0x0040, 0x1545, 0xa280, 0x0004, 0x0d7e, - 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x1541, 0x1078, 0x14e4, 0x10c0, - 0x12b7, 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e, - 0x027e, 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005, - 0x00c0, 0x1559, 0x7206, 0x2001, 0x156d, 0x007e, 0x2260, 0x0078, - 0x164f, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108, - 0xa182, 0x6f63, 0x0048, 0x1566, 0x2009, 0x6f48, 0x710e, 0x7000, - 0xa005, 0x00c0, 0x156d, 0x1078, 0x1638, 0x127f, 0x007c, 0x127e, - 0x027e, 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f, - 0x037f, 0x027f, 0x0c7e, 0x0d7e, 0x2460, 0x6110, 0x2168, 0x6a62, - 0x6b5e, 0xa005, 0x0040, 0x15bc, 0x6808, 0xa005, 0x0040, 0x15ea, - 0x7000, 0xa005, 0x00c0, 0x158e, 0x0078, 0x15b4, 0x700c, 0x7110, - 0xa106, 0x00c0, 0x15ba, 0x7004, 0xa406, 0x00c0, 0x15b4, 0x2001, - 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15ee, 0x2001, 0x0207, 0x2004, - 0xd09c, 0x00c0, 0x1597, 0x7804, 0xa084, 0x6000, 0x0040, 0x15ae, - 0xa086, 0x6000, 0x0040, 0x15ae, 0x0078, 0x1597, 0x7803, 0x0004, - 0x7003, 0x0000, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5591, - 0x0078, 0x15ee, 0x0078, 0x15ee, 0x6808, 0xa005, 0x0040, 0x15ea, - 0x7000, 0xa005, 0x00c0, 0x15c6, 0x0078, 0x15ea, 0x700c, 0x7110, - 0xa106, 0x00c0, 0x15ba, 0x7004, 0xa406, 0x00c0, 0x15ea, 0x2001, - 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15ee, 0x2001, 0x0207, 0x2004, - 0xd09c, 0x00c0, 0x15cf, 0x7804, 0xa084, 0x6000, 0x0040, 0x15e6, - 0xa086, 0x6000, 0x0040, 0x15e6, 0x0078, 0x15cf, 0x7803, 0x0004, - 0x7003, 0x0000, 0x2009, 0x0048, 0x1078, 0x5591, 0x0d7f, 0x0c7f, - 0x127f, 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x6f42, 0x7000, 0xa086, - 0x0000, 0x0040, 0x1635, 0x7004, 0xac06, 0x00c0, 0x1626, 0x2079, - 0x0030, 0x7804, 0xd0fc, 0x00c0, 0x1622, 0x2001, 0x0207, 0x2004, - 0xd09c, 0x00c0, 0x1601, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, - 0x160d, 0x7908, 0xd1ec, 0x00c0, 0x1619, 0x2009, 0x0009, 0x0078, - 0x161b, 0x2009, 0x0019, 0x7803, 0x0002, 0x7902, 0x7003, 0x0003, - 0x0078, 0x1635, 0x1078, 0x16e5, 0x0078, 0x15f6, 0x157e, 0x20a9, - 0x0009, 0x2009, 0x6f48, 0x2104, 0xac06, 0x00c0, 0x1630, 0x200a, - 0xa188, 0x0003, 0x00f0, 0x162b, 0x157f, 0x0e7f, 0x0f7f, 0x007c, - 0x700c, 0x7110, 0xa106, 0x00c0, 0x1640, 0x7003, 0x0000, 0x007c, - 0x2104, 0x7006, 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, 0x8108, - 0xa182, 0x6f63, 0x0048, 0x164e, 0x2009, 0x6f48, 0x7112, 0x8cff, - 0x00c0, 0x1658, 0x7803, 0x0019, 0x7003, 0x0003, 0x0078, 0x167b, - 0x6010, 0x2068, 0x2d58, 0x6828, 0xa406, 0x00c0, 0x1663, 0x682c, - 0xa306, 0x0040, 0x1667, 0x1078, 0x1aa2, 0x00c0, 0x1652, 0x6824, - 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, - 0x2009, 0x0011, 0x1078, 0x167c, 0x0040, 0x167a, 0x2009, 0x0001, - 0x1078, 0x167c, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x16e0, 0xa03e, - 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x169b, 0x0d7e, 0x2804, 0xac68, - 0x2900, 0x0079, 0x168b, 0x16ca, 0x16ab, 0x16ab, 0x16ca, 0x16ca, - 0x16c2, 0x16ca, 0x16ab, 0x16ca, 0x16b1, 0x16b1, 0x16ca, 0x16ca, - 0x16ca, 0x16ca, 0x16b1, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, - 0x6c20, 0x0d7e, 0xd99c, 0x0040, 0x16cd, 0x2804, 0xac68, 0x6f08, - 0x6e0c, 0x0078, 0x16cd, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078, - 0x16cd, 0x7b0c, 0xd3bc, 0x0040, 0x16ba, 0x7b08, 0xa39c, 0x0fff, - 0x0078, 0x16bb, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, - 0x0078, 0x16cd, 0x0d7f, 0x1078, 0x1a3f, 0x00c0, 0x167c, 0xa00e, - 0x0078, 0x16e0, 0x0d7f, 0x1078, 0x12b7, 0x7b22, 0x7a26, 0x7d32, + 0x1509, 0x1511, 0x1557, 0x1511, 0x1511, 0x1511, 0x153c, 0x1520, + 0x1515, 0xa085, 0x0001, 0x0078, 0x1571, 0x684c, 0xd0bc, 0x0040, + 0x1511, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078, 0x155f, + 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0, 0x1511, 0x684c, 0xd0bc, + 0x0040, 0x1511, 0x6860, 0x682e, 0x685c, 0x682a, 0x6804, 0x681a, + 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1c84, 0x2004, + 0x6832, 0x6858, 0x0078, 0x1567, 0xa18c, 0x00ff, 0xa186, 0x0015, + 0x00c0, 0x1511, 0x684c, 0xd0ac, 0x0040, 0x1511, 0x6804, 0x681a, + 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1c84, 0x2004, + 0x6832, 0xa006, 0x682e, 0x682a, 0x6858, 0x0078, 0x1567, 0x684c, + 0xd0ac, 0x0040, 0x1511, 0xa006, 0x682e, 0x682a, 0x6858, 0xa18c, + 0x000f, 0xa188, 0x1c84, 0x210c, 0x6932, 0x2d08, 0x691a, 0x6826, + 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c, 0x6912, 0x6980, + 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x2001, 0x020a, + 0x2004, 0x82ff, 0x0040, 0x158c, 0xa280, 0x0004, 0x0d7e, 0x206c, + 0x684c, 0xd0dc, 0x00c0, 0x1588, 0x1078, 0x1504, 0x10c0, 0x12d5, + 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e, 0x027e, + 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005, 0x00c0, + 0x15a0, 0x7206, 0x2001, 0x15b4, 0x007e, 0x2260, 0x0078, 0x16cc, + 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108, 0xa182, + 0x788b, 0x0048, 0x15ad, 0x2009, 0x7870, 0x710e, 0x7000, 0xa005, + 0x00c0, 0x15b4, 0x1078, 0x16b5, 0x127f, 0x007c, 0x127e, 0x027e, + 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f, 0x037f, + 0x027f, 0x0d7e, 0x0c7e, 0x2460, 0x6110, 0x2168, 0x6a62, 0x6b5e, + 0xa005, 0x0040, 0x1608, 0x6808, 0xa005, 0x0040, 0x166e, 0x7000, + 0xa005, 0x00c0, 0x15d5, 0x0078, 0x1602, 0x700c, 0x7110, 0xa106, + 0x00c0, 0x1672, 0x7004, 0xa406, 0x00c0, 0x1602, 0x2001, 0x0005, + 0x2004, 0xd08c, 0x0040, 0x15eb, 0x047e, 0x1078, 0x178d, 0x047f, + 0x2460, 0x0078, 0x15cb, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, + 0x15de, 0x7804, 0xa084, 0x6000, 0x0040, 0x15fc, 0xa086, 0x6000, + 0x0040, 0x15fc, 0x0078, 0x15de, 0x7803, 0x0004, 0x7003, 0x0000, + 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5c29, 0x0078, 0x1672, + 0x6808, 0xa005, 0x0040, 0x166e, 0x7000, 0xa005, 0x00c0, 0x1612, + 0x0078, 0x166e, 0x700c, 0x7110, 0xa106, 0x00c0, 0x161b, 0x7004, + 0xa406, 0x00c0, 0x166e, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, + 0x1628, 0x047e, 0x1078, 0x178d, 0x047f, 0x2460, 0x0078, 0x1608, + 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x161b, 0x2001, 0x0005, + 0x2004, 0xd08c, 0x00c0, 0x1621, 0x7804, 0xa084, 0x6000, 0x0040, + 0x163f, 0xa086, 0x6000, 0x0040, 0x163f, 0x0078, 0x161b, 0x7007, + 0x0000, 0xa016, 0x2218, 0x7000, 0xa08e, 0x0001, 0x0040, 0x1660, + 0xa08e, 0x0002, 0x00c0, 0x166e, 0x0c7e, 0x0e7e, 0x6818, 0x2060, + 0x1078, 0x1c59, 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0, 0x165c, + 0x7308, 0x720c, 0x0078, 0x165e, 0x7310, 0x7214, 0x0e7f, 0x0c7f, + 0x7820, 0xa318, 0x7824, 0xa211, 0x6810, 0xa300, 0x6812, 0x6814, + 0xa201, 0x6816, 0x7803, 0x0004, 0x7003, 0x0000, 0x2009, 0x0048, + 0x1078, 0x5c29, 0x0c7f, 0x0d7f, 0x127f, 0x007c, 0x0f7e, 0x0e7e, + 0x2071, 0x786a, 0x7000, 0xa086, 0x0000, 0x0040, 0x16b2, 0x7004, + 0xac06, 0x00c0, 0x16a3, 0x2079, 0x0030, 0x7804, 0xd0fc, 0x00c0, + 0x169f, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x1685, 0x7803, + 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1691, 0x7803, 0x0002, 0x7803, + 0x0009, 0x7003, 0x0003, 0x7007, 0x0000, 0x0078, 0x16a3, 0x1078, + 0x178d, 0x0078, 0x167a, 0x157e, 0x20a9, 0x0009, 0x2009, 0x7870, + 0x2104, 0xac06, 0x00c0, 0x16ad, 0x200a, 0xa188, 0x0003, 0x00f0, + 0x16a8, 0x157f, 0x0e7f, 0x0f7f, 0x007c, 0x700c, 0x7110, 0xa106, + 0x00c0, 0x16bd, 0x7003, 0x0000, 0x007c, 0x2104, 0x7006, 0x2060, + 0x8108, 0x211c, 0x8108, 0x2124, 0x8108, 0xa182, 0x788b, 0x0048, + 0x16cb, 0x2009, 0x7870, 0x7112, 0x8cff, 0x00c0, 0x16d3, 0x1078, + 0x1958, 0x0078, 0x16fa, 0x6010, 0x2068, 0x2d58, 0x6828, 0xa406, + 0x00c0, 0x16de, 0x682c, 0xa306, 0x0040, 0x16e2, 0x1078, 0x1ca4, + 0x00c0, 0x16cf, 0x684c, 0xd0f4, 0x00c0, 0x16cf, 0x6824, 0x2050, + 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x2009, + 0x0011, 0x1078, 0x16fb, 0x0040, 0x16f9, 0x2009, 0x0001, 0x1078, + 0x16fb, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x1788, 0xa03e, 0x2730, + 0x6850, 0xd0fc, 0x00c0, 0x171a, 0x0d7e, 0x2804, 0xac68, 0x2900, + 0x0079, 0x170a, 0x176a, 0x172a, 0x172a, 0x176a, 0x176a, 0x1762, + 0x176a, 0x172a, 0x176a, 0x1730, 0x1730, 0x176a, 0x176a, 0x176a, + 0x1759, 0x1730, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, + 0x0d7e, 0xd99c, 0x0040, 0x176d, 0x2804, 0xac68, 0x6f08, 0x6e0c, + 0x0078, 0x176d, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x176d, + 0x7b0c, 0xd3bc, 0x0040, 0x1751, 0x7004, 0x0e7e, 0x2070, 0x701c, + 0x0e7f, 0xa086, 0x0008, 0x00c0, 0x1751, 0x7b08, 0xa39c, 0x0fff, + 0x2d20, 0x0d7f, 0x0d7e, 0x6a14, 0x82ff, 0x00c0, 0x174c, 0x6810, + 0xa302, 0x0048, 0x174c, 0x6b10, 0x2011, 0x0000, 0x2468, 0x0078, + 0x1753, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078, + 0x176d, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, + 0x00c0, 0x176a, 0x0d7f, 0x1078, 0x1c40, 0x00c0, 0x16fb, 0xa00e, + 0x0078, 0x1788, 0x0d7f, 0x1078, 0x12d5, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x0d7f, - 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x1078, 0x1a3f, - 0x007c, 0x1078, 0x12b7, 0x1078, 0x12b7, 0x127e, 0x2091, 0x2100, + 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x2300, 0x6b10, + 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, 0x6816, 0x1078, 0x1c40, + 0x007c, 0x1078, 0x12d5, 0x1078, 0x12d5, 0x127e, 0x2091, 0x2100, 0x007e, 0x017e, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, - 0xa184, 0x0700, 0x00c0, 0x16e3, 0xa184, 0x0003, 0xa086, 0x0003, - 0x0040, 0x16e3, 0x7000, 0x0079, 0x16fd, 0x1701, 0x1703, 0x1779, - 0x17c0, 0x1078, 0x12b7, 0x8001, 0x7002, 0xa184, 0x0880, 0x00c0, - 0x1718, 0x8aff, 0x0040, 0x175b, 0x2009, 0x0001, 0x1078, 0x167c, - 0x0040, 0x17d3, 0x2009, 0x0001, 0x1078, 0x167c, 0x0078, 0x17d3, - 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x1751, 0x027e, - 0x037e, 0x6b28, 0x6a2c, 0x7820, 0x686e, 0xa31a, 0x7824, 0x6872, - 0xa213, 0x6b2a, 0x6a2e, 0x037f, 0x027f, 0x7830, 0x681e, 0x7834, - 0x6822, 0x1078, 0x1a58, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, - 0x6832, 0x7003, 0x0000, 0x6850, 0xc0fd, 0x6852, 0x6808, 0x8001, - 0x680a, 0x00c0, 0x174d, 0x684c, 0xd0e4, 0x0040, 0x174d, 0x7004, - 0x2060, 0x2009, 0x0048, 0x1078, 0x5591, 0x1078, 0x1638, 0x0078, - 0x17d3, 0x057e, 0x7d0c, 0xd5bc, 0x00c0, 0x1758, 0x1078, 0x6c41, - 0x057f, 0x0078, 0x1773, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005, - 0x00c0, 0x1773, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0, - 0x176f, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5591, 0x1078, - 0x1638, 0x0078, 0x17d3, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, - 0x17d3, 0x8001, 0x7002, 0xd194, 0x0040, 0x178b, 0x7804, 0xd0fc, - 0x00c0, 0x16ed, 0x8aff, 0x0040, 0x17d3, 0x2009, 0x0001, 0x1078, - 0x167c, 0x0078, 0x17d3, 0xa184, 0x0880, 0x00c0, 0x1798, 0x8aff, - 0x0040, 0x17d3, 0x2009, 0x0001, 0x1078, 0x167c, 0x0078, 0x17d3, - 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x17b9, 0x027e, - 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1a58, 0x0d7e, 0x2804, 0xac68, - 0x6034, 0xd09c, 0x00c0, 0x17b2, 0x6808, 0xa31a, 0x680c, 0xa213, - 0x0078, 0x17b6, 0x6810, 0xa31a, 0x6814, 0xa213, 0x0d7f, 0x0078, - 0x1723, 0x057e, 0x7d0c, 0x1078, 0x6c41, 0x057f, 0x0078, 0x1773, - 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x17d1, 0x6808, 0x8001, - 0x680a, 0x00c0, 0x17d1, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, - 0x5591, 0x1078, 0x1638, 0x017f, 0x007f, 0x127f, 0x007c, 0x0e7e, - 0x2071, 0x6f63, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280, - 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1836, 0x6934, 0xa184, - 0x0007, 0x0079, 0x17eb, 0x17f3, 0x1821, 0x17f3, 0x17f3, 0x17f3, - 0x1806, 0x17f3, 0x17f5, 0x1078, 0x12b7, 0x684c, 0xd0b4, 0x0040, - 0x192f, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, - 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x1829, 0xa18c, 0x00ff, - 0xa186, 0x0015, 0x00c0, 0x1836, 0x684c, 0xd0b4, 0x0040, 0x192f, - 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, - 0x1a82, 0x2004, 0x6832, 0x6958, 0xa006, 0x682e, 0x682a, 0x0078, - 0x1832, 0x684c, 0xd0b4, 0x0040, 0x16e1, 0x6958, 0xa006, 0x682e, - 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084, 0x000f, 0xa080, 0x1a82, - 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd, 0x684e, 0x0d7f, 0x007c, - 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc, 0x10c0, 0x1933, 0x0e7e, - 0x0d7e, 0x2071, 0x6f63, 0x7000, 0xa005, 0x00c0, 0x18b2, 0x0c7e, - 0x7206, 0xa280, 0x0004, 0x205c, 0x7004, 0x2068, 0x6818, 0x0d7e, - 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e, 0x20e1, 0x9040, 0x2079, - 0x0200, 0x781a, 0x2079, 0x0100, 0x8004, 0x78d6, 0x0f7f, 0x0d7f, - 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, - 0xa0cc, 0x000f, 0x6908, 0xa184, 0x0007, 0x0040, 0x1874, 0x017e, - 0x2009, 0x0008, 0xa102, 0x017f, 0xa108, 0x791a, 0x7116, 0x701e, - 0x680c, 0xa081, 0x0000, 0x781e, 0x701a, 0xa006, 0x700e, 0x7012, - 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0, 0x188b, 0x6928, 0x6810, - 0xa106, 0x0040, 0x1898, 0x037e, 0x047e, 0x6b14, 0x6c10, 0x1078, - 0x1aa2, 0x047f, 0x037f, 0x0040, 0x1898, 0x0c7f, 0x0078, 0x18b2, - 0x8aff, 0x00c0, 0x18a0, 0x0c7f, 0xa085, 0x0001, 0x0078, 0x18b2, - 0x127e, 0x2091, 0x8000, 0x2079, 0x0020, 0x2009, 0x0001, 0x1078, - 0x18b6, 0x0040, 0x18af, 0x2009, 0x0001, 0x1078, 0x18b6, 0x127f, - 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x077e, 0x067e, - 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff, 0x0040, 0x1928, 0x700c, - 0x7214, 0xa202, 0x7010, 0x7218, 0xa203, 0x0048, 0x1927, 0xa03e, - 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x18e3, 0x0d7e, 0x2804, 0xac68, - 0x2900, 0x0079, 0x18d3, 0x1909, 0x18f3, 0x18f3, 0x1909, 0x1909, - 0x1901, 0x1909, 0x18f3, 0x1909, 0x18f9, 0x18f9, 0x1909, 0x1909, - 0x1909, 0x1909, 0x18f9, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, - 0x6c20, 0xd99c, 0x0040, 0x190d, 0x0d7e, 0x2804, 0xac68, 0x6f08, - 0x6e0c, 0x0078, 0x190c, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078, - 0x190c, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078, - 0x190c, 0x0d7f, 0x1078, 0x1a3f, 0x00c0, 0x18bc, 0xa00e, 0x0078, - 0x1928, 0x0d7f, 0x1078, 0x12b7, 0x0d7f, 0x7b22, 0x7a26, 0x7d32, - 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x6828, - 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x700c, 0xa300, 0x700e, - 0x7010, 0xa201, 0x7012, 0x1078, 0x1a3f, 0x0078, 0x1928, 0xa006, - 0x027f, 0x037f, 0x047f, 0x057f, 0x067f, 0x077f, 0x007c, 0x1078, - 0x12b7, 0x1078, 0x12b7, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, - 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x2079, 0x0020, 0x2071, 0x6f63, - 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, - 0x00c0, 0x1931, 0x7000, 0x0079, 0x194d, 0x1a09, 0x1951, 0x19d6, - 0x1a07, 0x8001, 0x7002, 0xd19c, 0x00c0, 0x1965, 0x8aff, 0x0040, - 0x199a, 0x2009, 0x0001, 0x1078, 0x18b6, 0x0040, 0x1a09, 0x2009, - 0x0001, 0x1078, 0x18b6, 0x0078, 0x1a09, 0x7803, 0x0004, 0xd194, - 0x0040, 0x1975, 0x6850, 0xc0fc, 0x6852, 0x8aff, 0x00c0, 0x1990, - 0x684c, 0xc0f5, 0x684e, 0x0078, 0x1990, 0x027e, 0x037e, 0x6b28, - 0x6a2c, 0x701c, 0xa005, 0x10c0, 0x1a11, 0x7820, 0x686e, 0xa31a, - 0x7824, 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x037f, 0x027f, 0x7830, - 0x681e, 0x7834, 0x6822, 0x1078, 0x1a58, 0x6850, 0xc0fd, 0x6852, - 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, - 0x0078, 0x1a09, 0x711c, 0x81ff, 0x0040, 0x19af, 0x7922, 0x7827, + 0xa184, 0x0700, 0x00c0, 0x178b, 0xa184, 0x0003, 0xa086, 0x0003, + 0x0040, 0x178b, 0x7000, 0x0079, 0x17a5, 0x17ad, 0x17af, 0x1887, + 0x18ef, 0x1906, 0x17ad, 0x17ad, 0x17ad, 0x1078, 0x12d5, 0x8001, + 0x7002, 0xa184, 0x0880, 0x00c0, 0x17c4, 0x8aff, 0x0040, 0x1827, + 0x2009, 0x0001, 0x1078, 0x16fb, 0x0040, 0x1918, 0x2009, 0x0001, + 0x1078, 0x16fb, 0x0078, 0x1918, 0x7803, 0x0004, 0x7003, 0x0000, + 0xd1bc, 0x00c0, 0x180f, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x7820, + 0x686e, 0xa31a, 0x7824, 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x7820, + 0x6910, 0xa100, 0x6812, 0x7824, 0x6914, 0xa101, 0x6816, 0x037f, + 0x027f, 0x7830, 0x681e, 0x7834, 0x6822, 0x1078, 0x1c59, 0x2a00, + 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x6850, + 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x00c0, 0x1801, 0x684c, + 0xd0e4, 0x0040, 0x1801, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, + 0x5c29, 0x7808, 0xd0ec, 0x00c0, 0x180b, 0x7803, 0x0009, 0x7003, + 0x0004, 0x0078, 0x1918, 0x1078, 0x16b5, 0x0078, 0x1918, 0x057e, + 0x7d0c, 0xd5bc, 0x00c0, 0x1816, 0x1078, 0x7592, 0x057f, 0x1078, + 0x191c, 0x682b, 0xffff, 0x682f, 0xffff, 0x697c, 0x6912, 0x6980, + 0x6916, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x1918, 0x684c, + 0xc0f5, 0x684e, 0x7814, 0xa005, 0x00c0, 0x183f, 0x7003, 0x0000, + 0x6808, 0x8001, 0x680a, 0x00c0, 0x183b, 0x7004, 0x2060, 0x2009, + 0x0048, 0x1078, 0x5c29, 0x1078, 0x16b5, 0x0078, 0x1918, 0x7814, + 0x6910, 0xa102, 0x6812, 0x6914, 0xa183, 0x0000, 0x6816, 0x7814, + 0x7908, 0xa18c, 0x0fff, 0xa188, 0x0007, 0x8114, 0x8214, 0x8214, + 0xa10a, 0x8104, 0x8004, 0x8004, 0xa20a, 0x810b, 0x810b, 0x810b, + 0x1078, 0x1983, 0x7803, 0x0004, 0x780f, 0xffff, 0x7803, 0x0001, + 0x7804, 0xd0fc, 0x0040, 0x1860, 0x7803, 0x0002, 0x7803, 0x0004, + 0x780f, 0x0070, 0x7004, 0x7007, 0x0000, 0x2060, 0x2009, 0x0048, + 0x1078, 0x5c29, 0x1078, 0x19a6, 0x0040, 0x183b, 0x7908, 0xd1ec, + 0x00c0, 0x187e, 0x2009, 0x0009, 0x0078, 0x1880, 0x2009, 0x0019, + 0x7902, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x1918, 0x8001, + 0x7002, 0xd194, 0x0040, 0x1899, 0x7804, 0xd0fc, 0x00c0, 0x1795, + 0x8aff, 0x0040, 0x1918, 0x2009, 0x0001, 0x1078, 0x16fb, 0x0078, + 0x1918, 0xa184, 0x0880, 0x00c0, 0x18a6, 0x8aff, 0x0040, 0x1918, + 0x2009, 0x0001, 0x1078, 0x16fb, 0x0078, 0x1918, 0x7803, 0x0004, + 0x7003, 0x0000, 0xd1bc, 0x00c0, 0x18da, 0x027e, 0x037e, 0x6b28, + 0x6a2c, 0x1078, 0x1c59, 0x0d7e, 0x0f7e, 0x2d78, 0x2804, 0xac68, + 0x6034, 0xd09c, 0x00c0, 0x18ca, 0x6808, 0x2008, 0xa31a, 0x680c, + 0xa213, 0x7810, 0xa100, 0x7812, 0x690c, 0x7814, 0xa101, 0x7816, + 0x0078, 0x18d6, 0x6810, 0x2008, 0xa31a, 0x6814, 0xa213, 0x7810, + 0xa100, 0x7812, 0x6914, 0x7814, 0xa101, 0x7816, 0x0f7f, 0x0d7f, + 0x0078, 0x17cf, 0x057e, 0x7d0c, 0x1078, 0x7592, 0x057f, 0x1078, + 0x191c, 0x682b, 0xffff, 0x682f, 0xffff, 0x697c, 0x6912, 0x6980, + 0x6916, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x1918, 0x7803, + 0x0004, 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x1902, 0x6808, + 0x8001, 0x680a, 0x00c0, 0x1902, 0x7004, 0x2060, 0x2009, 0x0048, + 0x1078, 0x5c29, 0x1078, 0x16b5, 0x0078, 0x1918, 0x7803, 0x0004, + 0x7003, 0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0040, 0x1902, + 0x2068, 0x6808, 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x16cc, + 0x017f, 0x007f, 0x127f, 0x007c, 0x1078, 0x192d, 0x20e1, 0x9028, + 0x700f, 0x7870, 0x7013, 0x7870, 0x2001, 0x015d, 0x200c, 0x810a, + 0x2102, 0x2001, 0x0138, 0x2202, 0x007c, 0x2001, 0x0138, 0x2014, + 0x2003, 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc, + 0x00c0, 0x194a, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048, 0x00c0, + 0x194a, 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, 0x194a, 0x8421, + 0x00c0, 0x1934, 0x007c, 0x2011, 0x0201, 0x2009, 0x003c, 0x2204, + 0xa005, 0x00c0, 0x1957, 0x8109, 0x00c0, 0x194f, 0x007c, 0x007c, + 0x1078, 0x194b, 0x0040, 0x1980, 0x7908, 0xd1ec, 0x00c0, 0x1970, + 0x1078, 0x19a6, 0x0040, 0x1970, 0x7803, 0x0009, 0x7904, 0xd1fc, + 0x0040, 0x1966, 0x7803, 0x0006, 0x1078, 0x194b, 0x0040, 0x1980, + 0x780c, 0xd0a4, 0x00c0, 0x1980, 0x7007, 0x0000, 0x1078, 0x19a6, + 0x0040, 0x1982, 0x7803, 0x0019, 0x7003, 0x0003, 0x0078, 0x1982, + 0x1078, 0x191c, 0x007c, 0x3c00, 0x007e, 0x0e7e, 0x2071, 0x0200, + 0x7808, 0xa084, 0xf000, 0xa10d, 0x1078, 0x192d, 0x20e1, 0x7000, + 0x7324, 0x7420, 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, + 0x712e, 0x702f, 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, + 0x0138, 0x2202, 0x0e7f, 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e, + 0x7908, 0xa18c, 0x0fff, 0xa182, 0x0009, 0x0048, 0x19b3, 0xa085, + 0x0001, 0x0078, 0x19c5, 0x2001, 0x020a, 0x81ff, 0x0040, 0x19be, + 0x20e1, 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000, + 0x200c, 0x200c, 0x7003, 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c, + 0x0e7e, 0x2071, 0x788b, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, + 0xa280, 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1a4a, 0x6934, + 0xa184, 0x0007, 0x0079, 0x19dc, 0x19e4, 0x1a35, 0x19e4, 0x19e4, + 0x19e4, 0x1a1a, 0x19f7, 0x19e6, 0x1078, 0x12d5, 0x684c, 0xd0b4, + 0x0040, 0x1b4c, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, + 0x687c, 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x1a3d, 0x6834, + 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x19e4, 0x684c, 0xd0b4, + 0x0040, 0x1b4c, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, + 0x687c, 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d, + 0x2004, 0xa084, 0x000f, 0xa080, 0x1c84, 0x2004, 0x6832, 0x6958, + 0x0078, 0x1a46, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x1a4a, + 0x684c, 0xd0b4, 0x0040, 0x1b4c, 0x6804, 0x681a, 0xa080, 0x000d, + 0x2004, 0xa084, 0x000f, 0xa080, 0x1c84, 0x2004, 0x6832, 0x6958, + 0xa006, 0x682e, 0x682a, 0x0078, 0x1a46, 0x684c, 0xd0b4, 0x0040, + 0x1789, 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834, + 0xa084, 0x000f, 0xa080, 0x1c84, 0x2004, 0x6832, 0x6926, 0x684c, + 0xc0dd, 0x684e, 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804, + 0xd0fc, 0x10c0, 0x1b50, 0x0e7e, 0x0d7e, 0x2071, 0x788b, 0x7000, + 0xa005, 0x00c0, 0x1ac6, 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c, + 0x7004, 0x2068, 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890, + 0x0f7e, 0x20e1, 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100, + 0x8004, 0x78d6, 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818, + 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184, + 0x0007, 0x0040, 0x1a88, 0x017e, 0x2009, 0x0008, 0xa102, 0x017f, + 0xa108, 0x791a, 0x7116, 0x701e, 0x680c, 0xa081, 0x0000, 0x781e, + 0x701a, 0xa006, 0x700e, 0x7012, 0x7004, 0x692c, 0x6814, 0xa106, + 0x00c0, 0x1a9f, 0x6928, 0x6810, 0xa106, 0x0040, 0x1aac, 0x037e, + 0x047e, 0x6b14, 0x6c10, 0x1078, 0x1ca4, 0x047f, 0x037f, 0x0040, + 0x1aac, 0x0c7f, 0x0078, 0x1ac6, 0x8aff, 0x00c0, 0x1ab4, 0x0c7f, + 0xa085, 0x0001, 0x0078, 0x1ac6, 0x127e, 0x2091, 0x8000, 0x2079, + 0x0020, 0x2009, 0x0001, 0x1078, 0x1aca, 0x0040, 0x1ac3, 0x2009, + 0x0001, 0x1078, 0x1aca, 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, + 0x0f7f, 0x007c, 0x077e, 0x067e, 0x057e, 0x047e, 0x037e, 0x027e, + 0x8aff, 0x0040, 0x1b45, 0x700c, 0x7214, 0xa202, 0x7010, 0x7218, + 0xa203, 0x0048, 0x1b44, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, + 0x1af7, 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1ae7, 0x1b26, + 0x1b07, 0x1b07, 0x1b26, 0x1b26, 0x1b1e, 0x1b26, 0x1b07, 0x1b26, + 0x1b0d, 0x1b0d, 0x1b26, 0x1b26, 0x1b26, 0x1b15, 0x1b0d, 0xc0fc, + 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1b2a, + 0x0d7e, 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1b29, 0x6b08, + 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x1b29, 0x6b10, 0x6a14, 0x6d00, + 0x6c04, 0x6f08, 0x6e0c, 0x0078, 0x1b29, 0x0d7f, 0x0d7e, 0x6834, + 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1b26, 0x0d7f, 0x1078, + 0x1c40, 0x00c0, 0x1ad0, 0xa00e, 0x0078, 0x1b45, 0x0d7f, 0x1078, + 0x12d5, 0x0d7f, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, + 0x7902, 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, + 0xa201, 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, + 0x1078, 0x1c40, 0x0078, 0x1b45, 0xa006, 0x027f, 0x037f, 0x047f, + 0x057f, 0x067f, 0x077f, 0x007c, 0x1078, 0x12d5, 0x1078, 0x12d5, + 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e, + 0x0c7e, 0x2079, 0x0020, 0x2071, 0x788b, 0x2b68, 0x6818, 0x2060, + 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1b4e, 0x7000, + 0x0079, 0x1b6a, 0x1c11, 0x1b6e, 0x1bde, 0x1c0f, 0x8001, 0x7002, + 0xd19c, 0x00c0, 0x1b82, 0x8aff, 0x0040, 0x1ba1, 0x2009, 0x0001, + 0x1078, 0x1aca, 0x0040, 0x1c11, 0x2009, 0x0001, 0x1078, 0x1aca, + 0x0078, 0x1c11, 0x7803, 0x0004, 0xd194, 0x0040, 0x1b92, 0x6850, + 0xc0fc, 0x6852, 0x8aff, 0x00c0, 0x1b97, 0x684c, 0xc0f5, 0x684e, + 0x0078, 0x1b97, 0x1078, 0x1c59, 0x6850, 0xc0fd, 0x6852, 0x2a00, + 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0078, + 0x1c11, 0x711c, 0x81ff, 0x0040, 0x1bb7, 0x7918, 0x7922, 0x7827, 0x0000, 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100, - 0x700e, 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1a09, 0x0f7e, + 0x700e, 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1c11, 0x0f7e, 0x027e, 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14, 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0, - 0x19bd, 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102, + 0x1bc5, 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102, 0x78c6, 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, - 0x7803, 0x0008, 0x7003, 0x0000, 0x0078, 0x1a09, 0x8001, 0x7002, - 0xd194, 0x0040, 0x19eb, 0x7804, 0xd0fc, 0x00c0, 0x1943, 0xd19c, - 0x00c0, 0x1a05, 0x8aff, 0x0040, 0x1a09, 0x2009, 0x0001, 0x1078, - 0x18b6, 0x0078, 0x1a09, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, - 0x1a58, 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x19fe, - 0x6808, 0xa31a, 0x680c, 0xa213, 0x0078, 0x1a02, 0x6810, 0xa31a, - 0x6814, 0xa213, 0x0d7f, 0x0078, 0x1979, 0x0078, 0x1975, 0x1078, - 0x12b7, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, - 0x007c, 0x7920, 0xa108, 0x7922, 0x7924, 0xa189, 0x0000, 0x7926, - 0x7930, 0xa10a, 0x7932, 0x7934, 0xa18b, 0x0000, 0x7936, 0x007c, - 0x0f7e, 0x0e7e, 0x2071, 0x6f63, 0x7000, 0xa086, 0x0000, 0x0040, - 0x1a3c, 0x2079, 0x0020, 0x7804, 0xa084, 0x0003, 0x0040, 0x1a36, - 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1a32, 0x20e1, 0x9040, - 0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, 0x8840, - 0x2804, 0xa005, 0x00c0, 0x1a53, 0x6004, 0xa005, 0x0040, 0x1a55, - 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1a82, 0x2044, - 0x88ff, 0x1040, 0x12b7, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c, - 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1a72, 0x2c00, 0xad06, - 0x0040, 0x1a67, 0x6000, 0xa005, 0x00c0, 0x1a67, 0x2d00, 0x2060, - 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1a92, 0x2044, 0x88ff, - 0x1040, 0x12b7, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d, - 0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021, - 0x0027, 0x0000, 0x0000, 0x1a78, 0x1a74, 0x0000, 0x0000, 0x8000, - 0x0000, 0x1a78, 0x0000, 0x1a7f, 0x1a7c, 0x0000, 0x0000, 0x0000, - 0x0000, 0x1a7f, 0x0000, 0x1a7a, 0x1a7a, 0x0000, 0x0000, 0x8000, - 0x0000, 0x1a7a, 0x0000, 0x1a80, 0x1a80, 0x0000, 0x0000, 0x0000, - 0x0000, 0x1a80, 0x0a7e, 0x097e, 0x087e, 0x6858, 0xa055, 0x0040, - 0x1b28, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x1a82, 0xa986, - 0x0007, 0x0040, 0x1ab7, 0xa986, 0x000f, 0x00c0, 0x1abb, 0x605c, - 0xa422, 0x6060, 0xa31a, 0x2804, 0xa045, 0x00c0, 0x1ac9, 0x0050, - 0x1ac3, 0x0078, 0x1b28, 0x6004, 0xa065, 0x0040, 0x1b28, 0x0078, - 0x1aaa, 0x2804, 0xa005, 0x0040, 0x1ae7, 0xac68, 0xd99c, 0x00c0, - 0x1ad7, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0078, 0x1adb, 0x6810, - 0xa422, 0x6814, 0xa31b, 0x0048, 0x1af5, 0x2300, 0xa405, 0x0040, - 0x1aed, 0x8a51, 0x0040, 0x1b28, 0x8840, 0x0078, 0x1ac9, 0x6004, - 0xa065, 0x0040, 0x1b28, 0x0078, 0x1aaa, 0x8a51, 0x8840, 0x2b68, - 0x6850, 0xc0fc, 0x6852, 0x0078, 0x1b22, 0x8422, 0x8420, 0x831a, - 0xa399, 0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, - 0x00c0, 0x1b10, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, - 0x1048, 0x12b7, 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1b1c, - 0x6910, 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x12b7, - 0x6800, 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, - 0xc0fd, 0x6852, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x1b2d, - 0x087f, 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0005, - 0x2004, 0xa084, 0x0007, 0x0079, 0x1b35, 0x1b3d, 0x1b3e, 0x1b41, - 0x1b44, 0x1b49, 0x1b4c, 0x1b51, 0x1b56, 0x007c, 0x1078, 0x1933, - 0x007c, 0x1078, 0x16e5, 0x007c, 0x1078, 0x16e5, 0x1078, 0x1933, - 0x007c, 0x1078, 0x143e, 0x007c, 0x1078, 0x1933, 0x1078, 0x143e, - 0x007c, 0x1078, 0x16e5, 0x1078, 0x143e, 0x007c, 0x1078, 0x16e5, - 0x1078, 0x1933, 0x1078, 0x143e, 0x007c, 0x127e, 0x2091, 0x2300, - 0x2079, 0x0200, 0x2071, 0x7280, 0x2069, 0x6d00, 0x2009, 0x0004, - 0x7912, 0x7916, 0x1078, 0x1df6, 0x781b, 0x0002, 0x20e1, 0x8700, - 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c, 0xa084, 0x0007, - 0x0079, 0x1b7a, 0x1b9e, 0x1b82, 0x1b86, 0x1b8a, 0x1b90, 0x1b94, - 0x1b98, 0x1b9c, 0x1078, 0x3d7c, 0x0078, 0x1b9e, 0x1078, 0x3db0, - 0x0078, 0x1b9e, 0x1078, 0x3d7c, 0x1078, 0x3db0, 0x0078, 0x1b9e, - 0x1078, 0x1ba0, 0x0078, 0x1b9e, 0x1078, 0x1ba0, 0x0078, 0x1b9e, - 0x1078, 0x1ba0, 0x0078, 0x1b9e, 0x1078, 0x1ba0, 0x127f, 0x007c, - 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003, 0x0040, 0x1baa, - 0x1078, 0x12b7, 0xa184, 0x0030, 0x0040, 0x1bbb, 0x6a00, 0xa286, - 0x0003, 0x00c0, 0x1bb5, 0x1078, 0x12b7, 0x1078, 0x31cb, 0x20e1, - 0x9010, 0x0078, 0x1bc7, 0xa184, 0x00c0, 0x0040, 0x1bc1, 0x1078, - 0x12b7, 0xa184, 0x0300, 0x0040, 0x1bc7, 0x20e1, 0x9020, 0x7932, - 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e, 0x2071, - 0x6d00, 0x7128, 0x2001, 0x6f03, 0x2102, 0x2001, 0x6f0b, 0x2102, - 0xa182, 0x0211, 0x00c8, 0x1be0, 0x2009, 0x0008, 0x0078, 0x1c0a, - 0xa182, 0x0259, 0x00c8, 0x1be8, 0x2009, 0x0007, 0x0078, 0x1c0a, - 0xa182, 0x02c1, 0x00c8, 0x1bf0, 0x2009, 0x0006, 0x0078, 0x1c0a, - 0xa182, 0x0349, 0x00c8, 0x1bf8, 0x2009, 0x0005, 0x0078, 0x1c0a, - 0xa182, 0x0421, 0x00c8, 0x1c00, 0x2009, 0x0004, 0x0078, 0x1c0a, - 0xa182, 0x0581, 0x00c8, 0x1c08, 0x2009, 0x0003, 0x0078, 0x1c0a, - 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0x7916, 0x1078, 0x1df6, - 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091, 0x2200, 0x2061, - 0x0100, 0x2071, 0x6d00, 0x6024, 0x6026, 0x6033, 0x00ef, 0x60e7, - 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, - 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x0caf, 0x600f, - 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001, 0x6d2d, 0x2003, - 0x0000, 0x2001, 0x6d2c, 0x2003, 0x0001, 0x007c, 0x127e, 0x2091, - 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184, 0x002c, 0x00c0, - 0x1c4d, 0xa184, 0x0007, 0x0079, 0x1c53, 0xa195, 0x0004, 0xa284, - 0x0007, 0x0079, 0x1c53, 0x1c7f, 0x1c5b, 0x1c5f, 0x1c63, 0x1c69, - 0x1c6d, 0x1c73, 0x1c79, 0x1078, 0x4226, 0x0078, 0x1c7f, 0x1078, - 0x42e4, 0x0078, 0x1c7f, 0x1078, 0x42e4, 0x1078, 0x4226, 0x0078, - 0x1c7f, 0x1078, 0x1c84, 0x0078, 0x1c7f, 0x1078, 0x4226, 0x1078, - 0x1c84, 0x0078, 0x1c7f, 0x1078, 0x42e4, 0x1078, 0x1c84, 0x0078, - 0x1c7f, 0x1078, 0x42e4, 0x1078, 0x4226, 0x1078, 0x1c84, 0x027f, - 0x017f, 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1d24, 0x017e, - 0x047e, 0x0c7e, 0x644c, 0x74ba, 0xa48c, 0xff00, 0xa196, 0xff00, - 0x0040, 0x1cb3, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116, 0x0040, - 0x1cb3, 0x7130, 0xd18c, 0x00c0, 0x1cb3, 0x2011, 0x6d52, 0x2214, - 0xd2ec, 0x0040, 0x1ca7, 0xc18d, 0x7132, 0x0078, 0x1cb3, 0x6240, - 0xa294, 0x0010, 0x0040, 0x1cf2, 0x6248, 0xa294, 0xff00, 0xa296, - 0xff00, 0x00c0, 0x1cf2, 0x2011, 0x8013, 0x1078, 0x2a53, 0x7130, - 0xc185, 0x7132, 0x2011, 0x6d52, 0x220c, 0xd1a4, 0x0040, 0x1cda, - 0x017e, 0x2009, 0x0001, 0x2011, 0x0100, 0x1078, 0x41f4, 0x2019, - 0x000e, 0x1078, 0x6b8f, 0xa484, 0x00ff, 0xa080, 0x2091, 0x200c, - 0xa18c, 0xff00, 0x810f, 0x8127, 0xa006, 0x2009, 0x000e, 0x1078, - 0x6bf7, 0x017f, 0xd1ac, 0x00c0, 0x1ce3, 0x2019, 0x0004, 0x1078, - 0x202f, 0x0078, 0x1cf2, 0x157e, 0x20a9, 0x007f, 0x2009, 0x0000, - 0x1078, 0x3447, 0x00c0, 0x1cee, 0x1078, 0x3256, 0x8108, 0x00f0, - 0x1ce8, 0x157f, 0x0c7f, 0x047f, 0x6043, 0x0000, 0x2009, 0x00f7, - 0x1078, 0x3233, 0x2011, 0x0003, 0x1078, 0x5232, 0x2011, 0x0002, - 0x1078, 0x523c, 0x1078, 0x5148, 0x1078, 0x414c, 0x037e, 0x2019, - 0x0000, 0x1078, 0x51da, 0x037f, 0x60e3, 0x0000, 0x017f, 0x2001, - 0x6d00, 0x2014, 0xa296, 0x0004, 0x00c0, 0x1d1c, 0xd19c, 0x00c0, - 0x1d1c, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x6d20, - 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0040, 0x1d9d, 0x017e, - 0x6220, 0xd2b4, 0x0040, 0x1d5b, 0x1078, 0x414c, 0x1078, 0x4fe5, - 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, - 0x0040, 0x1d3e, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, - 0x2061, 0x6f10, 0x6028, 0xa09a, 0x0002, 0x00c8, 0x1d4e, 0x8000, - 0x602a, 0x0c7f, 0x1078, 0x4fd7, 0x0078, 0x1d9c, 0x2019, 0x6f19, - 0x2304, 0xa065, 0x0040, 0x1d58, 0x2009, 0x0014, 0x1078, 0x5591, - 0x0c7f, 0x0078, 0x1d9c, 0xd2bc, 0x0040, 0x1d9c, 0x1078, 0x415a, - 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, - 0xa084, 0x4000, 0x0040, 0x1d70, 0x6803, 0x1000, 0x6803, 0x0000, - 0x0d7f, 0x0c7e, 0x2061, 0x6f10, 0x6044, 0xa09a, 0x0002, 0x00c8, - 0x1d91, 0x8000, 0x6046, 0x603c, 0x0c7f, 0xa005, 0x0040, 0x1d9c, - 0x1078, 0x4151, 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0, - 0x1d8d, 0x6017, 0x0012, 0x0078, 0x1d9c, 0x6017, 0x0016, 0x0078, - 0x1d9c, 0x2019, 0x6f1f, 0x2304, 0xa065, 0x0040, 0x1d9b, 0x2009, - 0x004a, 0x1078, 0x5591, 0x0c7f, 0x017f, 0xd19c, 0x0040, 0x1dc5, - 0x017e, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, 0x5232, - 0x2011, 0x0002, 0x1078, 0x523c, 0x1078, 0x5148, 0x1078, 0x414c, - 0x037e, 0x2019, 0x0000, 0x1078, 0x51da, 0x037f, 0x60e3, 0x0000, - 0x1078, 0x6c5f, 0x1078, 0x6c7d, 0x2001, 0x6d00, 0x2003, 0x0004, - 0x6027, 0x0008, 0x1078, 0x11aa, 0x017f, 0xa18c, 0xffd0, 0x6126, - 0x007c, 0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, - 0x8000, 0x2071, 0x6d00, 0x71b0, 0x70b2, 0xa116, 0x0040, 0x1def, - 0x81ff, 0x0040, 0x1de1, 0x2011, 0x8011, 0x1078, 0x2a53, 0x0078, - 0x1def, 0x2011, 0x8012, 0x1078, 0x2a53, 0x037e, 0x0c7e, 0x2061, - 0x0100, 0x2019, 0x0028, 0x1078, 0x202f, 0x0c7f, 0x037f, 0x127f, - 0x0f7f, 0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e, - 0x007e, 0x027e, 0x2061, 0x0100, 0xa190, 0x1e09, 0x2204, 0x60f2, - 0xa190, 0x1e12, 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f, - 0x007c, 0x083e, 0x083e, 0x083e, 0x0580, 0x0420, 0x0348, 0x02c0, - 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8, - 0x00d0, 0x00b0, 0x00a0, 0x2028, 0x2130, 0xa094, 0xff00, 0x00c0, - 0x1e24, 0x81ff, 0x0040, 0x1e28, 0x1078, 0x3f00, 0x0078, 0x1e2f, - 0xa080, 0x2091, 0x200c, 0xa18c, 0xff00, 0x810f, 0xa006, 0x007c, - 0xa080, 0x2091, 0x200c, 0xa18c, 0x00ff, 0x007c, 0x1e56, 0x1e5a, - 0x1e5e, 0x1e64, 0x1e6a, 0x1e70, 0x1e76, 0x1e7e, 0x1e86, 0x1e8c, - 0x1e92, 0x1e9a, 0x1ea2, 0x1eaa, 0x1eb2, 0x1ebc, 0x1ec6, 0x1ec6, - 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, - 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x107e, 0x007e, - 0x0078, 0x1edf, 0x107e, 0x007e, 0x0078, 0x1edf, 0x107e, 0x007e, - 0x1078, 0x1c3e, 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e, - 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b2e, 0x0078, 0x1edf, - 0x107e, 0x007e, 0x1078, 0x1b2e, 0x0078, 0x1edf, 0x107e, 0x007e, - 0x1078, 0x1c3e, 0x1078, 0x1b2e, 0x0078, 0x1edf, 0x107e, 0x007e, - 0x1078, 0x1c3e, 0x1078, 0x1b2e, 0x0078, 0x1edf, 0x107e, 0x007e, - 0x1078, 0x1b72, 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b72, - 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e, 0x1078, 0x1b72, - 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e, 0x1078, 0x1b72, - 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b2e, 0x1078, 0x1b72, - 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b2e, 0x1078, 0x1b72, - 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e, 0x1078, 0x1b2e, - 0x1078, 0x1b72, 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e, - 0x1078, 0x1b2e, 0x1078, 0x1b72, 0x0078, 0x1edf, 0x0005, 0x0078, - 0x1ec6, 0xb084, 0x003c, 0x8004, 0x8004, 0x0079, 0x1ecf, 0x1edf, - 0x1e5c, 0x1e60, 0x1e66, 0x1e6c, 0x1e72, 0x1e78, 0x1e80, 0x1e88, - 0x1e8e, 0x1e94, 0x1e9c, 0x1ea4, 0x1eac, 0x1eb4, 0x1ebe, 0x0008, - 0x1ec9, 0x007f, 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e, - 0x2041, 0x007e, 0x70bc, 0xd09c, 0x0040, 0x1ef0, 0x2041, 0x007f, - 0x2001, 0x010c, 0x203c, 0x727c, 0x82ff, 0x0040, 0x1f3b, 0x037e, - 0x738c, 0xa38e, 0xffff, 0x00c0, 0x1eff, 0x2019, 0x0001, 0x8314, - 0xa2e0, 0x73c0, 0x2c04, 0xa38c, 0x0001, 0x0040, 0x1f0c, 0xa084, - 0xff00, 0x8007, 0x0078, 0x1f0e, 0xa084, 0x00ff, 0xa70e, 0x0040, - 0x1f30, 0xa08e, 0x00ff, 0x0040, 0x1f36, 0x2009, 0x0000, 0x1078, - 0x1e1b, 0x1078, 0x3410, 0x00c0, 0x1f33, 0x6004, 0xa084, 0x00ff, - 0xa086, 0x0006, 0x00c0, 0x1f2a, 0x1078, 0x1f8d, 0x0040, 0x1f33, - 0x0078, 0x1f30, 0x1078, 0x208d, 0x1078, 0x1fb4, 0x0040, 0x1f33, - 0x8318, 0x0078, 0x1eff, 0x738e, 0x0078, 0x1f38, 0x708f, 0xffff, - 0x037f, 0x0078, 0x1f8a, 0xa780, 0x2091, 0x203c, 0xa7bc, 0xff00, - 0x873f, 0x708c, 0xa096, 0xffff, 0x0040, 0x1f4d, 0xa812, 0x00c8, - 0x1f5d, 0x708f, 0xffff, 0x0078, 0x1f87, 0x2009, 0x0000, 0x70bc, - 0xd09c, 0x0040, 0x1f58, 0xd094, 0x0040, 0x1f58, 0x2009, 0x007e, - 0x2100, 0xa802, 0x20a8, 0x0078, 0x1f61, 0x2008, 0x2810, 0xa202, - 0x20a8, 0x2700, 0x157e, 0x017e, 0xa106, 0x0040, 0x1f7e, 0x1078, - 0x3410, 0x00c0, 0x1f87, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, - 0x00c0, 0x1f78, 0x1078, 0x1f8d, 0x0040, 0x1f87, 0x0078, 0x1f7e, - 0x1078, 0x208d, 0x1078, 0x1fb4, 0x0040, 0x1f87, 0x017f, 0x8108, - 0x157f, 0x00f0, 0x1f61, 0x708f, 0xffff, 0x0078, 0x1f8a, 0x017f, - 0x157f, 0x718e, 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, - 0x0c7e, 0x2c68, 0x1078, 0x5504, 0x0040, 0x1faf, 0x2d00, 0x601a, - 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001, 0x0000, - 0x1078, 0x33f3, 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, - 0x127f, 0x2009, 0x0004, 0x1078, 0x5591, 0xa085, 0x0001, 0x0c7f, - 0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, - 0x2c68, 0x1078, 0x5504, 0x0040, 0x1fd6, 0x2d00, 0x601a, 0x601f, - 0x0001, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001, 0x0002, 0x1078, - 0x33f3, 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f, - 0x2009, 0x0002, 0x1078, 0x5591, 0xa085, 0x0001, 0x0c7f, 0x0d7f, - 0x077f, 0x017f, 0x007c, 0x0c7e, 0x027e, 0x2009, 0x0080, 0x1078, - 0x3410, 0x00c0, 0x1fe9, 0x1078, 0x1fec, 0x0040, 0x1fe9, 0x70c3, - 0xffff, 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, - 0x2c68, 0x1078, 0x5504, 0x0040, 0x200e, 0x2d00, 0x601a, 0x601f, - 0x0001, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001, 0x0002, 0x1078, - 0x33f3, 0x127e, 0x2091, 0x8000, 0x70c4, 0x8000, 0x70c6, 0x127f, - 0x2009, 0x0002, 0x1078, 0x5591, 0xa085, 0x0001, 0x0c7f, 0x0d7f, - 0x077f, 0x017f, 0x007c, 0x0c7e, 0x0d7e, 0x2009, 0x007f, 0x1078, - 0x3410, 0x00c0, 0x202c, 0x2c68, 0x1078, 0x5504, 0x0040, 0x202c, - 0x2d00, 0x601a, 0x6312, 0x601f, 0x0001, 0x620a, 0x2009, 0x0022, - 0x1078, 0x5591, 0xa085, 0x0001, 0x0d7f, 0x0c7f, 0x007c, 0x0e7e, - 0x0c7e, 0x067e, 0x037e, 0x027e, 0x1078, 0x4463, 0x1078, 0x4417, - 0x1078, 0x59ce, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, - 0x3447, 0x00c0, 0x2047, 0x1078, 0x35cf, 0x1078, 0x3256, 0x017f, - 0x8108, 0x00f0, 0x203e, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f, - 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270, - 0x72a0, 0x027e, 0x2019, 0x0029, 0x1078, 0x445c, 0x1078, 0x43a9, - 0x2c08, 0x1078, 0x6a57, 0x017f, 0x2e60, 0x1078, 0x35cf, 0x1078, - 0x3256, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, - 0x007e, 0x6018, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x00c0, 0x2083, - 0x2071, 0x6d00, 0x7088, 0xa005, 0x0040, 0x2080, 0x8001, 0x708a, - 0x007f, 0x0e7f, 0x007c, 0x2071, 0x6d00, 0x70c4, 0xa005, 0x0040, - 0x2080, 0x8001, 0x70c6, 0x0078, 0x2080, 0x6000, 0xc08c, 0x6002, - 0x007c, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, - 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, - 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, - 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, - 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, - 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, - 0x809b, 0x8098, 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, - 0x8081, 0x8080, 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, - 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, - 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, - 0x8056, 0x8055, 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, - 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, - 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, - 0x4831, 0x802e, 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, - 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, - 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, - 0x8000, 0x3800, 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, - 0x8000, 0x3400, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, - 0x3300, 0x3200, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, - 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, - 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, - 0x2800, 0x8000, 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, - 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, - 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, - 0x8000, 0x8000, 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, - 0x1500, 0x8000, 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, - 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, - 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, - 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, - 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, - 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, + 0x7803, 0x0008, 0x7003, 0x0000, 0x0078, 0x1c11, 0x8001, 0x7002, + 0xd194, 0x0040, 0x1bf3, 0x7804, 0xd0fc, 0x00c0, 0x1b60, 0xd19c, + 0x00c0, 0x1c0d, 0x8aff, 0x0040, 0x1c11, 0x2009, 0x0001, 0x1078, + 0x1aca, 0x0078, 0x1c11, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, + 0x1c59, 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1c06, + 0x6808, 0xa31a, 0x680c, 0xa213, 0x0078, 0x1c0a, 0x6810, 0xa31a, + 0x6814, 0xa213, 0x0d7f, 0x0078, 0x1b92, 0x0078, 0x1b92, 0x1078, + 0x12d5, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, + 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x788b, 0x7000, 0xa086, 0x0000, + 0x0040, 0x1c3d, 0x2079, 0x0020, 0x20e1, 0x9040, 0x7804, 0xd0fc, + 0x0040, 0x1c24, 0x1078, 0x1b50, 0x7000, 0xa086, 0x0000, 0x00c0, + 0x1c24, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1c33, 0x20e1, + 0x9040, 0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, + 0x8840, 0x2804, 0xa005, 0x00c0, 0x1c54, 0x6004, 0xa005, 0x0040, + 0x1c56, 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1c84, + 0x2044, 0x88ff, 0x1040, 0x12d5, 0x8a51, 0x007c, 0x2051, 0x0000, + 0x007c, 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1c73, 0x2c00, + 0xad06, 0x0040, 0x1c68, 0x6000, 0xa005, 0x00c0, 0x1c68, 0x2d00, + 0x2060, 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1c94, 0x2044, + 0x88ff, 0x1040, 0x12d5, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, + 0x001d, 0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, + 0x0021, 0x0027, 0x0000, 0x0000, 0x0000, 0x1c79, 0x1c75, 0x0000, + 0x0000, 0x1c83, 0x0000, 0x1c79, 0x0000, 0x1c80, 0x1c7d, 0x0000, + 0x0000, 0x0000, 0x1c83, 0x1c80, 0x0000, 0x1c7b, 0x1c7b, 0x0000, + 0x0000, 0x1c83, 0x0000, 0x1c7b, 0x0000, 0x1c81, 0x1c81, 0x0000, + 0x0000, 0x0000, 0x1c83, 0x1c81, 0x0a7e, 0x097e, 0x087e, 0x6858, + 0xa055, 0x0040, 0x1d45, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, + 0x1c84, 0xa986, 0x0007, 0x0040, 0x1cbd, 0xa986, 0x000e, 0x0040, + 0x1cbd, 0xa986, 0x000f, 0x00c0, 0x1cc1, 0x605c, 0xa422, 0x6060, + 0xa31a, 0x2804, 0xa045, 0x00c0, 0x1ccf, 0x0050, 0x1cc9, 0x0078, + 0x1d45, 0x6004, 0xa065, 0x0040, 0x1d45, 0x0078, 0x1cac, 0x2804, + 0xa005, 0x0040, 0x1ced, 0xac68, 0xd99c, 0x00c0, 0x1cdd, 0x6808, + 0xa422, 0x680c, 0xa31b, 0x0078, 0x1ce1, 0x6810, 0xa422, 0x6814, + 0xa31b, 0x0048, 0x1d0c, 0x2300, 0xa405, 0x0040, 0x1cf3, 0x8a51, + 0x0040, 0x1d45, 0x8840, 0x0078, 0x1ccf, 0x6004, 0xa065, 0x0040, + 0x1d45, 0x0078, 0x1cac, 0x8a51, 0x0040, 0x1d45, 0x8840, 0x2804, + 0xa005, 0x00c0, 0x1d06, 0x6004, 0xa065, 0x0040, 0x1d45, 0x6034, + 0xa0cc, 0x000f, 0xa9c0, 0x1c84, 0x2804, 0x2040, 0x2b68, 0x6850, + 0xc0fc, 0x6852, 0x0078, 0x1d39, 0x8422, 0x8420, 0x831a, 0xa399, + 0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0, + 0x1d27, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048, + 0x12d5, 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1d33, 0x6910, + 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x12d5, 0x6800, + 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd, + 0x6852, 0x2c00, 0x681a, 0x2800, 0x6832, 0x2a00, 0x6826, 0x007f, + 0x007f, 0x007f, 0xa006, 0x0078, 0x1d4a, 0x087f, 0x097f, 0x0a7f, + 0xa085, 0x0001, 0x007c, 0x2001, 0x0005, 0x2004, 0xa084, 0x0007, + 0x0079, 0x1d52, 0x1d5a, 0x1d5b, 0x1d5e, 0x1d61, 0x1d66, 0x1d69, + 0x1d6e, 0x1d73, 0x007c, 0x1078, 0x1b50, 0x007c, 0x1078, 0x178d, + 0x007c, 0x1078, 0x178d, 0x1078, 0x1b50, 0x007c, 0x1078, 0x145e, + 0x007c, 0x1078, 0x1b50, 0x1078, 0x145e, 0x007c, 0x1078, 0x178d, + 0x1078, 0x145e, 0x007c, 0x1078, 0x178d, 0x1078, 0x1b50, 0x1078, + 0x145e, 0x007c, 0x127e, 0x2091, 0x2300, 0x2079, 0x0200, 0x2071, + 0x7b80, 0x2069, 0x7600, 0x2009, 0x0004, 0x7912, 0x7817, 0x0004, + 0x1078, 0x2058, 0x781b, 0x0002, 0x20e1, 0x8700, 0x127f, 0x007c, + 0x127e, 0x2091, 0x2300, 0x781c, 0xa084, 0x0007, 0x0079, 0x1d98, + 0x1dbc, 0x1da0, 0x1da4, 0x1da8, 0x1dae, 0x1db2, 0x1db6, 0x1dba, + 0x1078, 0x417d, 0x0078, 0x1dbc, 0x1078, 0x41ac, 0x0078, 0x1dbc, + 0x1078, 0x417d, 0x1078, 0x41ac, 0x0078, 0x1dbc, 0x1078, 0x1dbe, + 0x0078, 0x1dbc, 0x1078, 0x1dbe, 0x0078, 0x1dbc, 0x1078, 0x1dbe, + 0x0078, 0x1dbc, 0x1078, 0x1dbe, 0x127f, 0x007c, 0x007e, 0x017e, + 0x027e, 0x7930, 0xa184, 0x0003, 0x0040, 0x1dc8, 0x1078, 0x12d5, + 0xa184, 0x0030, 0x0040, 0x1dd9, 0x6a00, 0xa286, 0x0003, 0x00c0, + 0x1dd3, 0x1078, 0x12d5, 0x1078, 0x357b, 0x20e1, 0x9010, 0x0078, + 0x1de5, 0xa184, 0x00c0, 0x0040, 0x1ddf, 0x1078, 0x12d5, 0xa184, + 0x0300, 0x0040, 0x1de5, 0x20e1, 0x9020, 0x7932, 0x027f, 0x017f, + 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e, 0x2071, 0x7600, 0x7128, + 0x2001, 0x7823, 0x2102, 0x2001, 0x782b, 0x2102, 0xa182, 0x0211, + 0x00c8, 0x1dfe, 0x2009, 0x0008, 0x0078, 0x1e28, 0xa182, 0x0259, + 0x00c8, 0x1e06, 0x2009, 0x0007, 0x0078, 0x1e28, 0xa182, 0x02c1, + 0x00c8, 0x1e0e, 0x2009, 0x0006, 0x0078, 0x1e28, 0xa182, 0x0349, + 0x00c8, 0x1e16, 0x2009, 0x0005, 0x0078, 0x1e28, 0xa182, 0x0421, + 0x00c8, 0x1e1e, 0x2009, 0x0004, 0x0078, 0x1e28, 0xa182, 0x0581, + 0x00c8, 0x1e26, 0x2009, 0x0003, 0x0078, 0x1e28, 0x2009, 0x0002, + 0x2079, 0x0200, 0x7912, 0xa182, 0x0005, 0x00c8, 0x1e32, 0x7916, + 0x0078, 0x1e34, 0x7817, 0x0004, 0x1078, 0x2058, 0x0f7f, 0x0e7f, + 0x017f, 0x007c, 0x127e, 0x2091, 0x2200, 0x2061, 0x0100, 0x2071, + 0x7600, 0x6024, 0x6026, 0x6033, 0x00ef, 0x60e7, 0x0000, 0x60eb, + 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f, + 0x0080, 0x602f, 0x0000, 0x6007, 0x0caf, 0x600f, 0x00ff, 0x602b, + 0x002f, 0x127f, 0x007c, 0x2001, 0x762d, 0x2003, 0x0000, 0x2001, + 0x762c, 0x2003, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x007e, + 0x017e, 0x027e, 0x6124, 0xa184, 0x002c, 0x00c0, 0x1e73, 0xa184, + 0x0007, 0x0079, 0x1e79, 0xa195, 0x0004, 0xa284, 0x0007, 0x0079, + 0x1e79, 0x1ea5, 0x1e81, 0x1e85, 0x1e89, 0x1e8f, 0x1e93, 0x1e99, + 0x1e9f, 0x1078, 0x46e6, 0x0078, 0x1ea5, 0x1078, 0x47d5, 0x0078, + 0x1ea5, 0x1078, 0x47d5, 0x1078, 0x46e6, 0x0078, 0x1ea5, 0x1078, + 0x1eaa, 0x0078, 0x1ea5, 0x1078, 0x46e6, 0x1078, 0x1eaa, 0x0078, + 0x1ea5, 0x1078, 0x47d5, 0x1078, 0x1eaa, 0x0078, 0x1ea5, 0x1078, + 0x47d5, 0x1078, 0x46e6, 0x1078, 0x1eaa, 0x027f, 0x017f, 0x007f, + 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1f5e, 0x017e, 0x047e, 0x0c7e, + 0x644c, 0x74ba, 0xa48c, 0xff00, 0xa196, 0xff00, 0x0040, 0x1ed9, + 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116, 0x0040, 0x1ed9, 0x7130, + 0xd18c, 0x00c0, 0x1ed9, 0x2011, 0x7652, 0x2214, 0xd2ec, 0x0040, + 0x1ecd, 0xc18d, 0x7132, 0x0078, 0x1ed9, 0x6240, 0xa294, 0x0010, + 0x0040, 0x1f1b, 0x6248, 0xa294, 0xff00, 0xa296, 0xff00, 0x00c0, + 0x1f1b, 0x037e, 0x73b8, 0x2011, 0x8013, 0x1078, 0x2d4a, 0x037f, + 0x7130, 0xc185, 0x7132, 0x2011, 0x7652, 0x220c, 0xd1a4, 0x0040, + 0x1f03, 0x017e, 0x2009, 0x0001, 0x2011, 0x0100, 0x1078, 0x46b4, + 0x2019, 0x000e, 0x1078, 0x74d9, 0xa484, 0x00ff, 0xa080, 0x232f, + 0x200c, 0xa18c, 0xff00, 0x810f, 0x8127, 0xa006, 0x2009, 0x000e, + 0x1078, 0x7541, 0x017f, 0xd1ac, 0x00c0, 0x1f0c, 0x2019, 0x0004, + 0x1078, 0x2299, 0x0078, 0x1f1b, 0x157e, 0x20a9, 0x007f, 0x2009, + 0x0000, 0x1078, 0x3825, 0x00c0, 0x1f17, 0x1078, 0x3621, 0x8108, + 0x00f0, 0x1f11, 0x157f, 0x0c7f, 0x047f, 0x6043, 0x0000, 0x2009, + 0x00f7, 0x1078, 0x35e4, 0x0f7e, 0x2079, 0x7849, 0x783c, 0xa086, + 0x0000, 0x0040, 0x1f33, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, + 0x0140, 0x7803, 0x0000, 0x0f7f, 0x2011, 0x0003, 0x1078, 0x57c0, + 0x2011, 0x0002, 0x1078, 0x57ca, 0x1078, 0x56d6, 0x1078, 0x45eb, + 0x037e, 0x2019, 0x0000, 0x1078, 0x5768, 0x037f, 0x60e3, 0x0000, + 0x017f, 0x2001, 0x7600, 0x2014, 0xa296, 0x0004, 0x00c0, 0x1f56, + 0xd19c, 0x00c0, 0x1f56, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, + 0x2001, 0x7620, 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0040, + 0x1fff, 0x0f7e, 0x2079, 0x7849, 0x783c, 0xa086, 0x0001, 0x00c0, + 0x1f82, 0x017e, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, + 0x7803, 0x1000, 0x7803, 0x0000, 0x2079, 0x7836, 0x7807, 0x0000, + 0x7833, 0x0000, 0x1078, 0x4c7a, 0x1078, 0x4d3a, 0x017f, 0x0f7f, + 0x0078, 0x1fff, 0x0f7f, 0x017e, 0x6220, 0xd2b4, 0x0040, 0x1fb7, + 0x1078, 0x45eb, 0x1078, 0x5582, 0x6027, 0x0004, 0x0d7e, 0x2069, + 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x1f9a, 0x6803, 0x1000, + 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x7836, 0x6028, 0xa09a, + 0x0002, 0x00c8, 0x1faa, 0x8000, 0x602a, 0x0c7f, 0x1078, 0x5574, + 0x0078, 0x1ffe, 0x2019, 0x783f, 0x2304, 0xa065, 0x0040, 0x1fb4, + 0x2009, 0x0027, 0x1078, 0x5c29, 0x0c7f, 0x0078, 0x1ffe, 0xd2bc, + 0x0040, 0x1ffe, 0x1078, 0x45f9, 0x6017, 0x0010, 0x6027, 0x0004, + 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x1fcc, + 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x7836, + 0x6044, 0xa09a, 0x0002, 0x00c8, 0x1fed, 0x8000, 0x6046, 0x603c, + 0x0c7f, 0xa005, 0x0040, 0x1ffe, 0x1078, 0x45f0, 0xa080, 0x0007, + 0x2004, 0xa086, 0x0006, 0x00c0, 0x1fe9, 0x6017, 0x0012, 0x0078, + 0x1ffe, 0x6017, 0x0016, 0x0078, 0x1ffe, 0x037e, 0x2019, 0x0001, + 0x1078, 0x5768, 0x037f, 0x2019, 0x7845, 0x2304, 0xa065, 0x0040, + 0x1ffd, 0x2009, 0x004f, 0x1078, 0x5c29, 0x0c7f, 0x017f, 0xd19c, + 0x0040, 0x2027, 0x017e, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, + 0x1078, 0x57c0, 0x2011, 0x0002, 0x1078, 0x57ca, 0x1078, 0x56d6, + 0x1078, 0x45eb, 0x037e, 0x2019, 0x0000, 0x1078, 0x5768, 0x037f, + 0x60e3, 0x0000, 0x1078, 0x75b0, 0x1078, 0x75ce, 0x2001, 0x7600, + 0x2003, 0x0004, 0x6027, 0x0008, 0x1078, 0x11c6, 0x017f, 0xa18c, + 0xffd0, 0x6126, 0x007c, 0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, + 0x127e, 0x2091, 0x8000, 0x2071, 0x7600, 0x71b0, 0x70b2, 0xa116, + 0x0040, 0x2051, 0x81ff, 0x0040, 0x2043, 0x2011, 0x8011, 0x1078, + 0x2d4a, 0x0078, 0x2051, 0x2011, 0x8012, 0x1078, 0x2d4a, 0x037e, + 0x0c7e, 0x2061, 0x0100, 0x2019, 0x0028, 0x1078, 0x2299, 0x0c7f, + 0x037f, 0x127f, 0x0f7f, 0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, + 0x0c7e, 0x0f7e, 0x007e, 0x027e, 0x2061, 0x0100, 0xa190, 0x2073, + 0x2204, 0x60f2, 0xa192, 0x0005, 0x00c8, 0x206a, 0xa190, 0x207c, + 0x0078, 0x206c, 0x2011, 0x2080, 0x2204, 0x60ee, 0x027f, 0x007f, + 0x0f7f, 0x0c7f, 0x007c, 0x0840, 0x0840, 0x0840, 0x0580, 0x0420, + 0x0348, 0x02c0, 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8, + 0x0140, 0x00f8, 0x00d0, 0x00b0, 0x00a0, 0x2028, 0x2130, 0xa094, + 0xff00, 0x00c0, 0x208e, 0x81ff, 0x0040, 0x2092, 0x1078, 0x4330, + 0x0078, 0x2099, 0xa080, 0x232f, 0x200c, 0xa18c, 0xff00, 0x810f, + 0xa006, 0x007c, 0xa080, 0x232f, 0x200c, 0xa18c, 0x00ff, 0x007c, + 0x20c0, 0x20c4, 0x20c8, 0x20ce, 0x20d4, 0x20da, 0x20e0, 0x20e8, + 0x20f0, 0x20f6, 0x20fc, 0x2104, 0x210c, 0x2114, 0x211c, 0x2126, + 0x2130, 0x2130, 0x2130, 0x2130, 0x2130, 0x2130, 0x2130, 0x2130, + 0x2130, 0x2130, 0x2130, 0x2130, 0x2130, 0x2130, 0x2130, 0x2130, + 0x107e, 0x007e, 0x0078, 0x2149, 0x107e, 0x007e, 0x0078, 0x2149, + 0x107e, 0x007e, 0x1078, 0x1e64, 0x0078, 0x2149, 0x107e, 0x007e, + 0x1078, 0x1e64, 0x0078, 0x2149, 0x107e, 0x007e, 0x1078, 0x1d4b, + 0x0078, 0x2149, 0x107e, 0x007e, 0x1078, 0x1d4b, 0x0078, 0x2149, + 0x107e, 0x007e, 0x1078, 0x1e64, 0x1078, 0x1d4b, 0x0078, 0x2149, + 0x107e, 0x007e, 0x1078, 0x1e64, 0x1078, 0x1d4b, 0x0078, 0x2149, + 0x107e, 0x007e, 0x1078, 0x1d90, 0x0078, 0x2149, 0x107e, 0x007e, + 0x1078, 0x1d90, 0x0078, 0x2149, 0x107e, 0x007e, 0x1078, 0x1e64, + 0x1078, 0x1d90, 0x0078, 0x2149, 0x107e, 0x007e, 0x1078, 0x1e64, + 0x1078, 0x1d90, 0x0078, 0x2149, 0x107e, 0x007e, 0x1078, 0x1d4b, + 0x1078, 0x1d90, 0x0078, 0x2149, 0x107e, 0x007e, 0x1078, 0x1d4b, + 0x1078, 0x1d90, 0x0078, 0x2149, 0x107e, 0x007e, 0x1078, 0x1e64, + 0x1078, 0x1d4b, 0x1078, 0x1d90, 0x0078, 0x2149, 0x107e, 0x007e, + 0x1078, 0x1e64, 0x1078, 0x1d4b, 0x1078, 0x1d90, 0x0078, 0x2149, + 0x0005, 0x0078, 0x2130, 0xb084, 0x003c, 0x8004, 0x8004, 0x0079, + 0x2139, 0x2149, 0x20c6, 0x20ca, 0x20d0, 0x20d6, 0x20dc, 0x20e2, + 0x20ea, 0x20f2, 0x20f8, 0x20fe, 0x2106, 0x210e, 0x2116, 0x211e, + 0x2128, 0x0008, 0x2133, 0x007f, 0x107f, 0x2091, 0x8001, 0x007c, + 0x0c7e, 0x027e, 0x2041, 0x007e, 0x70bc, 0xd09c, 0x0040, 0x215a, + 0x2041, 0x007f, 0x2001, 0x010c, 0x203c, 0x727c, 0x82ff, 0x0040, + 0x21a5, 0x037e, 0x738c, 0xa38e, 0xffff, 0x00c0, 0x2169, 0x2019, + 0x0001, 0x8314, 0xa2e0, 0x7cc0, 0x2c04, 0xa38c, 0x0001, 0x0040, + 0x2176, 0xa084, 0xff00, 0x8007, 0x0078, 0x2178, 0xa084, 0x00ff, + 0xa70e, 0x0040, 0x219a, 0xa08e, 0x00ff, 0x0040, 0x21a0, 0x2009, + 0x0000, 0x1078, 0x2085, 0x1078, 0x37ee, 0x00c0, 0x219d, 0x6004, + 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2194, 0x1078, 0x21f7, + 0x0040, 0x219d, 0x0078, 0x219a, 0x1078, 0x22fb, 0x1078, 0x221e, + 0x0040, 0x219d, 0x8318, 0x0078, 0x2169, 0x738e, 0x0078, 0x21a2, + 0x708f, 0xffff, 0x037f, 0x0078, 0x21f4, 0xa780, 0x232f, 0x203c, + 0xa7bc, 0xff00, 0x873f, 0x708c, 0xa096, 0xffff, 0x0040, 0x21b7, + 0xa812, 0x00c8, 0x21c7, 0x708f, 0xffff, 0x0078, 0x21f1, 0x2009, + 0x0000, 0x70bc, 0xd09c, 0x0040, 0x21c2, 0xd094, 0x0040, 0x21c2, + 0x2009, 0x007e, 0x2100, 0xa802, 0x20a8, 0x0078, 0x21cb, 0x2008, + 0x2810, 0xa202, 0x20a8, 0x2700, 0x157e, 0x017e, 0xa106, 0x0040, + 0x21e8, 0x1078, 0x37ee, 0x00c0, 0x21f1, 0x6004, 0xa084, 0x00ff, + 0xa086, 0x0006, 0x00c0, 0x21e2, 0x1078, 0x21f7, 0x0040, 0x21f1, + 0x0078, 0x21e8, 0x1078, 0x22fb, 0x1078, 0x221e, 0x0040, 0x21f1, + 0x017f, 0x8108, 0x157f, 0x00f0, 0x21cb, 0x708f, 0xffff, 0x0078, + 0x21f4, 0x017f, 0x157f, 0x718e, 0x027f, 0x0c7f, 0x007c, 0x017e, + 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x5b9c, 0x0040, 0x2219, + 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x37bd, + 0x2001, 0x0000, 0x1078, 0x37d1, 0x127e, 0x2091, 0x8000, 0x7088, + 0x8000, 0x708a, 0x127f, 0x2009, 0x0004, 0x1078, 0x5c29, 0xa085, + 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e, 0x077e, + 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x5b9c, 0x0040, 0x2240, 0x2d00, + 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x37bd, 0x2001, + 0x0002, 0x1078, 0x37d1, 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, + 0x708a, 0x127f, 0x2009, 0x0002, 0x1078, 0x5c29, 0xa085, 0x0001, + 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x0c7e, 0x027e, 0x2009, + 0x0080, 0x1078, 0x37ee, 0x00c0, 0x2253, 0x1078, 0x2256, 0x0040, + 0x2253, 0x70c3, 0xffff, 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, + 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x5b9c, 0x0040, 0x2278, 0x2d00, + 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x37bd, 0x2001, + 0x0002, 0x1078, 0x37d1, 0x127e, 0x2091, 0x8000, 0x70c4, 0x8000, + 0x70c6, 0x127f, 0x2009, 0x0002, 0x1078, 0x5c29, 0xa085, 0x0001, + 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x0c7e, 0x0d7e, 0x2009, + 0x007f, 0x1078, 0x37ee, 0x00c0, 0x2296, 0x2c68, 0x1078, 0x5b9c, + 0x0040, 0x2296, 0x2d00, 0x601a, 0x6312, 0x601f, 0x0001, 0x620a, + 0x2009, 0x0022, 0x1078, 0x5c29, 0xa085, 0x0001, 0x0d7f, 0x0c7f, + 0x007c, 0x0e7e, 0x0c7e, 0x067e, 0x037e, 0x027e, 0x1078, 0x4969, + 0x1078, 0x4919, 0x1078, 0x6103, 0x20a9, 0x007f, 0x2009, 0x0000, + 0x017e, 0x1078, 0x3825, 0x00c0, 0x22b1, 0x1078, 0x39a6, 0x1078, + 0x3621, 0x017f, 0x8108, 0x00f0, 0x22a8, 0x027f, 0x037f, 0x067f, + 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, + 0x6218, 0x2270, 0x72a0, 0x027e, 0x2019, 0x0029, 0x1078, 0x4962, + 0x1078, 0x48a5, 0x2c08, 0x1078, 0x737b, 0x017f, 0x2e60, 0x1078, + 0x39a6, 0x6210, 0x6314, 0x1078, 0x3621, 0x6212, 0x6316, 0x017f, + 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x6018, + 0xa080, 0x0028, 0x2004, 0xd0bc, 0x00c0, 0x22f1, 0x2071, 0x7600, + 0x7088, 0xa005, 0x0040, 0x22ee, 0x8001, 0x708a, 0x007f, 0x0e7f, + 0x007c, 0x2071, 0x7600, 0x70c4, 0xa005, 0x0040, 0x22ee, 0x8001, + 0x70c6, 0x0078, 0x22ee, 0x6000, 0xc08c, 0x6002, 0x007c, 0x0e7e, + 0x0c7e, 0x037e, 0x027e, 0x017e, 0x157e, 0x81ff, 0x00c0, 0x230c, + 0x20a9, 0x0001, 0x0078, 0x2310, 0x20a9, 0x007f, 0x2011, 0x0000, + 0x027e, 0xa2e0, 0x7720, 0x2c64, 0x8cff, 0x0040, 0x2322, 0x2019, + 0x0029, 0x1078, 0x4962, 0x1078, 0x48a5, 0x2c08, 0x1078, 0x737b, + 0x1078, 0x39a6, 0x027f, 0x8210, 0x00f0, 0x2310, 0x027e, 0x027f, + 0x157f, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x7eef, + 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, + 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, + 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, + 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, + 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, + 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, + 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080, + 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, + 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, + 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055, + 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, + 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, + 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, + 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025, + 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, + 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800, + 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400, + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200, + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000, + 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, + 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, + 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000, + 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, + 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000, + 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000, + 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, + 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, + 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500, + 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100, + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, - 0x8000, 0x2071, 0x6d6d, 0x7003, 0x0002, 0xa006, 0x7012, 0x7016, - 0x703a, 0x703e, 0x7033, 0x6d7d, 0x7037, 0x6d7d, 0x7007, 0x0001, - 0x2061, 0x6d9d, 0x6003, 0x0002, 0x007c, 0x0090, 0x21b8, 0x0068, - 0x21b8, 0x2071, 0x6d6d, 0x2b78, 0x7818, 0xd084, 0x00c0, 0x21b8, - 0x2a60, 0x7820, 0xa08e, 0x0069, 0x00c0, 0x229c, 0x0079, 0x223c, - 0x007c, 0x2071, 0x6d6d, 0x7004, 0x0079, 0x21be, 0x21c2, 0x21c3, - 0x21cd, 0x21df, 0x007c, 0x0090, 0x21cc, 0x0068, 0x21cc, 0x2b78, - 0x7818, 0xd084, 0x0040, 0x21eb, 0x007c, 0x2b78, 0x2061, 0x6d9d, - 0x6008, 0xa08e, 0x0100, 0x0040, 0x21da, 0xa086, 0x0200, 0x0040, - 0x2294, 0x007c, 0x7014, 0x2068, 0x2a60, 0x7018, 0x007a, 0x7010, - 0x2068, 0x6834, 0xa086, 0x0103, 0x0040, 0x21e7, 0x007c, 0x2a60, - 0x2b78, 0x7018, 0x007a, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x00c8, - 0x21f4, 0x61b0, 0x0079, 0x21fc, 0x2100, 0xa08a, 0x0033, 0x00c8, - 0x2290, 0x61b0, 0x0079, 0x223c, 0x2272, 0x22a4, 0x22ac, 0x22b0, - 0x22b8, 0x22be, 0x22c2, 0x22cb, 0x22cf, 0x22d7, 0x22db, 0x2290, - 0x2290, 0x2290, 0x22df, 0x2290, 0x22ef, 0x2306, 0x231d, 0x2399, - 0x239e, 0x23cb, 0x2416, 0x2425, 0x2446, 0x247c, 0x2486, 0x2493, - 0x24a6, 0x24be, 0x24c7, 0x2504, 0x250a, 0x2290, 0x251a, 0x2290, - 0x2290, 0x2290, 0x2290, 0x2290, 0x251e, 0x2524, 0x2290, 0x2290, - 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x252c, 0x2290, - 0x2290, 0x2290, 0x2290, 0x2290, 0x2539, 0x253f, 0x2290, 0x2290, - 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, - 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, - 0x2290, 0x2290, 0x2290, 0x2290, 0x22d7, 0x22db, 0x2290, 0x2290, - 0x2551, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, - 0x2290, 0x2290, 0x2290, 0x2290, 0x259e, 0x265d, 0x2671, 0x2678, - 0x26db, 0x2736, 0x2741, 0x2783, 0x2790, 0x279d, 0x27a0, 0x2555, - 0x27c9, 0x2811, 0x281e, 0x28fd, 0x29cb, 0x29f2, 0x2ade, 0x713c, - 0x0078, 0x2272, 0x2021, 0x4000, 0x1078, 0x2a2d, 0x127e, 0x2091, - 0x8000, 0x0068, 0x227f, 0x7818, 0xd084, 0x0040, 0x2282, 0x127f, - 0x0078, 0x2276, 0x781b, 0x0001, 0x7c22, 0x7926, 0x7a2a, 0x7b2e, - 0x2091, 0x4080, 0x7007, 0x0001, 0x2091, 0x5000, 0x127f, 0x007c, - 0x2021, 0x4001, 0x0078, 0x2274, 0x2021, 0x4002, 0x0078, 0x2274, - 0x2021, 0x4003, 0x0078, 0x2274, 0x2021, 0x4005, 0x0078, 0x2274, - 0x2021, 0x4006, 0x0078, 0x2274, 0xa02e, 0x2520, 0x7b28, 0x7a2c, - 0x7824, 0x7930, 0x0078, 0x2a3c, 0x7823, 0x0004, 0x7824, 0x007a, - 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2a40, - 0x7924, 0x7828, 0x2114, 0x200a, 0x0078, 0x2272, 0x7924, 0x2114, - 0x0078, 0x2272, 0x2099, 0x0009, 0x20a1, 0x0009, 0x20a9, 0x0007, - 0x53a3, 0x0078, 0x2272, 0x7824, 0x2060, 0x0078, 0x22e1, 0x2009, - 0x0001, 0x2011, 0x000d, 0x2019, 0x0000, 0x0078, 0x2272, 0x7d38, - 0x7c3c, 0x0078, 0x22a6, 0x7d38, 0x7c3c, 0x0078, 0x22b2, 0x2061, - 0x1000, 0x610c, 0xa006, 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0, - 0x22e3, 0x2010, 0xa005, 0x0040, 0x2272, 0x0078, 0x2298, 0x2061, - 0x6d51, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x22a0, 0x8019, 0x0040, - 0x22a0, 0x604a, 0x6142, 0x782c, 0x6052, 0x7828, 0x6056, 0xa006, - 0x605a, 0x605e, 0x1078, 0x3890, 0x0078, 0x2272, 0x2061, 0x6d51, - 0x7824, 0x7930, 0xa11a, 0x00c8, 0x22a0, 0x8019, 0x0040, 0x22a0, - 0x604e, 0x6146, 0x782c, 0x6062, 0x7828, 0x6066, 0xa006, 0x606a, - 0x606e, 0x1078, 0x366e, 0x0078, 0x2272, 0xa02e, 0x2520, 0x81ff, - 0x00c0, 0x229c, 0x7924, 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1, - 0x6d74, 0x41a1, 0x1078, 0x2a04, 0x0040, 0x229c, 0x2009, 0x0020, - 0x1078, 0x2a3c, 0x701b, 0x2335, 0x007c, 0x6834, 0x2008, 0xa084, - 0x00ff, 0xa096, 0x0011, 0x0040, 0x2341, 0xa096, 0x0019, 0x00c0, - 0x229c, 0x810f, 0xa18c, 0x00ff, 0x0040, 0x229c, 0x710e, 0x700c, - 0x8001, 0x0040, 0x2372, 0x700e, 0x1078, 0x2a04, 0x0040, 0x229c, - 0x2009, 0x0020, 0x2061, 0x6d9d, 0x6224, 0x6328, 0x642c, 0x6530, - 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, - 0x1078, 0x2a3c, 0x701b, 0x2365, 0x007c, 0x6834, 0xa084, 0x00ff, - 0xa096, 0x0002, 0x0040, 0x2370, 0xa096, 0x000a, 0x00c0, 0x229c, - 0x0078, 0x2347, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078, - 0x3344, 0x00c0, 0x2380, 0x7007, 0x0003, 0x701b, 0x2382, 0x007c, - 0x1078, 0x372d, 0x127e, 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, - 0x6d74, 0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, - 0xa5a9, 0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x127f, 0x0078, - 0x2a40, 0x6198, 0x7824, 0x609a, 0x0078, 0x2272, 0x2091, 0x8000, - 0x7823, 0x4000, 0x7827, 0x4953, 0x782b, 0x5020, 0x782f, 0x2020, - 0x2009, 0x017f, 0x2104, 0x7832, 0x3f00, 0x7836, 0x2061, 0x0100, - 0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0xa205, 0x783a, 0x2009, - 0x04fd, 0x2104, 0x783e, 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, - 0x4080, 0x2071, 0x0010, 0x20c1, 0x00f0, 0xa08a, 0x0003, 0x00c8, - 0x0427, 0x0078, 0x0423, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c, - 0x0040, 0x22a0, 0x7c28, 0x7d2c, 0x1078, 0x3592, 0xd28c, 0x00c0, - 0x23dd, 0x1078, 0x3522, 0x0078, 0x23df, 0x1078, 0x355e, 0x00c0, - 0x2409, 0x2061, 0x7400, 0x127e, 0x2091, 0x8000, 0x6000, 0xa086, - 0x0000, 0x0040, 0x23f7, 0x6010, 0xa06d, 0x0040, 0x23f7, 0x683c, - 0xa406, 0x00c0, 0x23f7, 0x6840, 0xa506, 0x0040, 0x2402, 0x127f, - 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004, 0xac02, 0x00c8, 0x229c, - 0x0078, 0x23e3, 0x1078, 0x5f5d, 0x127f, 0x0040, 0x229c, 0x0078, - 0x2272, 0xa00e, 0x2001, 0x0005, 0x1078, 0x372d, 0x127e, 0x2091, - 0x8000, 0x1078, 0x36a1, 0x127f, 0x0078, 0x2272, 0x81ff, 0x00c0, - 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078, 0x34d7, 0x1078, - 0x35a3, 0x0040, 0x229c, 0x0078, 0x2272, 0x81ff, 0x00c0, 0x229c, - 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x2031, 0x000f, 0x1078, 0x34d7, - 0x8631, 0x00c8, 0x242e, 0x2019, 0x0005, 0x1078, 0x35c4, 0x0040, - 0x229c, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x22a0, 0x8003, 0x800b, - 0x810b, 0xa108, 0x1078, 0x40de, 0x0078, 0x2272, 0x127e, 0x2091, - 0x8000, 0x81ff, 0x00c0, 0x2476, 0x2029, 0x00ff, 0x644c, 0x2400, - 0xa506, 0x0040, 0x2470, 0x2508, 0x1078, 0x3447, 0x00c0, 0x2470, - 0x2031, 0x000f, 0x1078, 0x34d7, 0x8631, 0x00c8, 0x245a, 0x2019, - 0x0004, 0x1078, 0x35c4, 0x0040, 0x2476, 0x7824, 0xa08a, 0x1000, - 0x00c8, 0x2479, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x40de, - 0x8529, 0x00c8, 0x244f, 0x127f, 0x0078, 0x2272, 0x127f, 0x0078, - 0x229c, 0x127f, 0x0078, 0x22a0, 0x1078, 0x2a1c, 0x0040, 0x22a0, - 0x1078, 0x3507, 0x1078, 0x3592, 0x0078, 0x2272, 0x81ff, 0x00c0, - 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078, 0x34f0, 0x1078, - 0x3592, 0x0078, 0x2272, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c, - 0x0040, 0x22a0, 0x1078, 0x3561, 0x0040, 0x229c, 0x1078, 0x338c, - 0x1078, 0x351b, 0x1078, 0x3592, 0x0078, 0x2272, 0x1078, 0x2a1c, - 0x0040, 0x22a0, 0x1078, 0x34d7, 0x62a0, 0x2019, 0x0005, 0x0c7e, - 0x1078, 0x35cf, 0x0c7f, 0x1078, 0x445c, 0x1078, 0x43a9, 0x2c08, - 0x1078, 0x6a57, 0x1078, 0x3592, 0x0078, 0x2272, 0x1078, 0x2a1c, - 0x0040, 0x22a0, 0x1078, 0x3592, 0x2208, 0x0078, 0x2272, 0x157e, - 0x0d7e, 0x0e7e, 0x2069, 0x6ddf, 0x6810, 0x6914, 0xa10a, 0x00c8, - 0x24d3, 0x2009, 0x0000, 0x6816, 0x2011, 0x0000, 0x2019, 0x0000, - 0x20a9, 0x007e, 0x2069, 0x6e00, 0x2d04, 0xa075, 0x0040, 0x24e8, - 0x704c, 0x1078, 0x24f2, 0xa210, 0x7080, 0x1078, 0x24f2, 0xa318, - 0x8d68, 0x00f0, 0x24dc, 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f, - 0x0078, 0x2272, 0x0f7e, 0x017e, 0xa07d, 0x0040, 0x2501, 0x2001, - 0x0000, 0x8000, 0x2f0c, 0x81ff, 0x0040, 0x2501, 0x2178, 0x0078, - 0x24f9, 0x017f, 0x0f7f, 0x007c, 0x2069, 0x6ddf, 0x6910, 0x629c, - 0x0078, 0x2272, 0x81ff, 0x00c0, 0x229c, 0x614c, 0xa190, 0x2091, - 0x2214, 0xa294, 0x00ff, 0x6068, 0xa084, 0xff00, 0xa215, 0x6364, - 0x0078, 0x2272, 0x613c, 0x6240, 0x0078, 0x2272, 0x1078, 0x2a1c, - 0x0040, 0x22a0, 0x0078, 0x2272, 0x1078, 0x2a1c, 0x0040, 0x22a0, - 0x6244, 0x6338, 0x0078, 0x2272, 0x613c, 0x6240, 0x7824, 0x603e, - 0x7b28, 0x6342, 0x2069, 0x6d51, 0x831f, 0xa305, 0x6816, 0x0078, - 0x2272, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x0078, 0x2272, 0x1078, - 0x2a1c, 0x0040, 0x22a0, 0x7828, 0xa00d, 0x0040, 0x22a0, 0x782c, - 0xa005, 0x0040, 0x22a0, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078, - 0x2272, 0x7d38, 0x7c3c, 0x0078, 0x231f, 0x7824, 0xa09c, 0x00ff, - 0xa39a, 0x0003, 0x00c8, 0x229c, 0x624c, 0xa084, 0xff00, 0x8007, - 0xa206, 0x00c0, 0x256d, 0x2001, 0x6d40, 0x2009, 0x000c, 0x7a2c, - 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a40, 0x81ff, 0x00c0, 0x229c, - 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x6004, 0xa084, 0x00ff, 0xa086, - 0x0006, 0x00c0, 0x229c, 0x0c7e, 0x1078, 0x2a04, 0x0c7f, 0x0040, - 0x229c, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x6223, - 0x0040, 0x229c, 0x7007, 0x0003, 0x701b, 0x258f, 0x007c, 0x6830, - 0xa086, 0x0100, 0x0040, 0x229c, 0xad80, 0x000e, 0x2009, 0x000c, - 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a40, 0x1078, 0x2a04, - 0x0040, 0x229c, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, - 0x1078, 0x2a3c, 0x701b, 0x25ad, 0x007c, 0xade8, 0x000d, 0x6800, - 0xa005, 0x0040, 0x22a0, 0x6804, 0xd0ac, 0x0040, 0x25ba, 0xd0a4, - 0x0040, 0x22a0, 0xd094, 0x0040, 0x25c5, 0x0c7e, 0x2061, 0x0100, - 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040, 0x25d0, - 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010, 0x6106, 0x0c7f, - 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048, 0x25e5, 0xd084, - 0x0040, 0x25e5, 0x6828, 0xa08a, 0x007f, 0x00c8, 0x22a0, 0xa088, - 0x2091, 0x210c, 0xa18c, 0x00ff, 0x6152, 0xd0dc, 0x0040, 0x25ee, - 0x6828, 0xa08a, 0x007f, 0x00c8, 0x22a0, 0x604e, 0x6808, 0xa08a, - 0x0100, 0x0048, 0x22a0, 0xa08a, 0x0841, 0x00c8, 0x22a0, 0xa084, - 0x0007, 0x00c0, 0x22a0, 0x680c, 0xa005, 0x0040, 0x22a0, 0x6810, - 0xa005, 0x0040, 0x22a0, 0x6848, 0x6940, 0xa10a, 0x00c8, 0x22a0, - 0x8001, 0x0040, 0x22a0, 0x684c, 0x6944, 0xa10a, 0x00c8, 0x22a0, - 0x8001, 0x0040, 0x22a0, 0x20a9, 0x001c, 0x2d98, 0x2069, 0x6d51, - 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e, 0x8007, 0xa084, - 0x00ff, 0x6042, 0x1078, 0x3890, 0x1078, 0x366e, 0x6000, 0xa086, - 0x0000, 0x00c0, 0x265b, 0x6808, 0x602a, 0x1078, 0x1bcc, 0x6818, - 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016, - 0x611a, 0x621e, 0x6322, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e, - 0x6312, 0x1078, 0x4168, 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040, - 0x602f, 0x0000, 0x0c7f, 0x60b4, 0xa005, 0x0040, 0x2657, 0x6003, - 0x0001, 0x2091, 0x301d, 0x1078, 0x31cb, 0x0078, 0x265b, 0x6003, - 0x0004, 0x2091, 0x301d, 0x0078, 0x2272, 0x6000, 0xa086, 0x0000, - 0x0040, 0x229c, 0x2069, 0x6d51, 0x7830, 0x6842, 0x7834, 0x6846, - 0x2d00, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, - 0x2a40, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x31cb, 0x0078, 0x2272, - 0x81ff, 0x00c0, 0x229c, 0x617c, 0x81ff, 0x0040, 0x2692, 0x703f, - 0x0000, 0x2001, 0x73c0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c, - 0x7d38, 0x127e, 0x2091, 0x8000, 0x1078, 0x2a40, 0x701b, 0x226f, - 0x127f, 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x73c0, 0x20a9, - 0x0040, 0x20a1, 0x73c0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588, - 0x2091, 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002, - 0x2100, 0xa506, 0x0040, 0x26c4, 0x1078, 0x3447, 0x00c0, 0x26c4, - 0x6014, 0x821c, 0x0048, 0x26bc, 0xa398, 0x73c0, 0xa085, 0xff00, - 0x8007, 0x201a, 0x0078, 0x26c3, 0xa398, 0x73c0, 0x2324, 0xa4a4, - 0xff00, 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x0080, 0x00c8, - 0x26cb, 0x0078, 0x26a8, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a, - 0x0d7f, 0x20a9, 0x0040, 0x20a1, 0x73c0, 0x2099, 0x73c0, 0x1078, - 0x3213, 0x0078, 0x2681, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x0c7e, - 0x1078, 0x2a04, 0x0c7f, 0x0040, 0x229c, 0x2001, 0x6d52, 0x2004, - 0xd0b4, 0x0040, 0x2708, 0x6000, 0xd08c, 0x00c0, 0x2708, 0x6004, - 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2708, 0x6837, 0x0000, - 0x6838, 0xc0fd, 0x683a, 0x1078, 0x625b, 0x0040, 0x229c, 0x7007, - 0x0003, 0x701b, 0x2704, 0x007c, 0x1078, 0x2a1c, 0x0040, 0x22a0, - 0x20a9, 0x0029, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9, - 0x0002, 0xac80, 0x0004, 0x2098, 0xad80, 0x0004, 0x20a0, 0x1078, - 0x3213, 0x20a9, 0x0004, 0xac80, 0x0006, 0x2098, 0xad80, 0x0006, - 0x20a0, 0x1078, 0x3213, 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098, - 0xad80, 0x000a, 0x20a0, 0x1078, 0x3213, 0x2d00, 0x2009, 0x0029, - 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a40, 0x81ff, 0x00c0, - 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078, 0x35ae, 0x0078, - 0x2272, 0x81ff, 0x00c0, 0x229c, 0x7828, 0xa08a, 0x1000, 0x00c8, - 0x22a0, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x2031, 0x000f, 0x1078, - 0x34d7, 0x8631, 0x00c8, 0x274f, 0x2019, 0x0004, 0x1078, 0x35c4, - 0x7924, 0x810f, 0x7a28, 0x1078, 0x275f, 0x0078, 0x2272, 0xa186, - 0x00ff, 0x0040, 0x2767, 0x1078, 0x2777, 0x0078, 0x2776, 0x2029, - 0x007e, 0x2061, 0x6d00, 0x644c, 0x2400, 0xa506, 0x0040, 0x2773, - 0x2508, 0x1078, 0x2777, 0x8529, 0x00c8, 0x276c, 0x007c, 0x1078, - 0x3447, 0x00c0, 0x2782, 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, - 0x1078, 0x40de, 0x007c, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c, - 0x0040, 0x22a0, 0x1078, 0x34d7, 0x1078, 0x35b9, 0x0078, 0x2272, - 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078, - 0x34d7, 0x1078, 0x35a3, 0x0078, 0x2272, 0x6100, 0x0078, 0x2272, - 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x6004, 0xa086, 0x0707, 0x0040, - 0x22a0, 0x2001, 0x6d00, 0x2004, 0xa086, 0x0003, 0x00c0, 0x229c, - 0x0d7e, 0xace8, 0x000a, 0x7924, 0xd184, 0x0040, 0x27b9, 0xace8, - 0x0006, 0x680c, 0x8007, 0x783e, 0x6808, 0x8007, 0x783a, 0x6b04, - 0x831f, 0x6a00, 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078, - 0x2272, 0x81ff, 0x00c0, 0x229c, 0x7828, 0xa08a, 0x1000, 0x00c8, - 0x22a0, 0x7924, 0xa184, 0x00ff, 0xa082, 0x0010, 0x00c8, 0x22a0, - 0xa18c, 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040, 0x27e6, 0xa182, - 0x007f, 0x00c8, 0x22a0, 0x2100, 0x1078, 0x1e30, 0x027e, 0x0c7e, - 0x127e, 0x2091, 0x8000, 0x2061, 0x6f23, 0x601b, 0x0000, 0x601f, - 0x0000, 0x2061, 0x6d00, 0x6003, 0x0001, 0x2061, 0x0100, 0x6030, - 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043, - 0x0010, 0x2009, 0x001e, 0x2011, 0x31f0, 0x1078, 0x415f, 0x7924, - 0x810f, 0x7a28, 0x1078, 0x275f, 0x127f, 0x0c7f, 0x027f, 0x0078, - 0x2272, 0x7924, 0xa18c, 0xff00, 0x810f, 0x0c7e, 0x1078, 0x3410, - 0x2c08, 0x0c7f, 0x00c0, 0x22a0, 0x0078, 0x2272, 0x81ff, 0x00c0, - 0x229c, 0x60bc, 0xd09c, 0x0040, 0x229c, 0x1078, 0x2a04, 0x0040, - 0x229c, 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2a3c, - 0x701b, 0x2833, 0x007c, 0x2009, 0x0080, 0x1078, 0x3447, 0x00c0, - 0x229c, 0x0d7e, 0xade8, 0x000d, 0x6900, 0x6a08, 0x6b0c, 0x6c10, - 0x6d14, 0x6e18, 0x6820, 0xa0be, 0x0100, 0x0040, 0x28a7, 0xa0be, - 0x0112, 0x0040, 0x28a7, 0xa0be, 0x0113, 0x0040, 0x28a7, 0xa0be, - 0x0114, 0x0040, 0x28a7, 0xa0be, 0x0117, 0x0040, 0x28a7, 0xa0be, - 0x011a, 0x0040, 0x28a7, 0xa0be, 0x0121, 0x0040, 0x289d, 0xa0be, - 0x0131, 0x0040, 0x289d, 0xa0be, 0x0171, 0x0040, 0x28a7, 0xa0be, - 0x01a1, 0x00c0, 0x2870, 0x6830, 0x8007, 0x6832, 0x0078, 0x28ad, - 0xa0be, 0x0212, 0x0040, 0x28a3, 0xa0be, 0x0213, 0x0040, 0x28a3, - 0xa0be, 0x0214, 0x0040, 0x2895, 0xa0be, 0x0217, 0x0040, 0x288f, - 0xa0be, 0x021a, 0x00c0, 0x2889, 0x6838, 0x8007, 0x683a, 0x0078, - 0x28a7, 0xa0be, 0x0300, 0x0040, 0x28a7, 0x0078, 0x229c, 0xad80, - 0x0010, 0x20a9, 0x0007, 0x1078, 0x28d9, 0xad80, 0x000e, 0x20a9, - 0x0001, 0x1078, 0x28d9, 0x0078, 0x28a7, 0xad80, 0x000c, 0x1078, - 0x28e7, 0x0078, 0x28ad, 0xad80, 0x000e, 0x1078, 0x28e7, 0xad80, - 0x000c, 0x20a9, 0x0001, 0x1078, 0x28d9, 0x0c7e, 0x1078, 0x2a04, - 0x0040, 0x28ce, 0x6837, 0x0119, 0x684f, 0x0020, 0x685b, 0x0001, - 0x810b, 0x697e, 0x6883, 0x0000, 0x6a86, 0x6b8a, 0x6c8e, 0x6d92, - 0x6996, 0x689b, 0x0000, 0x0c7f, 0x0d7f, 0x1078, 0x623f, 0x0040, - 0x229c, 0x7007, 0x0003, 0x701b, 0x28d2, 0x007c, 0x0c7f, 0x0d7f, - 0x0078, 0x229c, 0x6820, 0xa086, 0x8001, 0x0040, 0x229c, 0x0078, - 0x2272, 0x017e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x290a, - 0x8108, 0x280a, 0x8108, 0x00f0, 0x28db, 0x017f, 0x007c, 0x017e, - 0x0a7e, 0x0b7e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x2054, - 0x8000, 0x205c, 0x2b0a, 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108, - 0x280a, 0x0b7f, 0x0a7f, 0x017f, 0x007c, 0x81ff, 0x00c0, 0x229c, - 0x7924, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0081, 0x0048, 0x22a0, - 0xa182, 0x00ff, 0x00c8, 0x22a0, 0x7a2c, 0x7b28, 0x6064, 0xa306, - 0x00c0, 0x2918, 0x6068, 0xa206, 0x00c0, 0x2918, 0x0078, 0x22a0, - 0x0c7e, 0x1078, 0x297b, 0x2c68, 0x0c7f, 0x0040, 0x2939, 0xa0c6, - 0x4007, 0x00c0, 0x2926, 0x7c26, 0x0078, 0x2936, 0xa0c6, 0x4008, - 0x00c0, 0x292e, 0x7f26, 0x7e2a, 0x0078, 0x2936, 0xa0c6, 0x4009, - 0x00c0, 0x2934, 0x0078, 0x2936, 0x2001, 0x4006, 0x2020, 0x0078, - 0x2274, 0x017e, 0x0b7e, 0x0c7e, 0x0e7e, 0x2c70, 0x1078, 0x5504, - 0x0040, 0x2969, 0x2d00, 0x601a, 0x2e58, 0x0e7f, 0x0e7e, 0x0c7e, - 0x1078, 0x2a04, 0x0c7f, 0x2b70, 0x0040, 0x229c, 0x6837, 0x0000, - 0x2d00, 0x6012, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x33df, - 0x2001, 0x0002, 0x1078, 0x33f3, 0x127e, 0x2091, 0x8000, 0x7088, - 0x8000, 0x708a, 0x127f, 0x2009, 0x0002, 0x1078, 0x5591, 0xa085, - 0x0001, 0x0e7f, 0x0c7f, 0x0b7f, 0x017f, 0x0040, 0x229c, 0x7007, - 0x0003, 0x701b, 0x2974, 0x007c, 0x6830, 0xa086, 0x0100, 0x00c0, - 0x2272, 0x0078, 0x229c, 0x0e7e, 0x0d7e, 0x2029, 0x0000, 0x2021, - 0x0081, 0x20a9, 0x007e, 0x2071, 0x6e81, 0x2e04, 0xa005, 0x00c0, - 0x298f, 0x2100, 0xa406, 0x0040, 0x29c0, 0x0078, 0x29b4, 0x2068, - 0x6f10, 0x2700, 0xa306, 0x00c0, 0x29a5, 0x6e14, 0x2600, 0xa206, - 0x00c0, 0x29a5, 0x2400, 0xa106, 0x00c0, 0x29a1, 0x2d60, 0x0078, - 0x29c6, 0x2001, 0x4007, 0x0078, 0x29c7, 0x2400, 0xa106, 0x00c0, - 0x29b4, 0x6e14, 0x87ff, 0x00c0, 0x29b0, 0x86ff, 0x0040, 0x29c0, - 0x2001, 0x4008, 0x0078, 0x29c7, 0x8420, 0x8e70, 0x00f0, 0x2985, - 0x2001, 0x4009, 0x0078, 0x29c7, 0x2001, 0x0001, 0x0078, 0x29c7, - 0x1078, 0x3410, 0x00c0, 0x29bc, 0x6312, 0x6216, 0xa006, 0xa005, - 0x0d7f, 0x0e7f, 0x007c, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a04, - 0x0040, 0x229c, 0x6837, 0x0000, 0x7824, 0xa005, 0x0040, 0x22a0, - 0xa096, 0x00ff, 0x0040, 0x29e0, 0xa092, 0x0004, 0x00c8, 0x22a0, - 0x2010, 0x2d18, 0x1078, 0x2013, 0x0040, 0x229c, 0x7007, 0x0003, - 0x701b, 0x29eb, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x229c, - 0x0078, 0x2272, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0081, - 0x0048, 0x22a0, 0xa182, 0x00ff, 0x00c8, 0x22a0, 0x1078, 0x615b, - 0x1078, 0x342f, 0x0078, 0x2272, 0x1078, 0x12f4, 0x0040, 0x2a1b, - 0xa006, 0x6802, 0x7010, 0xa005, 0x00c0, 0x2a13, 0x2d00, 0x7012, - 0x7016, 0x0078, 0x2a19, 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006, - 0x7016, 0xad80, 0x000d, 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, - 0x1078, 0x3447, 0x00c0, 0x2a2a, 0xa6b4, 0x00ff, 0xa682, 0x0010, - 0x0048, 0x2a2b, 0xa066, 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, - 0x0040, 0x2a38, 0x2168, 0x6904, 0x1078, 0x1328, 0x0078, 0x2a2f, - 0x7112, 0x7116, 0x017f, 0x007c, 0x2031, 0x0001, 0x0078, 0x2a42, - 0x2031, 0x0000, 0x2061, 0x6d9d, 0x6606, 0x6112, 0x600e, 0x6226, - 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x135f, 0x7007, 0x0002, - 0x701b, 0x2272, 0x007c, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, - 0x0000, 0x2001, 0x6d7b, 0x2004, 0xa005, 0x00c0, 0x2a6e, 0x0068, - 0x2a6e, 0x7818, 0xd084, 0x00c0, 0x2a6e, 0x781b, 0x0001, 0x7a22, - 0x7b26, 0x7c2a, 0x2091, 0x4080, 0x0078, 0x2a93, 0x017e, 0x0c7e, - 0x0e7e, 0x2071, 0x6d6d, 0x7138, 0xa182, 0x0004, 0x0048, 0x2a7c, - 0x7030, 0x2060, 0x0078, 0x2a8d, 0x7030, 0xa0e0, 0x0008, 0xac82, - 0x6d9d, 0x0048, 0x2a85, 0x2061, 0x6d7d, 0x2c00, 0x7032, 0x81ff, - 0x00c0, 0x2a8b, 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x640a, - 0x0e7f, 0x0c7f, 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071, - 0x6d6d, 0x7038, 0xa005, 0x0040, 0x2acf, 0x127e, 0x2091, 0x8000, - 0x0068, 0x2ace, 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, - 0x2acd, 0x0c7e, 0x781b, 0x0001, 0x7034, 0x2060, 0x2c04, 0x7822, - 0x6004, 0x7826, 0x6008, 0x782a, 0x2091, 0x4080, 0x7038, 0x8001, - 0x703a, 0xa005, 0x00c0, 0x2ac3, 0x7033, 0x6d7d, 0x7037, 0x6d7d, - 0x0c7f, 0x0078, 0x2acd, 0xac80, 0x0008, 0xa0fa, 0x6d9d, 0x0048, - 0x2acb, 0x2001, 0x6d7d, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, - 0x007c, 0x027e, 0x2001, 0x6d52, 0x2004, 0xd0c4, 0x0040, 0x2adc, - 0x2011, 0x8014, 0x1078, 0x2a53, 0x027f, 0x007c, 0x81ff, 0x00c0, - 0x229c, 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078, - 0x31cb, 0x127f, 0x0078, 0x2272, 0x127e, 0x0c7e, 0x0e7e, 0x2061, - 0x0100, 0x2071, 0x6d00, 0x6044, 0xd0a4, 0x00c0, 0x2b11, 0xd084, - 0x0040, 0x2afe, 0x1078, 0x2c34, 0x0078, 0x2b11, 0xd08c, 0x0040, - 0x2b05, 0x1078, 0x2b4b, 0x0078, 0x2b11, 0xd094, 0x0040, 0x2b0c, - 0x1078, 0x2b2c, 0x0078, 0x2b11, 0xd09c, 0x0040, 0x2b11, 0x1078, - 0x2b15, 0x0e7f, 0x0c7f, 0x127f, 0x007c, 0x6043, 0x0040, 0x6043, + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x2071, + 0x766d, 0x7003, 0x0002, 0xa006, 0x7012, 0x7016, 0x703a, 0x703e, + 0x7033, 0x767d, 0x7037, 0x767d, 0x7007, 0x0001, 0x2061, 0x76bd, + 0x6003, 0x0002, 0x007c, 0x0090, 0x2456, 0x0068, 0x2456, 0x2071, + 0x766d, 0x2b78, 0x7818, 0xd084, 0x00c0, 0x2456, 0x2a60, 0x7820, + 0xa08e, 0x0069, 0x00c0, 0x253d, 0x0079, 0x24da, 0x007c, 0x2071, + 0x766d, 0x7004, 0x0079, 0x245c, 0x2460, 0x2461, 0x246b, 0x247d, + 0x007c, 0x0090, 0x246a, 0x0068, 0x246a, 0x2b78, 0x7818, 0xd084, + 0x0040, 0x2489, 0x007c, 0x2b78, 0x2061, 0x76bd, 0x6008, 0xa08e, + 0x0100, 0x0040, 0x2478, 0xa086, 0x0200, 0x0040, 0x2535, 0x007c, + 0x7014, 0x2068, 0x2a60, 0x7018, 0x007a, 0x7010, 0x2068, 0x6834, + 0xa086, 0x0103, 0x0040, 0x2485, 0x007c, 0x2a60, 0x2b78, 0x7018, + 0x007a, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x00c8, 0x2492, 0x61b0, + 0x0079, 0x249a, 0x2100, 0xa08a, 0x0036, 0x00c8, 0x2531, 0x61b0, + 0x0079, 0x24da, 0x2513, 0x2545, 0x254d, 0x2551, 0x2559, 0x255f, + 0x2563, 0x256c, 0x2570, 0x2578, 0x257c, 0x2531, 0x2531, 0x2531, + 0x2580, 0x2531, 0x2590, 0x25a7, 0x25be, 0x263a, 0x263f, 0x266c, + 0x26b9, 0x26c8, 0x26e9, 0x271f, 0x2729, 0x2736, 0x2749, 0x2761, + 0x276a, 0x27a7, 0x27ad, 0x2531, 0x27bd, 0x2531, 0x2531, 0x2531, + 0x2531, 0x2531, 0x27c1, 0x27c7, 0x2531, 0x2531, 0x2531, 0x2531, + 0x2531, 0x2531, 0x2531, 0x2531, 0x27cf, 0x2531, 0x2531, 0x2531, + 0x2531, 0x2531, 0x27dc, 0x27e2, 0x2531, 0x2531, 0x2531, 0x2531, + 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, + 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, + 0x2531, 0x2531, 0x2578, 0x257c, 0x2531, 0x2531, 0x27f4, 0x2531, + 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, 0x2531, + 0x2531, 0x2531, 0x2841, 0x290e, 0x2922, 0x2929, 0x298c, 0x29e7, + 0x29f2, 0x2a34, 0x2a41, 0x2a4e, 0x2a51, 0x27f8, 0x2a7a, 0x2ac1, + 0x2ace, 0x2bc8, 0x2cb6, 0x2cdd, 0x2dd5, 0x2de3, 0x2df0, 0x2e2a, + 0x713c, 0x0078, 0x2513, 0x2021, 0x4000, 0x1078, 0x2d24, 0x127e, + 0x2091, 0x8000, 0x0068, 0x2520, 0x7818, 0xd084, 0x0040, 0x2523, + 0x127f, 0x0078, 0x2517, 0x781b, 0x0001, 0x7c22, 0x7926, 0x7a2a, + 0x7b2e, 0x2091, 0x4080, 0x7007, 0x0001, 0x2091, 0x5000, 0x127f, + 0x007c, 0x2021, 0x4001, 0x0078, 0x2515, 0x2021, 0x4002, 0x0078, + 0x2515, 0x2021, 0x4003, 0x0078, 0x2515, 0x2021, 0x4005, 0x0078, + 0x2515, 0x2021, 0x4006, 0x0078, 0x2515, 0xa02e, 0x2520, 0x7b28, + 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2d33, 0x7823, 0x0004, 0x7824, + 0x007a, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078, + 0x2d37, 0x7924, 0x7828, 0x2114, 0x200a, 0x0078, 0x2513, 0x7924, + 0x2114, 0x0078, 0x2513, 0x2099, 0x0009, 0x20a1, 0x0009, 0x20a9, + 0x0007, 0x53a3, 0x0078, 0x2513, 0x7824, 0x2060, 0x0078, 0x2582, + 0x2009, 0x0001, 0x2011, 0x000f, 0x2019, 0x0013, 0x0078, 0x2513, + 0x7d38, 0x7c3c, 0x0078, 0x2547, 0x7d38, 0x7c3c, 0x0078, 0x2553, + 0x2061, 0x1000, 0x610c, 0xa006, 0x2c14, 0xa200, 0x8c60, 0x8109, + 0x00c0, 0x2584, 0x2010, 0xa005, 0x0040, 0x2513, 0x0078, 0x2539, + 0x2061, 0x7651, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2541, 0x8019, + 0x0040, 0x2541, 0x604a, 0x6142, 0x782c, 0x6052, 0x7828, 0x6056, + 0xa006, 0x605a, 0x605e, 0x1078, 0x3c71, 0x0078, 0x2513, 0x2061, + 0x7651, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2541, 0x8019, 0x0040, + 0x2541, 0x604e, 0x6146, 0x782c, 0x6062, 0x7828, 0x6066, 0xa006, + 0x606a, 0x606e, 0x1078, 0x3a47, 0x0078, 0x2513, 0xa02e, 0x2520, + 0x81ff, 0x00c0, 0x253d, 0x7924, 0x7b28, 0x7a2c, 0x20a9, 0x0005, + 0x20a1, 0x7674, 0x41a1, 0x1078, 0x2cfb, 0x0040, 0x253d, 0x2009, + 0x0020, 0x1078, 0x2d33, 0x701b, 0x25d6, 0x007c, 0x6834, 0x2008, + 0xa084, 0x00ff, 0xa096, 0x0011, 0x0040, 0x25e2, 0xa096, 0x0019, + 0x00c0, 0x253d, 0x810f, 0xa18c, 0x00ff, 0x0040, 0x253d, 0x710e, + 0x700c, 0x8001, 0x0040, 0x2613, 0x700e, 0x1078, 0x2cfb, 0x0040, + 0x253d, 0x2009, 0x0020, 0x2061, 0x76bd, 0x6224, 0x6328, 0x642c, + 0x6530, 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, + 0x0000, 0x1078, 0x2d33, 0x701b, 0x2606, 0x007c, 0x6834, 0xa084, + 0x00ff, 0xa096, 0x0002, 0x0040, 0x2611, 0xa096, 0x000a, 0x00c0, + 0x253d, 0x0078, 0x25e8, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a, + 0x1078, 0x3722, 0x00c0, 0x2621, 0x7007, 0x0003, 0x701b, 0x2623, + 0x007c, 0x1078, 0x3b0a, 0x127e, 0x2091, 0x8000, 0x20a9, 0x0005, + 0x2099, 0x7674, 0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, + 0x0000, 0xa5a9, 0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x127f, + 0x0078, 0x2d37, 0x6198, 0x7824, 0x609a, 0x0078, 0x2513, 0x2091, + 0x8000, 0x7823, 0x4000, 0x7827, 0x4953, 0x782b, 0x5020, 0x782f, + 0x2020, 0x2009, 0x017f, 0x2104, 0x7832, 0x3f00, 0x7836, 0x2061, + 0x0100, 0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0xa205, 0x783a, + 0x2009, 0x04fd, 0x2104, 0x783e, 0x781b, 0x0001, 0x2091, 0x5000, + 0x2091, 0x4080, 0x2071, 0x0010, 0x20c1, 0x00f0, 0xa08a, 0x0003, + 0x00c8, 0x0427, 0x0078, 0x0423, 0x81ff, 0x00c0, 0x253d, 0x1078, + 0x2d13, 0x0040, 0x2541, 0x7c28, 0x7d2c, 0x1078, 0x3969, 0xd28c, + 0x00c0, 0x267e, 0x1078, 0x38f9, 0x0078, 0x2680, 0x1078, 0x3935, + 0x00c0, 0x26aa, 0x2061, 0x7d00, 0x127e, 0x2091, 0x8000, 0x6000, + 0xa086, 0x0000, 0x0040, 0x2698, 0x6010, 0xa06d, 0x0040, 0x2698, + 0x683c, 0xa406, 0x00c0, 0x2698, 0x6840, 0xa506, 0x0040, 0x26a3, + 0x127f, 0xace0, 0x0008, 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8, + 0x253d, 0x0078, 0x2684, 0x1078, 0x6738, 0x127f, 0x0040, 0x253d, + 0x0078, 0x2513, 0xa00e, 0x2001, 0x0005, 0x1078, 0x3b0a, 0x127e, + 0x2091, 0x8000, 0x1078, 0x6b47, 0x1078, 0x3a7a, 0x127f, 0x0078, + 0x2513, 0x81ff, 0x00c0, 0x253d, 0x1078, 0x2d13, 0x0040, 0x2541, + 0x1078, 0x38ae, 0x1078, 0x397a, 0x0040, 0x253d, 0x0078, 0x2513, + 0x81ff, 0x00c0, 0x253d, 0x1078, 0x2d13, 0x0040, 0x2541, 0x2031, + 0x000f, 0x1078, 0x38ae, 0x8631, 0x00c8, 0x26d1, 0x2019, 0x0005, + 0x1078, 0x399b, 0x0040, 0x253d, 0x7828, 0xa08a, 0x1000, 0x00c8, + 0x2541, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x457b, 0x0078, + 0x2513, 0x127e, 0x2091, 0x8000, 0x81ff, 0x00c0, 0x2719, 0x2029, + 0x00ff, 0x644c, 0x2400, 0xa506, 0x0040, 0x2713, 0x2508, 0x1078, + 0x3825, 0x00c0, 0x2713, 0x2031, 0x000f, 0x1078, 0x38ae, 0x8631, + 0x00c8, 0x26fd, 0x2019, 0x0004, 0x1078, 0x399b, 0x0040, 0x2719, + 0x7824, 0xa08a, 0x1000, 0x00c8, 0x271c, 0x8003, 0x800b, 0x810b, + 0xa108, 0x1078, 0x457b, 0x8529, 0x00c8, 0x26f2, 0x127f, 0x0078, + 0x2513, 0x127f, 0x0078, 0x253d, 0x127f, 0x0078, 0x2541, 0x1078, + 0x2d13, 0x0040, 0x2541, 0x1078, 0x38de, 0x1078, 0x3969, 0x0078, + 0x2513, 0x81ff, 0x00c0, 0x253d, 0x1078, 0x2d13, 0x0040, 0x2541, + 0x1078, 0x38c7, 0x1078, 0x3969, 0x0078, 0x2513, 0x81ff, 0x00c0, + 0x253d, 0x1078, 0x2d13, 0x0040, 0x2541, 0x1078, 0x3938, 0x0040, + 0x253d, 0x1078, 0x376a, 0x1078, 0x38f2, 0x1078, 0x3969, 0x0078, + 0x2513, 0x1078, 0x2d13, 0x0040, 0x2541, 0x1078, 0x38ae, 0x62a0, + 0x2019, 0x0005, 0x0c7e, 0x1078, 0x39a6, 0x0c7f, 0x1078, 0x4962, + 0x1078, 0x48a5, 0x2c08, 0x1078, 0x737b, 0x1078, 0x3969, 0x0078, + 0x2513, 0x1078, 0x2d13, 0x0040, 0x2541, 0x1078, 0x3969, 0x2208, + 0x0078, 0x2513, 0x157e, 0x0d7e, 0x0e7e, 0x2069, 0x76ff, 0x6810, + 0x6914, 0xa10a, 0x00c8, 0x2776, 0x2009, 0x0000, 0x6816, 0x2011, + 0x0000, 0x2019, 0x0000, 0x20a9, 0x007e, 0x2069, 0x7720, 0x2d04, + 0xa075, 0x0040, 0x278b, 0x704c, 0x1078, 0x2795, 0xa210, 0x7080, + 0x1078, 0x2795, 0xa318, 0x8d68, 0x00f0, 0x277f, 0x2300, 0xa218, + 0x0e7f, 0x0d7f, 0x157f, 0x0078, 0x2513, 0x0f7e, 0x017e, 0xa07d, + 0x0040, 0x27a4, 0x2001, 0x0000, 0x8000, 0x2f0c, 0x81ff, 0x0040, + 0x27a4, 0x2178, 0x0078, 0x279c, 0x017f, 0x0f7f, 0x007c, 0x2069, + 0x76ff, 0x6910, 0x629c, 0x0078, 0x2513, 0x81ff, 0x00c0, 0x253d, + 0x614c, 0xa190, 0x232f, 0x2214, 0xa294, 0x00ff, 0x6068, 0xa084, + 0xff00, 0xa215, 0x6364, 0x0078, 0x2513, 0x613c, 0x6240, 0x0078, + 0x2513, 0x1078, 0x2d13, 0x0040, 0x2541, 0x0078, 0x2513, 0x1078, + 0x2d13, 0x0040, 0x2541, 0x6244, 0x6338, 0x0078, 0x2513, 0x613c, + 0x6240, 0x7824, 0x603e, 0x7b28, 0x6342, 0x2069, 0x7651, 0x831f, + 0xa305, 0x6816, 0x0078, 0x2513, 0x1078, 0x2d13, 0x0040, 0x2541, + 0x0078, 0x2513, 0x1078, 0x2d13, 0x0040, 0x2541, 0x7828, 0xa00d, + 0x0040, 0x2541, 0x782c, 0xa005, 0x0040, 0x2541, 0x6244, 0x6146, + 0x6338, 0x603a, 0x0078, 0x2513, 0x7d38, 0x7c3c, 0x0078, 0x25c0, + 0x7824, 0xa09c, 0x00ff, 0xa39a, 0x0003, 0x00c8, 0x253d, 0x624c, + 0xa084, 0xff00, 0x8007, 0xa206, 0x00c0, 0x2810, 0x2001, 0x7640, + 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2d37, + 0x81ff, 0x00c0, 0x253d, 0x1078, 0x2d13, 0x0040, 0x2541, 0x6004, + 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x253d, 0x0c7e, 0x1078, + 0x2cfb, 0x0c7f, 0x0040, 0x253d, 0x6837, 0x0000, 0x6838, 0xc0fd, + 0x683a, 0x1078, 0x6a41, 0x0040, 0x253d, 0x7007, 0x0003, 0x701b, + 0x2832, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x253d, 0xad80, + 0x000e, 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, + 0x2d37, 0x1078, 0x2cfb, 0x0040, 0x253d, 0x2009, 0x001c, 0x7a2c, + 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2d33, 0x701b, 0x2850, 0x007c, + 0xade8, 0x000d, 0x6800, 0xa005, 0x0040, 0x2541, 0x6804, 0xd0ac, + 0x0040, 0x285d, 0xd0a4, 0x0040, 0x2541, 0xd094, 0x0040, 0x2868, + 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, + 0xd08c, 0x0040, 0x2873, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, + 0x0010, 0x6106, 0x0c7f, 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, + 0x0048, 0x2888, 0xd084, 0x0040, 0x2888, 0x6a28, 0xa28a, 0x007f, + 0x00c8, 0x2541, 0xa288, 0x232f, 0x210c, 0xa18c, 0x00ff, 0x6152, + 0xd0dc, 0x0040, 0x2891, 0x6828, 0xa08a, 0x007f, 0x00c8, 0x2541, + 0x604e, 0x6808, 0xa08a, 0x0100, 0x0048, 0x2541, 0xa08a, 0x0841, + 0x00c8, 0x2541, 0xa084, 0x0007, 0x00c0, 0x2541, 0x680c, 0xa005, + 0x0040, 0x2541, 0x6810, 0xa005, 0x0040, 0x2541, 0x6848, 0x6940, + 0xa10a, 0x00c8, 0x2541, 0x8001, 0x0040, 0x2541, 0x684c, 0x6944, + 0xa10a, 0x00c8, 0x2541, 0x8001, 0x0040, 0x2541, 0x20a9, 0x001c, + 0x2d98, 0x2069, 0x7651, 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, + 0x613e, 0x8007, 0xa084, 0x00ff, 0x6042, 0x1078, 0x3c71, 0x1078, + 0x3a47, 0x6000, 0xa086, 0x0000, 0x00c0, 0x290c, 0x6808, 0x602a, + 0x1078, 0x1dea, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, + 0x8217, 0x831f, 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, + 0x0040, 0x28ec, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, + 0x8217, 0x831f, 0x0078, 0x28ee, 0xa084, 0xf0ff, 0x6006, 0x610a, + 0x620e, 0x6312, 0x1078, 0x4607, 0x0c7e, 0x2061, 0x0100, 0x602f, + 0x0040, 0x602f, 0x0000, 0x0c7f, 0x60b4, 0xa005, 0x0040, 0x2908, + 0x6003, 0x0001, 0x2091, 0x301d, 0x1078, 0x357b, 0x0078, 0x290c, + 0x6003, 0x0004, 0x2091, 0x301d, 0x0078, 0x2513, 0x6000, 0xa086, + 0x0000, 0x0040, 0x253d, 0x2069, 0x7651, 0x7830, 0x6842, 0x7834, + 0x6846, 0x2d00, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, + 0x0078, 0x2d37, 0x81ff, 0x00c0, 0x253d, 0x1078, 0x357b, 0x0078, + 0x2513, 0x81ff, 0x00c0, 0x253d, 0x617c, 0x81ff, 0x0040, 0x2943, + 0x703f, 0x0000, 0x2001, 0x7cc0, 0x2009, 0x0040, 0x7a2c, 0x7b28, + 0x7c3c, 0x7d38, 0x127e, 0x2091, 0x8000, 0x1078, 0x2d37, 0x701b, + 0x2510, 0x127f, 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x7cc0, + 0x20a9, 0x0040, 0x20a1, 0x7cc0, 0x2019, 0xffff, 0x43a4, 0x654c, + 0xa588, 0x232f, 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, + 0x0002, 0x2100, 0xa506, 0x0040, 0x2975, 0x1078, 0x3825, 0x00c0, + 0x2975, 0x6014, 0x821c, 0x0048, 0x296d, 0xa398, 0x7cc0, 0xa085, + 0xff00, 0x8007, 0x201a, 0x0078, 0x2974, 0xa398, 0x7cc0, 0x2324, + 0xa4a4, 0xff00, 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x0080, + 0x00c8, 0x297c, 0x0078, 0x2959, 0x8201, 0x8007, 0x2d0c, 0xa105, + 0x206a, 0x0d7f, 0x20a9, 0x0040, 0x20a1, 0x7cc0, 0x2099, 0x7cc0, + 0x1078, 0x35c4, 0x0078, 0x2932, 0x1078, 0x2d13, 0x0040, 0x2541, + 0x0c7e, 0x1078, 0x2cfb, 0x0c7f, 0x0040, 0x253d, 0x2001, 0x7652, + 0x2004, 0xd0b4, 0x0040, 0x29b9, 0x6000, 0xd08c, 0x00c0, 0x29b9, + 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x29b9, 0x6837, + 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x6a79, 0x0040, 0x253d, + 0x7007, 0x0003, 0x701b, 0x29b5, 0x007c, 0x1078, 0x2d13, 0x0040, + 0x2541, 0x20a9, 0x0029, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, + 0x20a9, 0x0002, 0xac80, 0x0004, 0x2098, 0xad80, 0x0004, 0x20a0, + 0x1078, 0x35c4, 0x20a9, 0x0004, 0xac80, 0x0006, 0x2098, 0xad80, + 0x0006, 0x20a0, 0x1078, 0x35c4, 0x20a9, 0x0004, 0xac80, 0x000a, + 0x2098, 0xad80, 0x000a, 0x20a0, 0x1078, 0x35c4, 0x2d00, 0x2009, + 0x0029, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2d37, 0x81ff, + 0x00c0, 0x253d, 0x1078, 0x2d13, 0x0040, 0x2541, 0x1078, 0x3985, + 0x0078, 0x2513, 0x81ff, 0x00c0, 0x253d, 0x7828, 0xa08a, 0x1000, + 0x00c8, 0x2541, 0x1078, 0x2d13, 0x0040, 0x2541, 0x2031, 0x000f, + 0x1078, 0x38ae, 0x8631, 0x00c8, 0x2a00, 0x2019, 0x0004, 0x1078, + 0x399b, 0x7924, 0x810f, 0x7a28, 0x1078, 0x2a10, 0x0078, 0x2513, + 0xa186, 0x00ff, 0x0040, 0x2a18, 0x1078, 0x2a28, 0x0078, 0x2a27, + 0x2029, 0x007e, 0x2061, 0x7600, 0x644c, 0x2400, 0xa506, 0x0040, + 0x2a24, 0x2508, 0x1078, 0x2a28, 0x8529, 0x00c8, 0x2a1d, 0x007c, + 0x1078, 0x3825, 0x00c0, 0x2a33, 0x2200, 0x8003, 0x800b, 0x810b, + 0xa108, 0x1078, 0x457b, 0x007c, 0x81ff, 0x00c0, 0x253d, 0x1078, + 0x2d13, 0x0040, 0x2541, 0x1078, 0x38ae, 0x1078, 0x3990, 0x0078, + 0x2513, 0x81ff, 0x00c0, 0x253d, 0x1078, 0x2d13, 0x0040, 0x2541, + 0x1078, 0x38ae, 0x1078, 0x397a, 0x0078, 0x2513, 0x6100, 0x0078, + 0x2513, 0x1078, 0x2d13, 0x0040, 0x2541, 0x6004, 0xa086, 0x0707, + 0x0040, 0x2541, 0x2001, 0x7600, 0x2004, 0xa086, 0x0003, 0x00c0, + 0x253d, 0x0d7e, 0xace8, 0x000a, 0x7924, 0xd184, 0x0040, 0x2a6a, + 0xace8, 0x0006, 0x680c, 0x8007, 0x783e, 0x6808, 0x8007, 0x783a, + 0x6b04, 0x831f, 0x6a00, 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, + 0x0078, 0x2513, 0x7824, 0xa084, 0x00ff, 0xa086, 0x00ff, 0x0040, + 0x2a84, 0x81ff, 0x00c0, 0x253d, 0x7828, 0xa08a, 0x1000, 0x00c8, + 0x2541, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040, + 0x2a98, 0xa182, 0x007f, 0x00c8, 0x2541, 0x2100, 0x1078, 0x209a, + 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7849, 0x601b, + 0x0000, 0x601f, 0x0000, 0x2061, 0x0100, 0x6030, 0xa084, 0x00ff, + 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, + 0x001e, 0x2011, 0x35a0, 0x1078, 0x45fe, 0x7924, 0xa18c, 0xff00, + 0x810f, 0x7a28, 0x1078, 0x2a10, 0x127f, 0x0c7f, 0x027f, 0x0078, + 0x2513, 0x7924, 0xa18c, 0xff00, 0x810f, 0x0c7e, 0x1078, 0x37ee, + 0x2c08, 0x0c7f, 0x00c0, 0x2541, 0x0078, 0x2513, 0x81ff, 0x00c0, + 0x253d, 0x60bc, 0xd09c, 0x0040, 0x253d, 0x1078, 0x2cfb, 0x0040, + 0x253d, 0x6823, 0x0000, 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, + 0x1078, 0x2d33, 0x701b, 0x2ae5, 0x007c, 0x2009, 0x0080, 0x1078, + 0x3825, 0x00c0, 0x2af2, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, + 0x0040, 0x2af6, 0x2021, 0x400a, 0x0078, 0x2515, 0x0d7e, 0xade8, + 0x000d, 0x6900, 0x6a08, 0x6b0c, 0x6c10, 0x6d14, 0x6e18, 0x6820, + 0xa0be, 0x0100, 0x0040, 0x2b68, 0xa0be, 0x0112, 0x0040, 0x2b68, + 0xa0be, 0x0113, 0x0040, 0x2b68, 0xa0be, 0x0114, 0x0040, 0x2b68, + 0xa0be, 0x0117, 0x0040, 0x2b68, 0xa0be, 0x011a, 0x0040, 0x2b68, + 0xa0be, 0x0121, 0x0040, 0x2b5e, 0xa0be, 0x0131, 0x0040, 0x2b5e, + 0xa0be, 0x0171, 0x0040, 0x2b68, 0xa0be, 0x0173, 0x0040, 0x2b68, + 0xa0be, 0x01a1, 0x00c0, 0x2b31, 0x6830, 0x8007, 0x6832, 0x0078, + 0x2b6e, 0xa0be, 0x0212, 0x0040, 0x2b64, 0xa0be, 0x0213, 0x0040, + 0x2b64, 0xa0be, 0x0214, 0x0040, 0x2b56, 0xa0be, 0x0217, 0x0040, + 0x2b50, 0xa0be, 0x021a, 0x00c0, 0x2b4a, 0x6838, 0x8007, 0x683a, + 0x0078, 0x2b68, 0xa0be, 0x0300, 0x0040, 0x2b68, 0x0078, 0x2541, + 0xad80, 0x0010, 0x20a9, 0x0007, 0x1078, 0x2ba4, 0xad80, 0x000e, + 0x20a9, 0x0001, 0x1078, 0x2ba4, 0x0078, 0x2b68, 0xad80, 0x000c, + 0x1078, 0x2bb2, 0x0078, 0x2b6e, 0xad80, 0x000e, 0x1078, 0x2bb2, + 0xad80, 0x000c, 0x20a9, 0x0001, 0x1078, 0x2ba4, 0x0c7e, 0x1078, + 0x2cfb, 0x0040, 0x2b99, 0x6838, 0xc0fd, 0x683a, 0x6837, 0x0119, + 0x684f, 0x0020, 0x685b, 0x0001, 0x810b, 0x697e, 0x6883, 0x0000, + 0x6a86, 0x6b8a, 0x6c8e, 0x6d92, 0x6996, 0x689b, 0x0000, 0x0c7f, + 0x0d7f, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x6823, 0x0000, + 0x1078, 0x6a5d, 0x0040, 0x253d, 0x7007, 0x0003, 0x701b, 0x2b9d, + 0x007c, 0x0c7f, 0x0d7f, 0x0078, 0x253d, 0x6820, 0xa086, 0x8001, + 0x0040, 0x253d, 0x0078, 0x2513, 0x017e, 0x2008, 0x2044, 0x8000, + 0x204c, 0x8000, 0x290a, 0x8108, 0x280a, 0x8108, 0x00f0, 0x2ba6, + 0x017f, 0x007c, 0x017e, 0x0a7e, 0x0b7e, 0x2008, 0x2044, 0x8000, + 0x204c, 0x8000, 0x2054, 0x8000, 0x205c, 0x2b0a, 0x8108, 0x2a0a, + 0x8108, 0x290a, 0x8108, 0x280a, 0x0b7f, 0x0a7f, 0x017f, 0x007c, + 0x81ff, 0x00c0, 0x253d, 0x7924, 0x2140, 0xa18c, 0xff00, 0x810f, + 0xa182, 0x0080, 0x0048, 0x2541, 0xa182, 0x00ff, 0x00c8, 0x2541, + 0x7a2c, 0x7b28, 0x6064, 0xa306, 0x00c0, 0x2be6, 0x6068, 0xa24e, + 0x0040, 0x2541, 0xa9cc, 0xff00, 0x0040, 0x2541, 0x0c7e, 0x1078, + 0x2c5a, 0x2c68, 0x0c7f, 0x0040, 0x2c0d, 0xa0c6, 0x4000, 0x00c0, + 0x2bf3, 0x0078, 0x2c0a, 0xa0c6, 0x4007, 0x00c0, 0x2bfa, 0x2408, + 0x0078, 0x2c0a, 0xa0c6, 0x4008, 0x00c0, 0x2c02, 0x2708, 0x2610, + 0x0078, 0x2c0a, 0xa0c6, 0x4009, 0x00c0, 0x2c08, 0x0078, 0x2c0a, + 0x2001, 0x4006, 0x2020, 0x0078, 0x2515, 0x017e, 0x0b7e, 0x0c7e, + 0x0e7e, 0x2c70, 0x1078, 0x5b9c, 0x0040, 0x2c48, 0x2d00, 0x601a, + 0x2e58, 0x0e7f, 0x0e7e, 0x0c7e, 0x1078, 0x2cfb, 0x0c7f, 0x2b70, + 0x0040, 0x253d, 0x6837, 0x0000, 0x2d00, 0x6012, 0x6833, 0x0000, + 0x6838, 0xc0fd, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x22bb, + 0x127f, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x37bd, 0x2001, + 0x0002, 0x1078, 0x37d1, 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, + 0x708a, 0x127f, 0x2009, 0x0002, 0x1078, 0x5c29, 0xa085, 0x0001, + 0x0e7f, 0x0c7f, 0x0b7f, 0x017f, 0x0040, 0x253d, 0x7007, 0x0003, + 0x701b, 0x2c53, 0x007c, 0x6830, 0xa086, 0x0100, 0x00c0, 0x2513, + 0x0078, 0x253d, 0x0e7e, 0x0d7e, 0x2029, 0x0000, 0x2021, 0x0080, + 0x20a9, 0x007f, 0x2071, 0x77a0, 0x2e04, 0xa005, 0x00c0, 0x2c6e, + 0x2100, 0xa406, 0x0040, 0x2cab, 0x0078, 0x2c9f, 0x2068, 0x6f10, + 0x2700, 0xa306, 0x00c0, 0x2c90, 0x6e14, 0x2600, 0xa206, 0x00c0, + 0x2c90, 0x2400, 0xa106, 0x00c0, 0x2c8c, 0x2d60, 0xd884, 0x0040, + 0x2cb1, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2cb1, + 0x2001, 0x4000, 0x0078, 0x2cb2, 0x2001, 0x4007, 0x0078, 0x2cb2, + 0x2400, 0xa106, 0x00c0, 0x2c9f, 0x6e14, 0x87ff, 0x00c0, 0x2c9b, + 0x86ff, 0x0040, 0x2cab, 0x2001, 0x4008, 0x0078, 0x2cb2, 0x8420, + 0x8e70, 0x00f0, 0x2c64, 0x2001, 0x4009, 0x0078, 0x2cb2, 0x2001, + 0x0001, 0x0078, 0x2cb2, 0x1078, 0x37ee, 0x00c0, 0x2ca7, 0x6312, + 0x6216, 0xa006, 0xa005, 0x0d7f, 0x0e7f, 0x007c, 0x81ff, 0x00c0, + 0x253d, 0x1078, 0x2cfb, 0x0040, 0x253d, 0x6837, 0x0000, 0x7824, + 0xa005, 0x0040, 0x2541, 0xa096, 0x00ff, 0x0040, 0x2ccb, 0xa092, + 0x0004, 0x00c8, 0x2541, 0x2010, 0x2d18, 0x1078, 0x227d, 0x0040, + 0x253d, 0x7007, 0x0003, 0x701b, 0x2cd6, 0x007c, 0x6830, 0xa086, + 0x0100, 0x0040, 0x253d, 0x0078, 0x2513, 0x81ff, 0x00c0, 0x253d, + 0x7924, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0080, 0x0048, 0x2541, + 0xa182, 0x00ff, 0x00c8, 0x2541, 0x127e, 0x2091, 0x8000, 0x1078, + 0x697f, 0x00c0, 0x2cf8, 0x1078, 0x380d, 0x127f, 0x0078, 0x2513, + 0x127f, 0x0078, 0x253d, 0x1078, 0x132f, 0x0040, 0x2d12, 0xa006, + 0x6802, 0x7010, 0xa005, 0x00c0, 0x2d0a, 0x2d00, 0x7012, 0x7016, + 0x0078, 0x2d10, 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006, 0x7016, + 0xad80, 0x000d, 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x1078, + 0x3825, 0x00c0, 0x2d21, 0xa6b4, 0x00ff, 0xa682, 0x0010, 0x0048, + 0x2d22, 0xa066, 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, 0x0040, + 0x2d2f, 0x2168, 0x6904, 0x1078, 0x1348, 0x0078, 0x2d26, 0x7112, + 0x7116, 0x017f, 0x007c, 0x2031, 0x0001, 0x0078, 0x2d39, 0x2031, + 0x0000, 0x2061, 0x76bd, 0x6606, 0x6112, 0x600e, 0x6226, 0x632a, + 0x642e, 0x6532, 0x2c10, 0x1078, 0x137f, 0x7007, 0x0002, 0x701b, + 0x2513, 0x007c, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0000, + 0x2001, 0x767b, 0x2004, 0xa005, 0x00c0, 0x2d65, 0x0068, 0x2d65, + 0x7818, 0xd084, 0x00c0, 0x2d65, 0x781b, 0x0001, 0x7a22, 0x7b26, + 0x7c2a, 0x2091, 0x4080, 0x0078, 0x2d8a, 0x017e, 0x0c7e, 0x0e7e, + 0x2071, 0x766d, 0x7138, 0xa182, 0x0008, 0x0048, 0x2d73, 0x7030, + 0x2060, 0x0078, 0x2d84, 0x7030, 0xa0e0, 0x0008, 0xac82, 0x76bd, + 0x0048, 0x2d7c, 0x2061, 0x767d, 0x2c00, 0x7032, 0x81ff, 0x00c0, + 0x2d82, 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x640a, 0x0e7f, + 0x0c7f, 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071, 0x766d, + 0x7038, 0xa005, 0x0040, 0x2dc6, 0x127e, 0x2091, 0x8000, 0x0068, + 0x2dc5, 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, 0x2dc4, + 0x0c7e, 0x781b, 0x0001, 0x7034, 0x2060, 0x2c04, 0x7822, 0x6004, + 0x7826, 0x6008, 0x782a, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a, + 0xa005, 0x00c0, 0x2dba, 0x7033, 0x767d, 0x7037, 0x767d, 0x0c7f, + 0x0078, 0x2dc4, 0xac80, 0x0008, 0xa0fa, 0x76bd, 0x0048, 0x2dc2, + 0x2001, 0x767d, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, 0x007c, + 0x027e, 0x2001, 0x7652, 0x2004, 0xd0c4, 0x0040, 0x2dd3, 0x2011, + 0x8014, 0x1078, 0x2d4a, 0x027f, 0x007c, 0x81ff, 0x00c0, 0x253d, + 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078, 0x357b, + 0x127f, 0x0078, 0x2513, 0x7824, 0x2008, 0xa18c, 0xfffd, 0x00c0, + 0x2dee, 0x61c8, 0xa10d, 0x61ca, 0x0078, 0x2513, 0x0078, 0x2541, + 0x81ff, 0x00c0, 0x253d, 0x6000, 0xa086, 0x0003, 0x00c0, 0x253d, + 0x2001, 0x7652, 0x2004, 0xd0a4, 0x00c0, 0x253d, 0x1078, 0x2d13, + 0x0040, 0x2541, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, + 0x2e0d, 0x7828, 0xa005, 0x0040, 0x2513, 0x0c7e, 0x1078, 0x2cfb, + 0x0c7f, 0x0040, 0x253d, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838, + 0xc0fd, 0x683a, 0x1078, 0x6ae6, 0x0040, 0x253d, 0x7007, 0x0003, + 0x701b, 0x2e23, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x253d, + 0x0078, 0x2513, 0x2001, 0x7600, 0x2004, 0xa086, 0x0003, 0x00c0, + 0x253d, 0x7f24, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2cfb, + 0x0040, 0x253d, 0x2009, 0x0000, 0x2031, 0x0000, 0x7023, 0x0000, + 0x702f, 0x0000, 0xad80, 0x0005, 0x7026, 0x20a0, 0x1078, 0x3825, + 0x00c0, 0x2e70, 0x6004, 0xa0c6, 0x0707, 0x0040, 0x2e70, 0xa084, + 0x00ff, 0xa0c6, 0x0006, 0x00c0, 0x2e70, 0x87ff, 0x0040, 0x2e63, + 0xac80, 0x0006, 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078, + 0x2bb2, 0x0078, 0x2e6c, 0xac80, 0x000a, 0x2098, 0x3400, 0x20a9, + 0x0004, 0x53a3, 0x1078, 0x2bb2, 0x21a2, 0x94a0, 0xa6b0, 0x0005, + 0x8108, 0xa186, 0x007e, 0x0040, 0x2e7b, 0xa686, 0x0028, 0x0040, + 0x2e84, 0x0078, 0x2e46, 0x86ff, 0x00c0, 0x2e82, 0x7120, 0x810b, + 0x0078, 0x2513, 0x702f, 0x0001, 0x711e, 0x7020, 0xa600, 0x7022, + 0x772a, 0x2061, 0x76bd, 0x6007, 0x0000, 0x6612, 0x7024, 0x600e, + 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x137f, 0x7007, + 0x0002, 0x701b, 0x2e9c, 0x007c, 0x702c, 0xa005, 0x00c0, 0x2eae, + 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031, 0x0000, 0x2061, 0x76bd, + 0x6224, 0x6328, 0x642c, 0x6530, 0x0078, 0x2e46, 0x7120, 0x810b, + 0x0078, 0x2513, 0x127e, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071, + 0x7600, 0x6044, 0xd0a4, 0x00c0, 0x2edb, 0xd084, 0x0040, 0x2ec4, + 0x1078, 0x3004, 0x0078, 0x2ed7, 0xd08c, 0x0040, 0x2ecb, 0x1078, + 0x2f1b, 0x0078, 0x2ed7, 0xd094, 0x0040, 0x2ed2, 0x1078, 0x2efe, + 0x0078, 0x2ed7, 0xd09c, 0x0040, 0x2ed7, 0x1078, 0x2ee5, 0x0e7f, + 0x0c7f, 0x127f, 0x007c, 0x017e, 0x6128, 0xd19c, 0x00c0, 0x2ee2, + 0xc19d, 0x612a, 0x017f, 0x0078, 0x2ed7, 0x6043, 0x0040, 0x6043, 0x0000, 0x706f, 0x0000, 0x7087, 0x0001, 0x70a7, 0x0000, 0x2009, - 0x73c0, 0x200b, 0x0000, 0x7073, 0x000f, 0x2009, 0x000f, 0x2011, - 0x3187, 0x1078, 0x415f, 0x007c, 0x7070, 0xa005, 0x00c0, 0x2b4a, - 0x2011, 0x3187, 0x1078, 0x40d1, 0x6043, 0x0020, 0x6043, 0x0000, - 0x6044, 0xd08c, 0x00c0, 0x2b46, 0x7003, 0x0001, 0x7083, 0x0000, - 0x6043, 0x0090, 0x6043, 0x0010, 0x0078, 0x2b4a, 0x7077, 0x0000, - 0x0078, 0x2b4a, 0x007c, 0x7074, 0xa08a, 0x0003, 0x00c8, 0x2b54, - 0x1079, 0x2b57, 0x0078, 0x2b56, 0x1078, 0x12b7, 0x007c, 0x2b5a, - 0x2ba9, 0x2c33, 0x0f7e, 0x7077, 0x0001, 0x20e1, 0xa000, 0x20e1, - 0x8700, 0x1078, 0x1bcc, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079, - 0x7200, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f, + 0x7cc0, 0x200b, 0x0000, 0x707f, 0x0000, 0x7073, 0x000f, 0x2009, + 0x000f, 0x2011, 0x353b, 0x1078, 0x45fe, 0x007c, 0x7070, 0xa005, + 0x00c0, 0x2f1a, 0x2011, 0x353b, 0x1078, 0x456e, 0x6043, 0x0020, + 0x6043, 0x0000, 0x6044, 0xd08c, 0x00c0, 0x2f16, 0x7083, 0x0000, + 0x6043, 0x0090, 0x6043, 0x0010, 0x0078, 0x2f1a, 0x7077, 0x0000, + 0x0078, 0x2f1a, 0x007c, 0x7074, 0xa08a, 0x0003, 0x00c8, 0x2f24, + 0x1079, 0x2f27, 0x0078, 0x2f26, 0x1078, 0x12d5, 0x007c, 0x2f2a, + 0x2f79, 0x3003, 0x0f7e, 0x7077, 0x0001, 0x20e1, 0xa000, 0x20e1, + 0x8700, 0x1078, 0x1dea, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079, + 0x7b00, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f, 0x00ef, 0x7813, 0x0138, 0x7817, 0x0000, 0x781b, 0x0000, 0x781f, 0x0000, 0x7823, 0xffff, 0x7827, 0xffff, 0x782b, 0x0000, 0x782f, - 0x0000, 0x2079, 0x720c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099, - 0x6d05, 0x20a1, 0x720e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7212, - 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0x7200, 0x20a1, 0x020b, + 0x0000, 0x2079, 0x7b0c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099, + 0x7605, 0x20a1, 0x7b0e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7b12, + 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0x7b00, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078, - 0x31b2, 0x0f7f, 0x707b, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000, - 0x007c, 0x0d7e, 0x7078, 0x707b, 0x0000, 0xa025, 0x0040, 0x2c1d, - 0x6020, 0xd0b4, 0x00c0, 0x2c1b, 0x7184, 0x81ff, 0x0040, 0x2c04, - 0xa486, 0x000c, 0x00c0, 0x2c0f, 0xa480, 0x0018, 0x8004, 0x20a8, - 0x2011, 0x7280, 0x2019, 0x7200, 0x220c, 0x2304, 0xa106, 0x00c0, - 0x2bdb, 0x8210, 0x8318, 0x00f0, 0x2bc4, 0x6043, 0x0004, 0x608b, + 0x3562, 0x0f7f, 0x707b, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000, + 0x007c, 0x0d7e, 0x7078, 0x707b, 0x0000, 0xa025, 0x0040, 0x2fed, + 0x6020, 0xd0b4, 0x00c0, 0x2feb, 0x7184, 0x81ff, 0x0040, 0x2fd4, + 0xa486, 0x000c, 0x00c0, 0x2fdf, 0xa480, 0x0018, 0x8004, 0x20a8, + 0x2011, 0x7b80, 0x2019, 0x7b00, 0x220c, 0x2304, 0xa106, 0x00c0, + 0x2fab, 0x8210, 0x8318, 0x00f0, 0x2f94, 0x6043, 0x0004, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006, 0x7077, 0x0002, 0x7083, - 0x0002, 0x0078, 0x2c1b, 0x2069, 0x7280, 0x6930, 0xa18e, 0x1101, - 0x00c0, 0x2c0f, 0x6834, 0xa005, 0x00c0, 0x2c0f, 0x6900, 0xa18c, - 0x00ff, 0x00c0, 0x2bef, 0x6804, 0xa005, 0x0040, 0x2c04, 0x2011, - 0x728e, 0x2019, 0x6d05, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, - 0x0048, 0x2c02, 0x00c0, 0x2c0f, 0x8210, 0x8318, 0x00f0, 0x2bf5, - 0x0078, 0x2c0f, 0x7087, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, - 0x2099, 0x7280, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043, - 0x0008, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2c1b, 0x60c3, - 0x000c, 0x1078, 0x31b2, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0, - 0x2c1b, 0x60c3, 0x000c, 0x2011, 0x6f1a, 0x2013, 0x0000, 0x707b, + 0x0002, 0x0078, 0x2feb, 0x2069, 0x7b80, 0x6930, 0xa18e, 0x1101, + 0x00c0, 0x2fdf, 0x6834, 0xa005, 0x00c0, 0x2fdf, 0x6900, 0xa18c, + 0x00ff, 0x00c0, 0x2fbf, 0x6804, 0xa005, 0x0040, 0x2fd4, 0x2011, + 0x7b8e, 0x2019, 0x7605, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, + 0x0048, 0x2fd2, 0x00c0, 0x2fdf, 0x8210, 0x8318, 0x00f0, 0x2fc5, + 0x0078, 0x2fdf, 0x7087, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, + 0x2099, 0x7b80, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043, + 0x0008, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2feb, 0x60c3, + 0x000c, 0x1078, 0x3562, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0, + 0x2feb, 0x60c3, 0x000c, 0x2011, 0x7840, 0x2013, 0x0000, 0x707b, 0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, - 0x4fdc, 0x0078, 0x2c1b, 0x007c, 0x7080, 0xa08a, 0x001d, 0x00c8, - 0x2c3d, 0x1079, 0x2c40, 0x0078, 0x2c3f, 0x1078, 0x12b7, 0x007c, - 0x2c64, 0x2c73, 0x2ca6, 0x2cbb, 0x2ced, 0x2d17, 0x2d49, 0x2d73, - 0x2da5, 0x2dcb, 0x2e1a, 0x2e3c, 0x2e60, 0x2e76, 0x2e9c, 0x2eaf, - 0x2eb8, 0x2ed1, 0x2f01, 0x2f2b, 0x2f5b, 0x2f85, 0x2fce, 0x3003, - 0x3025, 0x3063, 0x3087, 0x30a0, 0x30ad, 0x7003, 0x0007, 0x6004, + 0x5579, 0x0078, 0x2feb, 0x007c, 0x7080, 0xa08a, 0x001d, 0x00c8, + 0x300d, 0x1079, 0x3010, 0x0078, 0x300f, 0x1078, 0x12d5, 0x007c, + 0x3034, 0x3043, 0x3074, 0x3089, 0x30b9, 0x30e1, 0x3111, 0x313b, + 0x316b, 0x3191, 0x31da, 0x31fc, 0x3220, 0x3236, 0x325e, 0x3271, + 0x327a, 0x3293, 0x32c1, 0x32e9, 0x3317, 0x3341, 0x3384, 0x33b5, + 0x33d7, 0x3415, 0x343b, 0x3454, 0x3461, 0x7003, 0x0007, 0x6004, 0xa084, 0xfff9, 0x6006, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0, - 0x6043, 0x0002, 0x7083, 0x0001, 0x2009, 0x07d0, 0x2011, 0x318e, - 0x1078, 0x40c4, 0x007c, 0x0f7e, 0x7078, 0xa086, 0x0014, 0x00c0, - 0x2ca4, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2ca4, 0x2079, - 0x7280, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2ca2, 0x7834, 0xa005, - 0x00c0, 0x2ca2, 0x7a38, 0xd2fc, 0x0040, 0x2c98, 0x70a4, 0xa005, - 0x00c0, 0x2c98, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001, - 0x2011, 0x318e, 0x1078, 0x40d1, 0x7083, 0x0010, 0x1078, 0x2eb8, - 0x0078, 0x2ca4, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0003, - 0x6043, 0x0004, 0x1078, 0x321b, 0x20a3, 0x1102, 0x20a3, 0x0000, - 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x2cb2, 0x60c3, 0x0014, - 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2ceb, - 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2ce7, - 0x2079, 0x7280, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2ce7, 0x7834, - 0xa005, 0x00c0, 0x2ce7, 0x7a38, 0xd2fc, 0x0040, 0x2ce1, 0x70a4, - 0xa005, 0x00c0, 0x2ce1, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7, - 0x0001, 0x7083, 0x0004, 0x1078, 0x2ced, 0x0078, 0x2ceb, 0x7083, - 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0005, 0x1078, - 0x321b, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0x728e, - 0x706c, 0xa005, 0x00c0, 0x2d09, 0x714c, 0xa186, 0xffff, 0x0040, - 0x2d09, 0x1078, 0x3152, 0x0040, 0x2d09, 0x2019, 0x002a, 0x1078, - 0x202f, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, - 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31b2, 0x007c, 0x0f7e, - 0x7078, 0xa005, 0x0040, 0x2d47, 0x2011, 0x318e, 0x1078, 0x40d1, - 0xa086, 0x0014, 0x00c0, 0x2d43, 0x2079, 0x7280, 0x7a30, 0xa296, - 0x1103, 0x00c0, 0x2d43, 0x7834, 0xa005, 0x00c0, 0x2d43, 0x7a38, - 0xd2fc, 0x0040, 0x2d3d, 0x70a4, 0xa005, 0x00c0, 0x2d3d, 0x2019, - 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001, 0x7083, 0x0006, 0x1078, - 0x2d49, 0x0078, 0x2d47, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, - 0x007c, 0x7083, 0x0007, 0x1078, 0x321b, 0x20a3, 0x1104, 0x20a3, - 0x0000, 0x3430, 0x2011, 0x728e, 0x706c, 0xa005, 0x00c0, 0x2d65, - 0x7150, 0xa186, 0xffff, 0x0040, 0x2d65, 0xa180, 0x2091, 0x200c, - 0xa18c, 0xff00, 0x810f, 0x1078, 0x3152, 0x20a9, 0x0008, 0x2298, + 0x6043, 0x0002, 0x7083, 0x0001, 0x2009, 0x07d0, 0x2011, 0x3542, + 0x1078, 0x4561, 0x007c, 0x0f7e, 0x7078, 0xa086, 0x0014, 0x00c0, + 0x3072, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x3072, 0x2079, + 0x7b80, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x3070, 0x7834, 0xa005, + 0x00c0, 0x3070, 0x7a38, 0xd2fc, 0x0040, 0x3066, 0x70a4, 0xa005, + 0x00c0, 0x3066, 0x1078, 0x35fb, 0x70a7, 0x0001, 0x2011, 0x3542, + 0x1078, 0x456e, 0x7083, 0x0010, 0x1078, 0x327a, 0x0078, 0x3072, + 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0003, 0x6043, 0x0004, + 0x1078, 0x35cc, 0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9, 0x000a, + 0x20a3, 0x0000, 0x00f0, 0x3080, 0x60c3, 0x0014, 0x1078, 0x3562, + 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x30b7, 0x2011, 0x3542, + 0x1078, 0x456e, 0xa086, 0x0014, 0x00c0, 0x30b3, 0x2079, 0x7b80, + 0x7a30, 0xa296, 0x1102, 0x00c0, 0x30b3, 0x7834, 0xa005, 0x00c0, + 0x30b3, 0x7a38, 0xd2fc, 0x0040, 0x30ad, 0x70a4, 0xa005, 0x00c0, + 0x30ad, 0x1078, 0x35fb, 0x70a7, 0x0001, 0x7083, 0x0004, 0x1078, + 0x30b9, 0x0078, 0x30b7, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, + 0x007c, 0x7083, 0x0005, 0x1078, 0x35cc, 0x20a3, 0x1103, 0x20a3, + 0x0000, 0x3430, 0x2011, 0x7b8e, 0x706c, 0xa005, 0x00c0, 0x30d3, + 0x714c, 0xa186, 0xffff, 0x0040, 0x30d3, 0x1078, 0x3506, 0x0040, + 0x30d3, 0x1078, 0x35fb, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x3562, + 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x310f, 0x2011, 0x3542, + 0x1078, 0x456e, 0xa086, 0x0014, 0x00c0, 0x310b, 0x2079, 0x7b80, + 0x7a30, 0xa296, 0x1103, 0x00c0, 0x310b, 0x7834, 0xa005, 0x00c0, + 0x310b, 0x7a38, 0xd2fc, 0x0040, 0x3105, 0x70a4, 0xa005, 0x00c0, + 0x3105, 0x1078, 0x35fb, 0x70a7, 0x0001, 0x7083, 0x0006, 0x1078, + 0x3111, 0x0078, 0x310f, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, + 0x007c, 0x7083, 0x0007, 0x1078, 0x35cc, 0x20a3, 0x1104, 0x20a3, + 0x0000, 0x3430, 0x2011, 0x7b8e, 0x706c, 0xa005, 0x00c0, 0x312d, + 0x7150, 0xa186, 0xffff, 0x0040, 0x312d, 0xa180, 0x232f, 0x200c, + 0xa18c, 0xff00, 0x810f, 0x1078, 0x3506, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, - 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2da3, - 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2d9f, - 0x2079, 0x7280, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2d9f, 0x7834, - 0xa005, 0x00c0, 0x2d9f, 0x7a38, 0xd2fc, 0x0040, 0x2d99, 0x70a4, - 0xa005, 0x00c0, 0x2d99, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7, - 0x0001, 0x7083, 0x0008, 0x1078, 0x2da5, 0x0078, 0x2da3, 0x7083, - 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0009, 0x1078, - 0x321b, 0x20a3, 0x1105, 0x20a3, 0x0100, 0x3430, 0x706c, 0xa005, - 0x00c0, 0x2db8, 0x1078, 0x30bc, 0x0040, 0x2dc8, 0x0078, 0x2dc2, - 0x20a9, 0x0008, 0x2099, 0x728e, 0x26a0, 0x53a6, 0x20a3, 0x0000, - 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31b2, 0x0078, 0x2dca, - 0x1078, 0x2c5d, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2e18, - 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2e14, - 0x2079, 0x7280, 0x7a30, 0xa296, 0x1105, 0x00c0, 0x2e14, 0x7834, - 0x2011, 0x0100, 0xa21e, 0x00c0, 0x2dfb, 0x7a38, 0xd2fc, 0x0040, - 0x2df3, 0x70a4, 0xa005, 0x00c0, 0x2df3, 0x2019, 0x002a, 0x1078, - 0x202f, 0x70a7, 0x0001, 0x707f, 0x0001, 0x7083, 0x000a, 0x1078, - 0x2e1a, 0x0078, 0x2e18, 0xa005, 0x00c0, 0x2e14, 0x7a38, 0xd2fc, - 0x0040, 0x2e0c, 0x70a4, 0xa005, 0x00c0, 0x2e0c, 0x2019, 0x002a, - 0x1078, 0x202f, 0x70a7, 0x0001, 0x707f, 0x0000, 0x7083, 0x000e, - 0x1078, 0x2e9c, 0x0078, 0x2e18, 0x7083, 0x0002, 0x707b, 0x0000, - 0x0f7f, 0x007c, 0x7083, 0x000b, 0x2011, 0x720e, 0x22a0, 0x20a9, + 0x1078, 0x3562, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3169, + 0x2011, 0x3542, 0x1078, 0x456e, 0xa086, 0x0014, 0x00c0, 0x3165, + 0x2079, 0x7b80, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x3165, 0x7834, + 0xa005, 0x00c0, 0x3165, 0x7a38, 0xd2fc, 0x0040, 0x315f, 0x70a4, + 0xa005, 0x00c0, 0x315f, 0x1078, 0x35fb, 0x70a7, 0x0001, 0x7083, + 0x0008, 0x1078, 0x316b, 0x0078, 0x3169, 0x7083, 0x0002, 0x707b, + 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0009, 0x1078, 0x35cc, 0x20a3, + 0x1105, 0x20a3, 0x0100, 0x3430, 0x706c, 0xa005, 0x00c0, 0x317e, + 0x1078, 0x3470, 0x0040, 0x318e, 0x0078, 0x3188, 0x20a9, 0x0008, + 0x2099, 0x7b8e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x60c3, 0x0014, 0x1078, 0x3562, 0x0078, 0x3190, 0x1078, 0x302d, + 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x31d8, 0x2011, 0x3542, + 0x1078, 0x456e, 0xa086, 0x0014, 0x00c0, 0x31d4, 0x2079, 0x7b80, + 0x7a30, 0xa296, 0x1105, 0x00c0, 0x31d4, 0x7834, 0x2011, 0x0100, + 0xa21e, 0x00c0, 0x31bd, 0x7a38, 0xd2fc, 0x0040, 0x31b7, 0x70a4, + 0xa005, 0x00c0, 0x31b7, 0x1078, 0x35fb, 0x70a7, 0x0001, 0x7083, + 0x000a, 0x1078, 0x31da, 0x0078, 0x31d8, 0xa005, 0x00c0, 0x31d4, + 0x7a38, 0xd2fc, 0x0040, 0x31cc, 0x70a4, 0xa005, 0x00c0, 0x31cc, + 0x1078, 0x35fb, 0x70a7, 0x0001, 0x707f, 0x0000, 0x7083, 0x000e, + 0x1078, 0x325e, 0x0078, 0x31d8, 0x7083, 0x0002, 0x707b, 0x0000, + 0x0f7f, 0x007c, 0x7083, 0x000b, 0x2011, 0x7b0e, 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000, - 0x41a4, 0x1078, 0x321b, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030, + 0x41a4, 0x1078, 0x35cc, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030, 0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3, - 0x0084, 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, - 0x2e5e, 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0084, 0x00c0, - 0x2e5a, 0x2079, 0x7280, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x2e5a, - 0x7834, 0xa005, 0x00c0, 0x2e5a, 0x7083, 0x000c, 0x1078, 0x2e60, - 0x0078, 0x2e5e, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, - 0x7083, 0x000d, 0x1078, 0x321b, 0x20a3, 0x1107, 0x20a3, 0x0000, - 0x2099, 0x728e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, - 0x0000, 0x60c3, 0x0084, 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, - 0xa005, 0x0040, 0x2e9a, 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, - 0x0084, 0x00c0, 0x2e96, 0x2079, 0x7280, 0x7a30, 0xa296, 0x1107, - 0x00c0, 0x2e96, 0x7834, 0xa005, 0x00c0, 0x2e96, 0x1078, 0x320d, - 0x7083, 0x000e, 0x1078, 0x2e9c, 0x0078, 0x2e9a, 0x7083, 0x0002, - 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x000f, 0x707b, 0x0000, - 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004, - 0x2009, 0x07d0, 0x2011, 0x318e, 0x1078, 0x40c4, 0x007c, 0x7078, - 0xa005, 0x0040, 0x2eb7, 0x2011, 0x318e, 0x1078, 0x40d1, 0x007c, - 0x7083, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7280, - 0x20a1, 0x020b, 0x7478, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, - 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x1078, 0x31b2, - 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2eff, 0x2011, 0x318e, - 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2efd, 0x2079, 0x7280, - 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2efd, 0x7834, 0xa005, 0x00c0, - 0x2efd, 0x7a38, 0xd2fc, 0x0040, 0x2ef7, 0x70a4, 0xa005, 0x00c0, - 0x2ef7, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001, 0x7083, - 0x0012, 0x1078, 0x2f01, 0x0078, 0x2eff, 0x707b, 0x0000, 0x0f7f, - 0x007c, 0x7083, 0x0013, 0x1078, 0x3227, 0x20a3, 0x1103, 0x20a3, - 0x0000, 0x3430, 0x2011, 0x728e, 0x706c, 0xa005, 0x00c0, 0x2f1d, - 0x714c, 0xa186, 0xffff, 0x0040, 0x2f1d, 0x1078, 0x3152, 0x0040, - 0x2f1d, 0x2019, 0x002a, 0x1078, 0x202f, 0x20a9, 0x0008, 0x2298, - 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, - 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2f59, - 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2f57, - 0x2079, 0x7280, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2f57, 0x7834, - 0xa005, 0x00c0, 0x2f57, 0x7a38, 0xd2fc, 0x0040, 0x2f51, 0x70a4, - 0xa005, 0x00c0, 0x2f51, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7, - 0x0001, 0x7083, 0x0014, 0x1078, 0x2f5b, 0x0078, 0x2f59, 0x707b, - 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0015, 0x1078, 0x3227, 0x20a3, - 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x728e, 0x706c, 0xa006, - 0x00c0, 0x2f77, 0x7150, 0xa186, 0xffff, 0x0040, 0x2f77, 0xa180, - 0x2091, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078, 0x3152, 0x20a9, - 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, - 0x60c3, 0x0014, 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, - 0x0040, 0x2fcc, 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, - 0x00c0, 0x2fca, 0x2079, 0x7280, 0x7a30, 0xa296, 0x1105, 0x00c0, - 0x2fca, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0, 0x2fb1, 0x7a38, - 0xd2fc, 0x0040, 0x2fad, 0x70a4, 0xa005, 0x00c0, 0x2fad, 0x2019, - 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001, 0x707f, 0x0001, 0x0078, - 0x2fc4, 0xa005, 0x00c0, 0x2fca, 0x7a38, 0xd2fc, 0x0040, 0x2fc2, - 0x70a4, 0xa005, 0x00c0, 0x2fc2, 0x2019, 0x002a, 0x1078, 0x202f, - 0x70a7, 0x0001, 0x707f, 0x0000, 0x7083, 0x0016, 0x1078, 0x2fce, - 0x0078, 0x2fcc, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080, - 0x20e1, 0x4000, 0x2099, 0x7280, 0x20a1, 0x020b, 0x20a9, 0x000e, - 0x53a6, 0x3430, 0x2011, 0x728e, 0x707c, 0xa005, 0x0040, 0x2fe4, - 0x7083, 0x0017, 0x0078, 0x2fe6, 0x7083, 0x001b, 0x706c, 0xa005, - 0x00c0, 0x2ff0, 0x1078, 0x30bc, 0x0040, 0x3000, 0x0078, 0x2ffa, - 0x20a9, 0x0008, 0x2099, 0x728e, 0x26a0, 0x53a6, 0x20a3, 0x0000, - 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31b2, 0x0078, 0x3002, - 0x1078, 0x2c5d, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3023, - 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0084, 0x00c0, 0x3021, - 0x2079, 0x7280, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x3021, 0x7834, - 0xa005, 0x00c0, 0x3021, 0x7083, 0x0018, 0x1078, 0x3025, 0x0078, - 0x3023, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0019, 0x1078, - 0x3227, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0x728e, - 0x2039, 0x720e, 0x27a0, 0x20a9, 0x0040, 0x53a3, 0x2728, 0x2514, - 0x8207, 0xa084, 0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007, - 0xa205, 0x202a, 0x6030, 0x2310, 0x8214, 0xa2a0, 0x720e, 0x2414, - 0xa38c, 0x0001, 0x0040, 0x3050, 0xa294, 0xff00, 0x0078, 0x3053, - 0xa294, 0x00ff, 0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9, - 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, - 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3085, - 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0084, 0x00c0, 0x3083, - 0x2079, 0x7280, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x3083, 0x7834, - 0xa005, 0x00c0, 0x3083, 0x1078, 0x320d, 0x7083, 0x001a, 0x1078, - 0x3087, 0x0078, 0x3085, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, - 0x001b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7280, 0x20a1, - 0x020b, 0x7478, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, - 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0084, 0x1078, 0x31b2, 0x007c, - 0x7078, 0xa005, 0x0040, 0x30ac, 0x2011, 0x318e, 0x1078, 0x40d1, - 0x7083, 0x001c, 0x1078, 0x30ad, 0x007c, 0x707b, 0x0000, 0x608b, - 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0001, 0x2009, 0x07d0, 0x2011, - 0x318e, 0x1078, 0x40c4, 0x007c, 0x087e, 0x097e, 0x2029, 0x6d52, - 0x252c, 0x20a9, 0x0008, 0x2041, 0x720e, 0x28a0, 0x2099, 0x728e, - 0x53a3, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x30d2, - 0x2011, 0x0000, 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0, - 0x30e4, 0xd5d4, 0x0040, 0x30df, 0x8210, 0x0078, 0x30e0, 0x8211, - 0x00f0, 0x30d2, 0x0078, 0x3149, 0x82ff, 0x00c0, 0x30f6, 0xd5d4, - 0x0040, 0x30f0, 0xa1a6, 0x3fff, 0x0040, 0x30dc, 0x0078, 0x30f4, - 0xa1a6, 0x3fff, 0x0040, 0x3149, 0xa18d, 0xc000, 0x20a9, 0x0010, - 0x2019, 0x0001, 0xd5d4, 0x0040, 0x30ff, 0x2019, 0x0010, 0x2120, - 0xd5d4, 0x0040, 0x3106, 0x8423, 0x0078, 0x3107, 0x8424, 0x00c8, - 0x3114, 0xd5d4, 0x0040, 0x310f, 0x8319, 0x0078, 0x3110, 0x8318, - 0x00f0, 0x3100, 0x0078, 0x3149, 0x23a8, 0x2021, 0x0001, 0x8426, - 0x8425, 0x00f0, 0x3118, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040, - 0x312c, 0x007e, 0x2039, 0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8, - 0xa5a8, 0x0010, 0x00f0, 0x3128, 0x754e, 0xa5c8, 0x2091, 0x292c, - 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, - 0xa405, 0x201a, 0x706f, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008, - 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078, - 0x314f, 0xa006, 0x0078, 0x314f, 0xa006, 0x1078, 0x12b7, 0x097f, - 0x087f, 0x007c, 0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a, - 0x0010, 0x0048, 0x315f, 0x8420, 0x8001, 0x0078, 0x3157, 0x2118, - 0x84ff, 0x0040, 0x3168, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x3163, - 0x2021, 0x0001, 0x83ff, 0x0040, 0x3171, 0x8423, 0x8319, 0x00c0, - 0x316d, 0xa238, 0x2704, 0xa42c, 0x00c0, 0x3186, 0xa405, 0x203a, - 0x714e, 0xa1a0, 0x2091, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7, - 0x0000, 0x65ea, 0x706f, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e, - 0x2071, 0x6d00, 0x7073, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e, - 0x2079, 0x0100, 0x2071, 0x0140, 0x1078, 0x4fe5, 0x7004, 0xa084, - 0x4000, 0x0040, 0x319f, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e, - 0x2091, 0x8000, 0x2071, 0x6d00, 0x7003, 0x0001, 0x2071, 0x6d20, + 0x0084, 0x1078, 0x3562, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, + 0x321e, 0x2011, 0x3542, 0x1078, 0x456e, 0xa086, 0x0084, 0x00c0, + 0x321a, 0x2079, 0x7b80, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x321a, + 0x7834, 0xa005, 0x00c0, 0x321a, 0x7083, 0x000c, 0x1078, 0x3220, + 0x0078, 0x321e, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, + 0x7083, 0x000d, 0x1078, 0x35cc, 0x20a3, 0x1107, 0x20a3, 0x0000, + 0x2099, 0x7b8e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x60c3, 0x0084, 0x1078, 0x3562, 0x007c, 0x0f7e, 0x7078, + 0xa005, 0x0040, 0x325c, 0x2011, 0x3542, 0x1078, 0x456e, 0xa086, + 0x0084, 0x00c0, 0x3258, 0x2079, 0x7b80, 0x7a30, 0xa296, 0x1107, + 0x00c0, 0x3258, 0x7834, 0xa005, 0x00c0, 0x3258, 0x707f, 0x0001, + 0x1078, 0x35be, 0x7083, 0x000e, 0x1078, 0x325e, 0x0078, 0x325c, + 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x000f, + 0x707b, 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005, + 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x3542, 0x1078, 0x4561, + 0x007c, 0x7078, 0xa005, 0x0040, 0x3279, 0x2011, 0x3542, 0x1078, + 0x456e, 0x007c, 0x7083, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000, + 0x2099, 0x7b80, 0x20a1, 0x020b, 0x7478, 0xa480, 0x0018, 0xa080, + 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, + 0x1078, 0x3562, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x32bf, + 0x2011, 0x3542, 0x1078, 0x456e, 0xa086, 0x0014, 0x00c0, 0x32bd, + 0x2079, 0x7b80, 0x7a30, 0xa296, 0x1103, 0x00c0, 0x32bd, 0x7834, + 0xa005, 0x00c0, 0x32bd, 0x7a38, 0xd2fc, 0x0040, 0x32b7, 0x70a4, + 0xa005, 0x00c0, 0x32b7, 0x1078, 0x35fb, 0x70a7, 0x0001, 0x7083, + 0x0012, 0x1078, 0x32c1, 0x0078, 0x32bf, 0x707b, 0x0000, 0x0f7f, + 0x007c, 0x7083, 0x0013, 0x1078, 0x35d8, 0x20a3, 0x1103, 0x20a3, + 0x0000, 0x3430, 0x2011, 0x7b8e, 0x706c, 0xa005, 0x00c0, 0x32db, + 0x714c, 0xa186, 0xffff, 0x0040, 0x32db, 0x1078, 0x3506, 0x0040, + 0x32db, 0x1078, 0x35fb, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x3562, + 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3315, 0x2011, 0x3542, + 0x1078, 0x456e, 0xa086, 0x0014, 0x00c0, 0x3313, 0x2079, 0x7b80, + 0x7a30, 0xa296, 0x1104, 0x00c0, 0x3313, 0x7834, 0xa005, 0x00c0, + 0x3313, 0x7a38, 0xd2fc, 0x0040, 0x330d, 0x70a4, 0xa005, 0x00c0, + 0x330d, 0x1078, 0x35fb, 0x70a7, 0x0001, 0x7083, 0x0014, 0x1078, + 0x3317, 0x0078, 0x3315, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, + 0x0015, 0x1078, 0x35d8, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, + 0x2011, 0x7b8e, 0x706c, 0xa006, 0x00c0, 0x3333, 0x7150, 0xa186, + 0xffff, 0x0040, 0x3333, 0xa180, 0x232f, 0x200c, 0xa18c, 0xff00, + 0x810f, 0x1078, 0x3506, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x3562, + 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3382, 0x2011, 0x3542, + 0x1078, 0x456e, 0xa086, 0x0014, 0x00c0, 0x3380, 0x2079, 0x7b80, + 0x7a30, 0xa296, 0x1105, 0x00c0, 0x3380, 0x7834, 0x2011, 0x0100, + 0xa21e, 0x00c0, 0x3369, 0x7a38, 0xd2fc, 0x0040, 0x3367, 0x70a4, + 0xa005, 0x00c0, 0x3367, 0x1078, 0x35fb, 0x70a7, 0x0001, 0x0078, + 0x337a, 0xa005, 0x00c0, 0x3380, 0x7a38, 0xd2fc, 0x0040, 0x3378, + 0x70a4, 0xa005, 0x00c0, 0x3378, 0x1078, 0x35fb, 0x70a7, 0x0001, + 0x707f, 0x0000, 0x7083, 0x0016, 0x1078, 0x3384, 0x0078, 0x3382, + 0x707b, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, + 0x2099, 0x7b80, 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6, 0x3430, + 0x2011, 0x7b8e, 0x7083, 0x0017, 0x0078, 0x3398, 0x7083, 0x001b, + 0x706c, 0xa005, 0x00c0, 0x33a2, 0x1078, 0x3470, 0x0040, 0x33b2, + 0x0078, 0x33ac, 0x20a9, 0x0008, 0x2099, 0x7b8e, 0x26a0, 0x53a6, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x3562, + 0x0078, 0x33b4, 0x1078, 0x302d, 0x007c, 0x0f7e, 0x7078, 0xa005, + 0x0040, 0x33d5, 0x2011, 0x3542, 0x1078, 0x456e, 0xa086, 0x0084, + 0x00c0, 0x33d3, 0x2079, 0x7b80, 0x7a30, 0xa296, 0x1106, 0x00c0, + 0x33d3, 0x7834, 0xa005, 0x00c0, 0x33d3, 0x7083, 0x0018, 0x1078, + 0x33d7, 0x0078, 0x33d5, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, + 0x0019, 0x1078, 0x35d8, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x3430, + 0x2099, 0x7b8e, 0x2039, 0x7b0e, 0x27a0, 0x20a9, 0x0040, 0x53a3, + 0x2728, 0x2514, 0x8207, 0xa084, 0x00ff, 0x8000, 0x2018, 0xa294, + 0x00ff, 0x8007, 0xa205, 0x202a, 0x6030, 0x2310, 0x8214, 0xa2a0, + 0x7b0e, 0x2414, 0xa38c, 0x0001, 0x0040, 0x3402, 0xa294, 0xff00, + 0x0078, 0x3405, 0xa294, 0x00ff, 0x8007, 0xa215, 0x2222, 0x2798, + 0x26a0, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x60c3, 0x0084, 0x1078, 0x3562, 0x007c, 0x0f7e, 0x7078, 0xa005, + 0x0040, 0x3439, 0x2011, 0x3542, 0x1078, 0x456e, 0xa086, 0x0084, + 0x00c0, 0x3437, 0x2079, 0x7b80, 0x7a30, 0xa296, 0x1107, 0x00c0, + 0x3437, 0x7834, 0xa005, 0x00c0, 0x3437, 0x707f, 0x0001, 0x1078, + 0x35be, 0x7083, 0x001a, 0x1078, 0x343b, 0x0078, 0x3439, 0x707b, + 0x0000, 0x0f7f, 0x007c, 0x7083, 0x001b, 0x20e1, 0x9080, 0x20e1, + 0x4000, 0x2099, 0x7b80, 0x20a1, 0x020b, 0x7478, 0xa480, 0x0018, + 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, + 0x0084, 0x1078, 0x3562, 0x007c, 0x7078, 0xa005, 0x0040, 0x3460, + 0x2011, 0x3542, 0x1078, 0x456e, 0x7083, 0x001c, 0x1078, 0x3461, + 0x007c, 0x707b, 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, + 0x0001, 0x2009, 0x07d0, 0x2011, 0x3542, 0x1078, 0x4561, 0x007c, + 0x087e, 0x097e, 0x2029, 0x7652, 0x252c, 0x20a9, 0x0008, 0x2041, + 0x7b0e, 0x28a0, 0x2099, 0x7b8e, 0x53a3, 0x20a9, 0x0008, 0x2011, + 0x0007, 0xd5d4, 0x0040, 0x3486, 0x2011, 0x0000, 0x2800, 0xa200, + 0x200c, 0xa1a6, 0xffff, 0x00c0, 0x3498, 0xd5d4, 0x0040, 0x3493, + 0x8210, 0x0078, 0x3494, 0x8211, 0x00f0, 0x3486, 0x0078, 0x34fd, + 0x82ff, 0x00c0, 0x34aa, 0xd5d4, 0x0040, 0x34a4, 0xa1a6, 0x3fff, + 0x0040, 0x3490, 0x0078, 0x34a8, 0xa1a6, 0x3fff, 0x0040, 0x34fd, + 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0040, + 0x34b3, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0040, 0x34ba, 0x8423, + 0x0078, 0x34bb, 0x8424, 0x00c8, 0x34c8, 0xd5d4, 0x0040, 0x34c3, + 0x8319, 0x0078, 0x34c4, 0x8318, 0x00f0, 0x34b4, 0x0078, 0x34fd, + 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x00f0, 0x34cc, 0x2328, + 0x8529, 0xa2be, 0x0007, 0x0040, 0x34e0, 0x007e, 0x2039, 0x0007, + 0x2200, 0xa73a, 0x007f, 0x27a8, 0xa5a8, 0x0010, 0x00f0, 0x34dc, + 0x754e, 0xa5c8, 0x232f, 0x292c, 0xa5ac, 0x00ff, 0x6532, 0x60e7, + 0x0000, 0x65ea, 0x2018, 0x2304, 0xa405, 0x201a, 0x706f, 0x0001, + 0x26a0, 0x2898, 0x20a9, 0x0008, 0x53a6, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0xa085, 0x0001, 0x0078, 0x3503, 0xa006, 0x0078, 0x3503, + 0xa006, 0x1078, 0x12d5, 0x097f, 0x087f, 0x007c, 0x2118, 0x2021, + 0x0000, 0x2001, 0x0007, 0xa39a, 0x0010, 0x0048, 0x3513, 0x8420, + 0x8001, 0x0078, 0x350b, 0x2118, 0x84ff, 0x0040, 0x351c, 0xa39a, + 0x0010, 0x8421, 0x00c0, 0x3517, 0x2021, 0x0001, 0x83ff, 0x0040, + 0x3525, 0x8423, 0x8319, 0x00c0, 0x3521, 0xa238, 0x2704, 0xa42c, + 0x00c0, 0x353a, 0xa405, 0x203a, 0x714e, 0xa1a0, 0x232f, 0x242c, + 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea, 0x706f, 0x0001, + 0xa084, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7600, 0x7073, 0x0000, + 0x0e7f, 0x007c, 0x0e7e, 0x0f7e, 0x2079, 0x0100, 0x2071, 0x0140, + 0x1078, 0x5582, 0x7004, 0xa084, 0x4000, 0x0040, 0x3553, 0x7003, + 0x1000, 0x7003, 0x0000, 0x127e, 0x2091, 0x8000, 0x2071, 0x7620, 0x2073, 0x0000, 0x7843, 0x0090, 0x7843, 0x0010, 0x127f, 0x0f7f, - 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x2011, 0x6f1a, 0x2013, + 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x2011, 0x7840, 0x2013, 0x0000, 0x707b, 0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3, 0x0056, - 0x60a7, 0x9575, 0x1078, 0x4fdc, 0x2009, 0x07d0, 0x2011, 0x318e, - 0x1078, 0x415f, 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091, - 0x8000, 0x2009, 0x00f7, 0x1078, 0x3233, 0x2061, 0x6f23, 0x601b, - 0x0000, 0x601f, 0x0000, 0x2061, 0x6d00, 0x6003, 0x0001, 0x2061, + 0x60a7, 0x9575, 0x1078, 0x5579, 0x2009, 0x07d0, 0x2011, 0x3542, + 0x1078, 0x45fe, 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091, + 0x8000, 0x2009, 0x00f7, 0x1078, 0x35e4, 0x2061, 0x7849, 0x601b, + 0x0000, 0x601f, 0x0000, 0x2061, 0x7600, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011, - 0x31f0, 0x1078, 0x40c4, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c, + 0x35a0, 0x1078, 0x4561, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c, 0x0e7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x0100, 0x1078, - 0x4fe5, 0x2071, 0x0140, 0xa084, 0x4000, 0x0040, 0x3203, 0x7003, - 0x1000, 0x7003, 0x0000, 0x2001, 0x0001, 0x1078, 0x1dc9, 0x1078, - 0x31cb, 0x127f, 0x007f, 0x0e7f, 0x007c, 0x20a9, 0x0040, 0x20a1, - 0x73c0, 0x2099, 0x728e, 0x3304, 0x8007, 0x20a2, 0x9398, 0x94a0, - 0x00f0, 0x3213, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, - 0x7200, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x20e1, - 0x9080, 0x20e1, 0x4000, 0x2099, 0x7280, 0x20a1, 0x020b, 0x20a9, - 0x000c, 0x53a6, 0x007c, 0x0c7e, 0x007e, 0x2061, 0x0100, 0x810f, - 0x2001, 0x6d2c, 0x2004, 0xa005, 0x00c0, 0x3244, 0x6030, 0xa084, - 0x00ff, 0xa105, 0x0078, 0x3246, 0xa185, 0x00f7, 0x604a, 0x007f, - 0x0c7f, 0x007c, 0x157e, 0x20a9, 0x00ff, 0x2009, 0x6e00, 0xa006, - 0x200a, 0x8108, 0x00f0, 0x3250, 0x157f, 0x007c, 0x0d7e, 0x037e, - 0x157e, 0x137e, 0x147e, 0x2069, 0x6d51, 0xa006, 0x6002, 0x6007, - 0x0707, 0x600a, 0x600e, 0x6012, 0xa198, 0x2091, 0x231c, 0xa39c, - 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006, 0x23a0, 0x40a4, - 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4, 0x603e, 0x6042, - 0x604e, 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, 0x6066, 0x606a, - 0x606e, 0x6072, 0x6076, 0x607a, 0x607e, 0x6082, 0x6086, 0x608a, - 0x608e, 0x6092, 0x6096, 0x609a, 0x609e, 0x61a2, 0x604a, 0x6810, - 0x603a, 0x680c, 0x6046, 0x147f, 0x137f, 0x157f, 0x037f, 0x0d7f, - 0x007c, 0x127e, 0x2091, 0x8000, 0x6944, 0xa1b4, 0x00ff, 0xa682, - 0x0010, 0x00c8, 0x3337, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff, - 0x00c8, 0x333d, 0xa188, 0x6e00, 0x2104, 0xa065, 0x0040, 0x3316, - 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x331c, 0x6078, - 0xa00d, 0x0040, 0x32c1, 0xa680, 0x6c84, 0x2004, 0xa10c, 0x00c0, - 0x3310, 0x607c, 0xa00d, 0x0040, 0x32dd, 0xa680, 0x6c84, 0x2004, - 0xa10c, 0x0040, 0x32dd, 0x694c, 0xd1fc, 0x00c0, 0x32d3, 0x1078, - 0x33d0, 0x0078, 0x330b, 0x1078, 0x33a1, 0x694c, 0xd1ec, 0x00c0, - 0x330b, 0x1078, 0x34f0, 0x0078, 0x330b, 0x694c, 0xa184, 0xa000, - 0x0040, 0x32fb, 0xd1ec, 0x0040, 0x32f4, 0xd1fc, 0x0040, 0x32ec, - 0x1078, 0x3507, 0x0078, 0x32f7, 0xa680, 0x6c84, 0x200c, 0x607c, - 0xa105, 0x607e, 0x0078, 0x32fb, 0xd1fc, 0x0040, 0x32fb, 0x1078, - 0x33a1, 0x0078, 0x330b, 0x6050, 0xa00d, 0x0040, 0x3306, 0x2d00, - 0x200a, 0x6803, 0x0000, 0x6052, 0x0078, 0x330b, 0x2d00, 0x6052, - 0x604e, 0x6803, 0x0000, 0x1078, 0x4346, 0xa006, 0x127f, 0x007c, - 0x2001, 0x0005, 0x2009, 0x0000, 0x0078, 0x3341, 0x2001, 0x0028, - 0x2009, 0x0000, 0x0078, 0x3341, 0xa082, 0x0006, 0x0048, 0x32b7, - 0x2009, 0x6d0c, 0x210c, 0xd18c, 0x0040, 0x332a, 0x2001, 0x0004, - 0x0078, 0x3333, 0xd184, 0x0040, 0x3331, 0x2001, 0x0004, 0x0078, - 0x3333, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x3341, 0x2001, - 0x0029, 0x2009, 0x0000, 0x0078, 0x3341, 0x2001, 0x0029, 0x2009, - 0x0000, 0xa005, 0x127f, 0x007c, 0x6944, 0xa1b4, 0x00ff, 0xa682, - 0x0010, 0x00c8, 0x3386, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff, - 0x00c8, 0x3376, 0xa188, 0x6e00, 0x2104, 0xa065, 0x0040, 0x3376, - 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x337c, 0x684c, - 0xd0ec, 0x0040, 0x3369, 0x1078, 0x3507, 0x1078, 0x33a1, 0x0078, - 0x3371, 0x1078, 0x33a1, 0x684c, 0xd0fc, 0x0040, 0x3371, 0x1078, - 0x34f0, 0x1078, 0x351b, 0xa006, 0x0078, 0x338a, 0x2001, 0x0028, - 0x2009, 0x0000, 0x0078, 0x338a, 0xa082, 0x0006, 0x0048, 0x335f, - 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x338a, 0x2001, 0x0029, - 0x2009, 0x0000, 0xa005, 0x007c, 0x127e, 0x2091, 0x8000, 0x6050, - 0xa00d, 0x0040, 0x339a, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, - 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078, - 0x3398, 0x127e, 0x2091, 0x8000, 0x604c, 0xa005, 0x0040, 0x33ad, - 0x6802, 0x2d00, 0x604e, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, - 0x6803, 0x0000, 0x0078, 0x33ab, 0x127e, 0x2091, 0x8000, 0x604c, - 0xa06d, 0x0040, 0x33c2, 0x6800, 0xa005, 0x00c0, 0x33c0, 0x6052, - 0x604e, 0xad05, 0x127f, 0x007c, 0x604c, 0xa06d, 0x0040, 0x33cf, - 0x6800, 0xa005, 0x00c0, 0x33cd, 0x6052, 0x604e, 0xad05, 0x007c, - 0x6803, 0x0000, 0x6084, 0xa00d, 0x0040, 0x33da, 0x2d00, 0x200a, - 0x6086, 0x007c, 0x2d00, 0x6086, 0x6082, 0x0078, 0x33d9, 0x127e, - 0x0c7e, 0x027e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6200, 0xa005, - 0x0040, 0x33ed, 0xc285, 0x0078, 0x33ee, 0xc284, 0x6202, 0x027f, - 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, - 0x2260, 0x6204, 0xa294, 0xff00, 0xa215, 0x6206, 0x0c7f, 0x127f, + 0x5582, 0x2071, 0x0140, 0x7004, 0xa084, 0x4000, 0x0040, 0x35b4, + 0x7003, 0x1000, 0x7003, 0x0000, 0x2001, 0x0001, 0x1078, 0x202b, + 0x1078, 0x357b, 0x127f, 0x007f, 0x0e7f, 0x007c, 0x20a9, 0x0040, + 0x20a1, 0x7cc0, 0x2099, 0x7b8e, 0x3304, 0x8007, 0x20a2, 0x9398, + 0x94a0, 0x00f0, 0x35c4, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, + 0x2099, 0x7b00, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, + 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7b80, 0x20a1, 0x020b, + 0x20a9, 0x000c, 0x53a6, 0x007c, 0x0c7e, 0x007e, 0x2061, 0x0100, + 0x810f, 0x2001, 0x762c, 0x2004, 0xa005, 0x00c0, 0x35f5, 0x6030, + 0xa084, 0x00ff, 0xa105, 0x0078, 0x35f7, 0xa185, 0x00f7, 0x604a, + 0x007f, 0x0c7f, 0x007c, 0x017e, 0x047e, 0x2001, 0x7652, 0x2004, + 0xd0a4, 0x0040, 0x360e, 0xa006, 0x2020, 0x2009, 0x002a, 0x1078, + 0x7541, 0x2001, 0x760c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, + 0x1078, 0x2299, 0x047f, 0x017f, 0x007c, 0x157e, 0x20a9, 0x00ff, + 0x2009, 0x7720, 0xa006, 0x200a, 0x8108, 0x00f0, 0x361b, 0x157f, + 0x007c, 0x0d7e, 0x037e, 0x157e, 0x137e, 0x147e, 0x2069, 0x7651, + 0xa006, 0x6002, 0x6007, 0x0707, 0x600a, 0x600e, 0x6012, 0xa198, + 0x232f, 0x231c, 0xa39c, 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98, + 0x0006, 0x23a0, 0x40a4, 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0, + 0x40a4, 0x603e, 0x6042, 0x604e, 0x6052, 0x6056, 0x605a, 0x605e, + 0x6062, 0x6066, 0x606a, 0x606e, 0x6072, 0x6076, 0x607a, 0x607e, + 0x6082, 0x6086, 0x608a, 0x608e, 0x6092, 0x6096, 0x609a, 0x609e, + 0x61a2, 0x604a, 0x6810, 0x603a, 0x680c, 0x6046, 0x6814, 0xa084, + 0x00ff, 0x6042, 0x147f, 0x137f, 0x157f, 0x037f, 0x0d7f, 0x007c, + 0x127e, 0x2091, 0x8000, 0x6944, 0xa1b4, 0x00ff, 0xa682, 0x0010, + 0x00c8, 0x3715, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff, 0x00c8, + 0x371b, 0x2001, 0x760c, 0x2004, 0xa084, 0x0003, 0x00c0, 0x36fe, + 0xa188, 0x7720, 0x2104, 0xa065, 0x0040, 0x36ec, 0x6004, 0xa084, + 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x36f2, 0x6078, 0xa00d, 0x0040, + 0x3697, 0xa680, 0x75d5, 0x2004, 0xa10c, 0x00c0, 0x36e6, 0x607c, + 0xa00d, 0x0040, 0x36b3, 0xa680, 0x75d5, 0x2004, 0xa10c, 0x0040, + 0x36b3, 0x694c, 0xd1fc, 0x00c0, 0x36a9, 0x1078, 0x37ae, 0x0078, + 0x36e1, 0x1078, 0x377f, 0x694c, 0xd1ec, 0x00c0, 0x36e1, 0x1078, + 0x38c7, 0x0078, 0x36e1, 0x694c, 0xa184, 0xa000, 0x0040, 0x36d1, + 0xd1ec, 0x0040, 0x36ca, 0xd1fc, 0x0040, 0x36c2, 0x1078, 0x38de, + 0x0078, 0x36cd, 0xa680, 0x75d5, 0x200c, 0x607c, 0xa105, 0x607e, + 0x0078, 0x36d1, 0xd1fc, 0x0040, 0x36d1, 0x1078, 0x377f, 0x0078, + 0x36e1, 0x6050, 0xa00d, 0x0040, 0x36dc, 0x2d00, 0x200a, 0x6803, + 0x0000, 0x6052, 0x0078, 0x36e1, 0x2d00, 0x6052, 0x604e, 0x6803, + 0x0000, 0x1078, 0x4844, 0xa006, 0x127f, 0x007c, 0x2001, 0x0005, + 0x2009, 0x0000, 0x0078, 0x371f, 0x2001, 0x0028, 0x2009, 0x0000, + 0x0078, 0x371f, 0xa082, 0x0006, 0x00c8, 0x36fe, 0x60a0, 0xd0bc, + 0x0040, 0x368d, 0x2001, 0x0028, 0x0078, 0x3711, 0x2009, 0x760c, + 0x210c, 0xd18c, 0x0040, 0x3708, 0x2001, 0x0004, 0x0078, 0x3711, + 0xd184, 0x0040, 0x370f, 0x2001, 0x0004, 0x0078, 0x3711, 0x2001, + 0x0029, 0x2009, 0x0000, 0x0078, 0x371f, 0x2001, 0x0029, 0x2009, + 0x0000, 0x0078, 0x371f, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, + 0x127f, 0x007c, 0x6944, 0xa1b4, 0x00ff, 0xa682, 0x0010, 0x00c8, + 0x3764, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff, 0x00c8, 0x3754, + 0xa188, 0x7720, 0x2104, 0xa065, 0x0040, 0x3754, 0x6004, 0xa084, + 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x375a, 0x684c, 0xd0ec, 0x0040, + 0x3747, 0x1078, 0x38de, 0x1078, 0x377f, 0x0078, 0x374f, 0x1078, + 0x377f, 0x684c, 0xd0fc, 0x0040, 0x374f, 0x1078, 0x38c7, 0x1078, + 0x38f2, 0xa006, 0x0078, 0x3768, 0x2001, 0x0028, 0x2009, 0x0000, + 0x0078, 0x3768, 0xa082, 0x0006, 0x0048, 0x373d, 0x2001, 0x0029, + 0x2009, 0x0000, 0x0078, 0x3768, 0x2001, 0x0029, 0x2009, 0x0000, + 0xa005, 0x007c, 0x127e, 0x2091, 0x8000, 0x6050, 0xa00d, 0x0040, + 0x3778, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x127f, 0x007c, + 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x3776, 0x127e, + 0x2091, 0x8000, 0x604c, 0xa005, 0x0040, 0x378b, 0x6802, 0x2d00, + 0x604e, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, + 0x0078, 0x3789, 0x127e, 0x2091, 0x8000, 0x604c, 0xa06d, 0x0040, + 0x37a0, 0x6800, 0xa005, 0x00c0, 0x379e, 0x6052, 0x604e, 0xad05, + 0x127f, 0x007c, 0x604c, 0xa06d, 0x0040, 0x37ad, 0x6800, 0xa005, + 0x00c0, 0x37ab, 0x6052, 0x604e, 0xad05, 0x007c, 0x6803, 0x0000, + 0x6084, 0xa00d, 0x0040, 0x37b8, 0x2d00, 0x200a, 0x6086, 0x007c, + 0x2d00, 0x6086, 0x6082, 0x0078, 0x37b7, 0x127e, 0x0c7e, 0x027e, + 0x2091, 0x8000, 0x6218, 0x2260, 0x6200, 0xa005, 0x0040, 0x37cb, + 0xc285, 0x0078, 0x37cc, 0xc284, 0x6202, 0x027f, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, - 0xa294, 0x00ff, 0x8007, 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c, - 0x027e, 0xa182, 0x00ff, 0x0048, 0x3419, 0xa085, 0x0001, 0x0078, - 0x342d, 0xa190, 0x6e00, 0x2204, 0xa065, 0x00c0, 0x342c, 0x017e, - 0x0d7e, 0x1078, 0x12f4, 0x2d60, 0x0d7f, 0x017f, 0x0040, 0x3415, - 0x2c00, 0x2012, 0x1078, 0x3256, 0xa006, 0x027f, 0x007c, 0x027e, - 0xa182, 0x00ff, 0x0048, 0x3438, 0xa085, 0x0001, 0x0078, 0x3445, - 0x0d7e, 0xa190, 0x6e00, 0x2204, 0xa06d, 0x0040, 0x3443, 0x2013, - 0x0000, 0x1078, 0x1328, 0x0d7f, 0xa006, 0x027f, 0x007c, 0x017e, - 0xa182, 0x00ff, 0x0048, 0x3450, 0xa085, 0x0001, 0x0078, 0x3457, - 0xa188, 0x6e00, 0x2104, 0xa065, 0x0040, 0x344c, 0xa006, 0x017f, - 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x600b, 0x0000, 0x600f, - 0x0000, 0x6000, 0xc08c, 0x6002, 0x2069, 0x728e, 0x6808, 0x605e, - 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048, 0x346f, 0x603a, 0x6814, - 0x6066, 0x2099, 0x7296, 0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004, - 0x53a3, 0x2099, 0x729a, 0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004, - 0x53a3, 0x2069, 0x72ae, 0x6904, 0xa18c, 0x00ff, 0x810f, 0x6808, - 0xa084, 0x00ff, 0xa105, 0x606a, 0x690c, 0x616e, 0x6810, 0x6072, - 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8, 0x349a, 0x2009, 0x0008, - 0x0078, 0x34c4, 0xa182, 0x0259, 0x00c8, 0x34a2, 0x2009, 0x0007, - 0x0078, 0x34c4, 0xa182, 0x02c1, 0x00c8, 0x34aa, 0x2009, 0x0006, - 0x0078, 0x34c4, 0xa182, 0x0349, 0x00c8, 0x34b2, 0x2009, 0x0005, - 0x0078, 0x34c4, 0xa182, 0x0421, 0x00c8, 0x34ba, 0x2009, 0x0004, - 0x0078, 0x34c4, 0xa182, 0x0581, 0x00c8, 0x34c2, 0x2009, 0x0003, - 0x0078, 0x34c4, 0x2009, 0x0002, 0x6192, 0x147f, 0x137f, 0x157f, - 0x0d7f, 0x007c, 0x0e7e, 0x2071, 0x728d, 0x2e04, 0x6896, 0x2071, - 0x728e, 0x7004, 0x689a, 0x701c, 0x689e, 0x0e7f, 0x007c, 0x2001, - 0x6c84, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x6178, 0xa10d, - 0x617a, 0x127f, 0x007c, 0x2001, 0x6c84, 0xa600, 0x2004, 0x8002, - 0x127e, 0x2091, 0x8000, 0x6178, 0xa10c, 0x617a, 0x127f, 0x007c, - 0x2001, 0x6c84, 0xa600, 0x2004, 0x8002, 0x127e, 0x2091, 0x8000, - 0x617c, 0xa10c, 0x617e, 0x127f, 0x0078, 0x3500, 0x1078, 0x338c, - 0x1078, 0x3561, 0x00c0, 0x34fe, 0x1078, 0x351b, 0x007c, 0x2001, - 0x6c84, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x617c, 0xa10d, - 0x617e, 0x127f, 0x0078, 0x3516, 0x1078, 0x33d0, 0x1078, 0x3525, - 0x00c0, 0x3514, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4346, - 0x127f, 0x007c, 0xa01e, 0x0078, 0x3527, 0x2019, 0x0001, 0xa00e, - 0x127e, 0x2091, 0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc, 0x00c0, - 0x3547, 0x8dff, 0x0040, 0x355c, 0x83ff, 0x0040, 0x353f, 0x6844, - 0xa084, 0x00ff, 0xa606, 0x0040, 0x354c, 0x0078, 0x3547, 0x683c, - 0xa406, 0x00c0, 0x3547, 0x6840, 0xa506, 0x0040, 0x354c, 0x2d08, - 0x6800, 0x2068, 0x0078, 0x3531, 0x6a00, 0x604c, 0xad06, 0x00c0, - 0x3554, 0x624e, 0x0078, 0x3557, 0xa180, 0x0000, 0x2202, 0x82ff, - 0x00c0, 0x355c, 0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e, 0x0078, - 0x3563, 0x2019, 0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff, 0x0040, - 0x3591, 0x83ff, 0x0040, 0x3574, 0x6844, 0xa084, 0x00ff, 0xa606, - 0x0040, 0x3581, 0x0078, 0x357c, 0x683c, 0xa406, 0x00c0, 0x357c, - 0x6840, 0xa506, 0x0040, 0x3581, 0x2d08, 0x6800, 0x2068, 0x0078, - 0x3566, 0x6a00, 0x6080, 0xad06, 0x00c0, 0x3589, 0x6282, 0x0078, - 0x358c, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x3591, 0x6186, - 0x8dff, 0x007c, 0x2001, 0x6c84, 0xa600, 0x2004, 0x6178, 0xa10c, - 0x0040, 0x359c, 0x2011, 0x0001, 0x617c, 0xa10c, 0x0040, 0x35a2, - 0xa295, 0x0002, 0x007c, 0x1078, 0x35ec, 0x0040, 0x35ab, 0x1078, - 0x61f8, 0x0078, 0x35ad, 0xa085, 0x0001, 0x007c, 0x1078, 0x35ec, - 0x0040, 0x35b6, 0x1078, 0x6187, 0x0078, 0x35b8, 0xa085, 0x0001, - 0x007c, 0x1078, 0x35ec, 0x0040, 0x35c1, 0x1078, 0x61cd, 0x0078, - 0x35c3, 0xa085, 0x0001, 0x007c, 0x1078, 0x35ec, 0x0040, 0x35cc, - 0x1078, 0x61a3, 0x0078, 0x35ce, 0xa085, 0x0001, 0x007c, 0x127e, - 0x007e, 0x0d7e, 0x2091, 0x8000, 0x6080, 0xa06d, 0x0040, 0x35e4, - 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, - 0x36a1, 0x007f, 0x0078, 0x35d5, 0x6083, 0x0000, 0x6087, 0x0000, - 0x0d7f, 0x007f, 0x127f, 0x007c, 0x609c, 0xd0a4, 0x007c, 0x0f7e, - 0x2079, 0x6d51, 0x7804, 0xd0a4, 0x0040, 0x3618, 0x157e, 0x0c7e, - 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x3447, 0x00c0, - 0x360c, 0x6004, 0xa084, 0xff00, 0x8007, 0xa086, 0x0006, 0x00c0, - 0x360c, 0x6000, 0xc0ed, 0x6002, 0x017f, 0x8108, 0x00f0, 0x35fc, - 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011, 0x361a, 0x1078, 0x415f, - 0x0f7f, 0x007c, 0x2011, 0x361a, 0x1078, 0x40d1, 0x157e, 0x0c7e, - 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x3447, 0x00c0, - 0x3646, 0x6000, 0xd0ec, 0x0040, 0x3646, 0x047e, 0x62a0, 0xa294, - 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029, 0x1078, 0x6bf7, 0x6000, - 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029, 0x1078, 0x445c, 0x1078, - 0x43a9, 0x2009, 0x0000, 0x1078, 0x6a57, 0x047f, 0x017f, 0x8108, - 0x00f0, 0x3624, 0x0c7f, 0x157f, 0x007c, 0x0c7e, 0x6018, 0x2060, - 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c, 0x2071, 0x6ddf, 0x7003, - 0x0001, 0x7007, 0x0000, 0x7013, 0x0000, 0x7017, 0x0000, 0x701b, - 0x0000, 0x701f, 0x0000, 0x704b, 0x0001, 0x704f, 0x0000, 0x705b, - 0x0020, 0x705f, 0x0040, 0x707f, 0x0000, 0x007c, 0x0e7e, 0x2071, - 0x6ddf, 0x684c, 0xa005, 0x00c0, 0x367c, 0x7028, 0xc085, 0x702a, - 0xa085, 0x0001, 0x0078, 0x369f, 0x6a60, 0x7236, 0x6b64, 0x733a, - 0x6868, 0x703e, 0x7076, 0x686c, 0x7042, 0x707a, 0x684c, 0x702e, - 0x6844, 0x7032, 0x2009, 0x000d, 0x200a, 0x8007, 0x8006, 0x8006, - 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x726e, - 0x7372, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0xa006, 0x0e7f, - 0x007c, 0x0e7e, 0x6838, 0xd0fc, 0x00c0, 0x36f2, 0x6804, 0xa00d, - 0x0040, 0x36c0, 0x0d7e, 0x0e7e, 0x2071, 0x6d00, 0x027e, 0xa016, - 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x00c0, - 0x36b1, 0x702e, 0x70a0, 0xa200, 0x70a2, 0x027f, 0x0e7f, 0x0d7f, - 0x2071, 0x6ddf, 0x701c, 0xa005, 0x00c0, 0x3703, 0x0068, 0x3701, - 0x2071, 0x6d51, 0x7004, 0xd09c, 0x0040, 0x3701, 0x6934, 0xa186, - 0x0103, 0x00c0, 0x3714, 0x6948, 0x6844, 0xa105, 0x00c0, 0x36f4, - 0x2009, 0x8020, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x3701, - 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, - 0x4080, 0x2071, 0x6d00, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70a0, - 0x8000, 0x70a2, 0x0e7f, 0x007c, 0x6844, 0xa086, 0x0100, 0x00c0, - 0x3701, 0x6868, 0xa005, 0x00c0, 0x3701, 0x2009, 0x8020, 0x0078, - 0x36da, 0x2071, 0x6ddf, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000, - 0x7012, 0x7018, 0xa06d, 0x711a, 0x0040, 0x3711, 0x6902, 0x0078, - 0x3712, 0x711e, 0x0078, 0x36f2, 0xa18c, 0x00ff, 0xa18e, 0x0017, - 0x0040, 0x371e, 0xa18e, 0x001f, 0x00c0, 0x3701, 0x684c, 0xd0cc, - 0x0040, 0x3701, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, - 0x3701, 0x2009, 0x8021, 0x0078, 0x36da, 0x007e, 0x6837, 0x0103, - 0x20a9, 0x001c, 0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4, - 0x007f, 0x684a, 0x6952, 0x007c, 0x2071, 0x6ddf, 0x7004, 0x0079, - 0x3741, 0x3749, 0x3758, 0x37e4, 0x37e5, 0x37f5, 0x37fb, 0x374a, - 0x37d2, 0x007c, 0x127e, 0x2091, 0x8000, 0x0068, 0x3757, 0x2009, - 0x000d, 0x7030, 0x200a, 0x2091, 0x4080, 0x7007, 0x0001, 0x127f, - 0x701c, 0xa06d, 0x0040, 0x37d1, 0x0e7e, 0x2071, 0x6d51, 0x7004, - 0xd09c, 0x0040, 0x37b3, 0x6934, 0xa186, 0x0103, 0x00c0, 0x378d, - 0x6948, 0x6844, 0xa105, 0x00c0, 0x37a6, 0x2009, 0x8020, 0x127e, - 0x2091, 0x8000, 0x0068, 0x3789, 0x2071, 0x0000, 0x7018, 0xd084, - 0x00c0, 0x3789, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, - 0x0001, 0x2091, 0x4080, 0x127f, 0x0e7f, 0x1078, 0x382e, 0x0078, - 0x37d1, 0x127f, 0x0e7f, 0x0078, 0x37d1, 0xa18c, 0x00ff, 0xa18e, - 0x0017, 0x0040, 0x3797, 0xa18e, 0x001f, 0x00c0, 0x37b3, 0x684c, - 0xd0cc, 0x0040, 0x37b3, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, - 0x00c0, 0x37b3, 0x2009, 0x8021, 0x0078, 0x376f, 0x6844, 0xa086, - 0x0100, 0x00c0, 0x37b3, 0x6868, 0xa005, 0x00c0, 0x37b3, 0x2009, - 0x8020, 0x0078, 0x376f, 0x0e7f, 0x1078, 0x3842, 0x0040, 0x37d1, - 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, 0x00c0, - 0x37c8, 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0040, 0x37c8, 0x710e, - 0x7007, 0x0003, 0x1078, 0x3862, 0x7050, 0xa086, 0x0100, 0x0040, - 0x37e5, 0x007c, 0x701c, 0xa06d, 0x0040, 0x37e3, 0x1078, 0x3842, - 0x0040, 0x37e3, 0x7007, 0x0003, 0x1078, 0x3862, 0x7050, 0xa086, - 0x0100, 0x0040, 0x37e5, 0x007c, 0x007c, 0x7050, 0xa09e, 0x0100, - 0x00c0, 0x37ee, 0x7007, 0x0004, 0x0078, 0x37f5, 0xa086, 0x0200, - 0x00c0, 0x37f4, 0x7007, 0x0005, 0x007c, 0x1078, 0x37fc, 0x7006, - 0x1078, 0x382e, 0x007c, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, - 0x0048, 0x3809, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, 0x0078, - 0x3813, 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x3813, 0x7070, - 0xa081, 0x0000, 0x7072, 0x7132, 0x700c, 0x8001, 0x700e, 0x00c0, - 0x3827, 0x127e, 0x2091, 0x8000, 0x0068, 0x382a, 0x2001, 0x000d, - 0x2102, 0x2091, 0x4080, 0x2001, 0x0001, 0x127f, 0x007c, 0x2001, - 0x0007, 0x007c, 0x2001, 0x0006, 0x127f, 0x007c, 0x701c, 0xa06d, - 0x0040, 0x3841, 0x127e, 0x2091, 0x8000, 0x7010, 0x8001, 0x7012, - 0x2d04, 0x701e, 0xa005, 0x00c0, 0x383e, 0x701a, 0x127f, 0x1078, - 0x1328, 0x007c, 0x2019, 0x000d, 0x2304, 0x230c, 0xa10e, 0x0040, - 0x3851, 0x2304, 0x230c, 0xa10e, 0x0040, 0x3851, 0xa006, 0x0078, - 0x3861, 0x732c, 0x8319, 0x7130, 0xa102, 0x00c0, 0x385b, 0x2300, - 0xa005, 0x0078, 0x3861, 0x0048, 0x3860, 0xa302, 0x0078, 0x3861, - 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080, 0x000d, 0x7056, 0x7053, - 0x0000, 0x127e, 0x2091, 0x8000, 0x2009, 0x6f31, 0x2104, 0xc08d, - 0x200a, 0x127f, 0x1078, 0x1379, 0x007c, 0x2071, 0x6dad, 0x7003, - 0x0000, 0x7007, 0x0000, 0x700f, 0x0000, 0x702b, 0x0001, 0x704f, - 0x0000, 0x7053, 0x0001, 0x705f, 0x0020, 0x7063, 0x0040, 0x7083, - 0x0000, 0x708b, 0x0000, 0x708f, 0x0001, 0x70bf, 0x0000, 0x007c, - 0x0e7e, 0x2071, 0x6dad, 0x6848, 0xa005, 0x00c0, 0x389e, 0x7028, - 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x38c3, 0x6a50, 0x7236, - 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a, 0x685c, 0x7042, 0x707e, - 0x6848, 0x702e, 0x6840, 0x7032, 0x2009, 0x000c, 0x200a, 0x8007, - 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, - 0xa319, 0x7272, 0x7376, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, - 0x700f, 0x0000, 0xa006, 0x0e7f, 0x007c, 0x2b78, 0x2071, 0x6dad, - 0x7004, 0x1079, 0x3923, 0x700c, 0x0079, 0x38ce, 0x38d3, 0x38c8, - 0x38c8, 0x38c8, 0x38c8, 0x007c, 0x700c, 0x0079, 0x38d7, 0x38dc, - 0x3921, 0x3921, 0x3922, 0x3922, 0x7830, 0x7930, 0xa106, 0x0040, - 0x38e6, 0x7830, 0x7930, 0xa106, 0x00c0, 0x390c, 0x7030, 0xa10a, - 0x0040, 0x390c, 0x00c8, 0x38ee, 0x712c, 0xa10a, 0xa18a, 0x0002, - 0x00c8, 0x390d, 0x1078, 0x12f4, 0x0040, 0x390c, 0x2d00, 0x705a, - 0x7063, 0x0040, 0x2001, 0x0003, 0x7057, 0x0000, 0x127e, 0x007e, - 0x2091, 0x8000, 0x2009, 0x6f31, 0x2104, 0xc085, 0x200a, 0x007f, - 0x700e, 0x127f, 0x1078, 0x1379, 0x007c, 0x1078, 0x12f4, 0x0040, - 0x390c, 0x2d00, 0x705a, 0x1078, 0x12f4, 0x00c0, 0x3919, 0x0078, - 0x38f8, 0x2d00, 0x7086, 0x7063, 0x0080, 0x2001, 0x0004, 0x0078, - 0x38fc, 0x007c, 0x007c, 0x3934, 0x3935, 0x396c, 0x396d, 0x3921, - 0x39a3, 0x39a8, 0x39df, 0x39e0, 0x39fb, 0x39fc, 0x39fd, 0x39fe, - 0x39ff, 0x3a00, 0x3a69, 0x3a93, 0x007c, 0x700c, 0x0079, 0x3938, - 0x393d, 0x3940, 0x3950, 0x396b, 0x396b, 0x1078, 0x38d4, 0x007c, - 0x127e, 0x8001, 0x700e, 0x7058, 0x007e, 0x1078, 0x3d52, 0x0040, - 0x394d, 0x2091, 0x8000, 0x1078, 0x38d4, 0x0d7f, 0x0078, 0x3959, - 0x127e, 0x8001, 0x700e, 0x1078, 0x3d52, 0x7058, 0x2068, 0x7084, - 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, - 0xa08a, 0x0020, 0x00c8, 0x3968, 0x1079, 0x3983, 0x127f, 0x007c, - 0x127f, 0x1078, 0x3a01, 0x007c, 0x007c, 0x007c, 0x0e7e, 0x2071, - 0x6dad, 0x700c, 0x0079, 0x3974, 0x3979, 0x3979, 0x3979, 0x397b, - 0x397f, 0x0e7f, 0x007c, 0x700f, 0x0001, 0x0078, 0x3981, 0x700f, - 0x0002, 0x0e7f, 0x007c, 0x3a01, 0x3a01, 0x3a1d, 0x3a01, 0x3aff, - 0x3a01, 0x3a01, 0x3a01, 0x3a01, 0x3a01, 0x3a1d, 0x3b44, 0x3b8d, - 0x3be5, 0x3bf8, 0x3a01, 0x3a01, 0x3a39, 0x3a1d, 0x3a01, 0x3a01, - 0x3a4f, 0x3c74, 0x3c91, 0x3a01, 0x3a39, 0x3a01, 0x3a01, 0x3a01, - 0x3a01, 0x3a01, 0x3c91, 0x7020, 0x2068, 0x1078, 0x1328, 0x007c, - 0x700c, 0x0079, 0x39ab, 0x39b0, 0x39b3, 0x39c3, 0x39de, 0x39de, - 0x1078, 0x38d4, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e, - 0x1078, 0x3d52, 0x0040, 0x39c0, 0x2091, 0x8000, 0x1078, 0x38d4, - 0x0d7f, 0x0078, 0x39cc, 0x127e, 0x8001, 0x700e, 0x1078, 0x3d52, - 0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, - 0x6834, 0xa084, 0x00ff, 0xa08a, 0x001a, 0x00c8, 0x39db, 0x1079, - 0x39e1, 0x127f, 0x007c, 0x127f, 0x1078, 0x3a01, 0x007c, 0x007c, - 0x007c, 0x3a01, 0x3a1d, 0x3ae9, 0x3a01, 0x3a1d, 0x3a01, 0x3a1d, - 0x3a1d, 0x3a01, 0x3a1d, 0x3ae9, 0x3a1d, 0x3a1d, 0x3a1d, 0x3a1d, - 0x3a1d, 0x3a01, 0x3a1d, 0x3ae9, 0x3a01, 0x3a01, 0x3a1d, 0x3a01, - 0x3a01, 0x3a01, 0x3a1d, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, - 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0d5, 0x683a, - 0x127e, 0x2091, 0x8000, 0x1078, 0x36a1, 0x127f, 0x007c, 0x7007, - 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5, 0x683a, 0x127e, 0x2091, - 0x8000, 0x1078, 0x36a1, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, - 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, - 0x36a1, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, - 0xc0dd, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x36a1, 0x127f, - 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3a0f, 0x8001, - 0x00c0, 0x3a46, 0x7007, 0x0001, 0x0078, 0x3ac8, 0x7007, 0x0006, - 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x3ac8, 0x007c, 0x2d00, - 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1, - 0x6dd8, 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x00c8, 0x3a2b, - 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3a2b, 0xa080, 0x3ab9, 0x2004, - 0x70c6, 0x7010, 0xa015, 0x0040, 0x3ab3, 0x1078, 0x12f4, 0x00c0, - 0x3a74, 0x7007, 0x000f, 0x007c, 0x2d00, 0x7022, 0x70c4, 0x2060, - 0x6000, 0x6836, 0x6004, 0xad00, 0x7096, 0x6008, 0xa20a, 0x00c8, - 0x3a83, 0xa00e, 0x2200, 0x7112, 0x620c, 0x8003, 0x800b, 0xa296, - 0x0004, 0x0040, 0x3a8c, 0xa108, 0x719a, 0x810b, 0x719e, 0xae90, - 0x0022, 0x1078, 0x135f, 0x7090, 0xa08e, 0x0100, 0x0040, 0x3aa7, - 0xa086, 0x0200, 0x0040, 0x3a9f, 0x7007, 0x0010, 0x007c, 0x7020, - 0x2068, 0x1078, 0x1328, 0x7014, 0x2068, 0x0078, 0x3a2b, 0x7020, - 0x2068, 0x7018, 0x6802, 0x6807, 0x0000, 0x2d08, 0x2068, 0x6906, - 0x711a, 0x0078, 0x3a69, 0x7014, 0x2068, 0x7007, 0x0001, 0x0078, - 0x3ac8, 0x3abc, 0x3ac0, 0x3ac4, 0x0002, 0x0011, 0x0007, 0x0004, + 0xa294, 0xff00, 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c, 0x127e, + 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, 0xa294, 0x00ff, + 0x8007, 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c, 0x027e, 0xa182, + 0x00ff, 0x0048, 0x37f7, 0xa085, 0x0001, 0x0078, 0x380b, 0xa190, + 0x7720, 0x2204, 0xa065, 0x00c0, 0x380a, 0x017e, 0x0d7e, 0x1078, + 0x1314, 0x2d60, 0x0d7f, 0x017f, 0x0040, 0x37f3, 0x2c00, 0x2012, + 0x1078, 0x3621, 0xa006, 0x027f, 0x007c, 0x027e, 0xa182, 0x00ff, + 0x0048, 0x3816, 0xa085, 0x0001, 0x0078, 0x3823, 0x0d7e, 0xa190, + 0x7720, 0x2204, 0xa06d, 0x0040, 0x3821, 0x2013, 0x0000, 0x1078, + 0x1348, 0x0d7f, 0xa006, 0x027f, 0x007c, 0x017e, 0xa182, 0x00ff, + 0x0048, 0x382e, 0xa085, 0x0001, 0x0078, 0x3835, 0xa188, 0x7720, + 0x2104, 0xa065, 0x0040, 0x382a, 0xa006, 0x017f, 0x007c, 0x0d7e, + 0x157e, 0x137e, 0x147e, 0x600b, 0x0000, 0x600f, 0x0000, 0x6000, + 0xc08c, 0x6002, 0x2069, 0x7b8e, 0x6808, 0x605e, 0x6810, 0x6062, + 0x6138, 0xa10a, 0x0048, 0x384d, 0x603a, 0x6814, 0x6066, 0x2099, + 0x7b96, 0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2099, + 0x7b9a, 0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2069, + 0x7bae, 0x6808, 0x606a, 0x690c, 0x616e, 0x6810, 0x6072, 0x6818, + 0x6076, 0xa182, 0x0211, 0x00c8, 0x3871, 0x2009, 0x0008, 0x0078, + 0x389b, 0xa182, 0x0259, 0x00c8, 0x3879, 0x2009, 0x0007, 0x0078, + 0x389b, 0xa182, 0x02c1, 0x00c8, 0x3881, 0x2009, 0x0006, 0x0078, + 0x389b, 0xa182, 0x0349, 0x00c8, 0x3889, 0x2009, 0x0005, 0x0078, + 0x389b, 0xa182, 0x0421, 0x00c8, 0x3891, 0x2009, 0x0004, 0x0078, + 0x389b, 0xa182, 0x0581, 0x00c8, 0x3899, 0x2009, 0x0003, 0x0078, + 0x389b, 0x2009, 0x0002, 0x6192, 0x147f, 0x137f, 0x157f, 0x0d7f, + 0x007c, 0x0e7e, 0x2071, 0x7b8d, 0x2e04, 0x6896, 0x2071, 0x7b8e, + 0x7004, 0x689a, 0x701c, 0x689e, 0x0e7f, 0x007c, 0x2001, 0x75d5, + 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x6178, 0xa10d, 0x617a, + 0x127f, 0x007c, 0x2001, 0x75d5, 0xa600, 0x2004, 0x8002, 0x127e, + 0x2091, 0x8000, 0x6178, 0xa10c, 0x617a, 0x127f, 0x007c, 0x2001, + 0x75d5, 0xa600, 0x2004, 0x8002, 0x127e, 0x2091, 0x8000, 0x617c, + 0xa10c, 0x617e, 0x127f, 0x0078, 0x38d7, 0x1078, 0x376a, 0x1078, + 0x3938, 0x00c0, 0x38d5, 0x1078, 0x38f2, 0x007c, 0x2001, 0x75d5, + 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x617c, 0xa10d, 0x617e, + 0x127f, 0x0078, 0x38ed, 0x1078, 0x37ae, 0x1078, 0x38fc, 0x00c0, + 0x38eb, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4844, 0x127f, + 0x007c, 0xa01e, 0x0078, 0x38fe, 0x2019, 0x0001, 0xa00e, 0x127e, + 0x2091, 0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc, 0x00c0, 0x391e, + 0x8dff, 0x0040, 0x3933, 0x83ff, 0x0040, 0x3916, 0x6844, 0xa084, + 0x00ff, 0xa606, 0x0040, 0x3923, 0x0078, 0x391e, 0x683c, 0xa406, + 0x00c0, 0x391e, 0x6840, 0xa506, 0x0040, 0x3923, 0x2d08, 0x6800, + 0x2068, 0x0078, 0x3908, 0x6a00, 0x604c, 0xad06, 0x00c0, 0x392b, + 0x624e, 0x0078, 0x392e, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, + 0x3933, 0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e, 0x0078, 0x393a, + 0x2019, 0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff, 0x0040, 0x3968, + 0x83ff, 0x0040, 0x394b, 0x6844, 0xa084, 0x00ff, 0xa606, 0x0040, + 0x3958, 0x0078, 0x3953, 0x683c, 0xa406, 0x00c0, 0x3953, 0x6840, + 0xa506, 0x0040, 0x3958, 0x2d08, 0x6800, 0x2068, 0x0078, 0x393d, + 0x6a00, 0x6080, 0xad06, 0x00c0, 0x3960, 0x6282, 0x0078, 0x3963, + 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x3968, 0x6186, 0x8dff, + 0x007c, 0x2001, 0x75d5, 0xa600, 0x2004, 0x6178, 0xa10c, 0x0040, + 0x3973, 0x2011, 0x0001, 0x617c, 0xa10c, 0x0040, 0x3979, 0xa295, + 0x0002, 0x007c, 0x1078, 0x39c5, 0x0040, 0x3982, 0x1078, 0x6a16, + 0x0078, 0x3984, 0xa085, 0x0001, 0x007c, 0x1078, 0x39c5, 0x0040, + 0x398d, 0x1078, 0x69a5, 0x0078, 0x398f, 0xa085, 0x0001, 0x007c, + 0x1078, 0x39c5, 0x0040, 0x3998, 0x1078, 0x69eb, 0x0078, 0x399a, + 0xa085, 0x0001, 0x007c, 0x1078, 0x39c5, 0x0040, 0x39a3, 0x1078, + 0x69c1, 0x0078, 0x39a5, 0xa085, 0x0001, 0x007c, 0x127e, 0x007e, + 0x0d7e, 0x2091, 0x8000, 0x6080, 0xa06d, 0x0040, 0x39bd, 0x6800, + 0x007e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x6b3f, + 0x1078, 0x3a7a, 0x007f, 0x0078, 0x39ac, 0x6083, 0x0000, 0x6087, + 0x0000, 0x0d7f, 0x007f, 0x127f, 0x007c, 0x609c, 0xd0a4, 0x007c, + 0x0f7e, 0x2079, 0x7651, 0x7804, 0xd0a4, 0x0040, 0x39f1, 0x157e, + 0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x3825, + 0x00c0, 0x39e5, 0x6004, 0xa084, 0xff00, 0x8007, 0xa086, 0x0006, + 0x00c0, 0x39e5, 0x6000, 0xc0ed, 0x6002, 0x017f, 0x8108, 0x00f0, + 0x39d5, 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011, 0x39f3, 0x1078, + 0x45fe, 0x0f7f, 0x007c, 0x2011, 0x39f3, 0x1078, 0x456e, 0x157e, + 0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x3825, + 0x00c0, 0x3a1f, 0x6000, 0xd0ec, 0x0040, 0x3a1f, 0x047e, 0x62a0, + 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029, 0x1078, 0x7541, + 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029, 0x1078, 0x4962, + 0x1078, 0x48a5, 0x2009, 0x0000, 0x1078, 0x737b, 0x047f, 0x017f, + 0x8108, 0x00f0, 0x39fd, 0x0c7f, 0x157f, 0x007c, 0x0c7e, 0x6018, + 0x2060, 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c, 0x2071, 0x76ff, + 0x7003, 0x0001, 0x7007, 0x0000, 0x7013, 0x0000, 0x7017, 0x0000, + 0x701b, 0x0000, 0x701f, 0x0000, 0x704b, 0x0001, 0x704f, 0x0000, + 0x705b, 0x0020, 0x705f, 0x0040, 0x707f, 0x0000, 0x007c, 0x0e7e, + 0x2071, 0x76ff, 0x684c, 0xa005, 0x00c0, 0x3a55, 0x7028, 0xc085, + 0x702a, 0xa085, 0x0001, 0x0078, 0x3a78, 0x6a60, 0x7236, 0x6b64, + 0x733a, 0x6868, 0x703e, 0x7076, 0x686c, 0x7042, 0x707a, 0x684c, + 0x702e, 0x6844, 0x7032, 0x2009, 0x000d, 0x200a, 0x8007, 0x8006, + 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, + 0x726e, 0x7372, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0xa006, + 0x0e7f, 0x007c, 0x0e7e, 0x6838, 0xd0fc, 0x00c0, 0x3acb, 0x6804, + 0xa00d, 0x0040, 0x3a99, 0x0d7e, 0x0e7e, 0x2071, 0x7600, 0x027e, + 0xa016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, + 0x00c0, 0x3a8a, 0x702e, 0x70a0, 0xa200, 0x70a2, 0x027f, 0x0e7f, + 0x0d7f, 0x2071, 0x76ff, 0x701c, 0xa005, 0x00c0, 0x3adc, 0x0068, + 0x3ada, 0x2071, 0x7651, 0x7004, 0xd09c, 0x0040, 0x3ada, 0x6934, + 0xa186, 0x0103, 0x00c0, 0x3aed, 0x6948, 0x6844, 0xa105, 0x00c0, + 0x3acd, 0x2009, 0x8020, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, + 0x3ada, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, + 0x2091, 0x4080, 0x2071, 0x7600, 0x702c, 0x206a, 0x2d00, 0x702e, + 0x70a0, 0x8000, 0x70a2, 0x0e7f, 0x007c, 0x6844, 0xa086, 0x0100, + 0x00c0, 0x3ada, 0x6868, 0xa005, 0x00c0, 0x3ada, 0x2009, 0x8020, + 0x0078, 0x3ab3, 0x2071, 0x76ff, 0x2d08, 0x206b, 0x0000, 0x7010, + 0x8000, 0x7012, 0x7018, 0xa06d, 0x711a, 0x0040, 0x3aea, 0x6902, + 0x0078, 0x3aeb, 0x711e, 0x0078, 0x3acb, 0xa18c, 0x00ff, 0xa186, + 0x0017, 0x0040, 0x3afb, 0xa186, 0x001e, 0x0040, 0x3afb, 0xa18e, + 0x001f, 0x00c0, 0x3ada, 0x684c, 0xd0cc, 0x0040, 0x3ada, 0x6850, + 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3ada, 0x2009, 0x8021, + 0x0078, 0x3ab3, 0x007e, 0x6837, 0x0103, 0x20a9, 0x001c, 0xad80, + 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x007f, 0x684a, 0x6952, + 0x007c, 0x2071, 0x76ff, 0x7004, 0x0079, 0x3b1e, 0x3b26, 0x3b35, + 0x3bc5, 0x3bc6, 0x3bd6, 0x3bdc, 0x3b27, 0x3bb3, 0x007c, 0x127e, + 0x2091, 0x8000, 0x0068, 0x3b34, 0x2009, 0x000d, 0x7030, 0x200a, + 0x2091, 0x4080, 0x7007, 0x0001, 0x127f, 0x701c, 0xa06d, 0x0040, + 0x3bb2, 0x0e7e, 0x2071, 0x7651, 0x7004, 0xd09c, 0x0040, 0x3b94, + 0x6934, 0xa186, 0x0103, 0x00c0, 0x3b6a, 0x6948, 0x6844, 0xa105, + 0x00c0, 0x3b87, 0x2009, 0x8020, 0x127e, 0x2091, 0x8000, 0x0068, + 0x3b66, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x3b66, 0x7122, + 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080, + 0x127f, 0x0e7f, 0x1078, 0x3c0f, 0x0078, 0x3bb2, 0x127f, 0x0e7f, + 0x0078, 0x3bb2, 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0040, 0x3b78, + 0xa186, 0x001e, 0x0040, 0x3b78, 0xa18e, 0x001f, 0x00c0, 0x3b94, + 0x684c, 0xd0cc, 0x0040, 0x3b94, 0x6850, 0xa084, 0x00ff, 0xa086, + 0x0001, 0x00c0, 0x3b94, 0x2009, 0x8021, 0x0078, 0x3b4c, 0x6844, + 0xa086, 0x0100, 0x00c0, 0x3b94, 0x6868, 0xa005, 0x00c0, 0x3b94, + 0x2009, 0x8020, 0x0078, 0x3b4c, 0x0e7f, 0x1078, 0x3c23, 0x0040, + 0x3bb2, 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, + 0x00c0, 0x3ba9, 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0040, 0x3ba9, + 0x710e, 0x7007, 0x0003, 0x1078, 0x3c43, 0x7050, 0xa086, 0x0100, + 0x0040, 0x3bc6, 0x007c, 0x701c, 0xa06d, 0x0040, 0x3bc4, 0x1078, + 0x3c23, 0x0040, 0x3bc4, 0x7007, 0x0003, 0x1078, 0x3c43, 0x7050, + 0xa086, 0x0100, 0x0040, 0x3bc6, 0x007c, 0x007c, 0x7050, 0xa09e, + 0x0100, 0x00c0, 0x3bcf, 0x7007, 0x0004, 0x0078, 0x3bd6, 0xa086, + 0x0200, 0x00c0, 0x3bd5, 0x7007, 0x0005, 0x007c, 0x1078, 0x3bdd, + 0x7006, 0x1078, 0x3c0f, 0x007c, 0x007c, 0x702c, 0x7130, 0x8108, + 0xa102, 0x0048, 0x3bea, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, + 0x0078, 0x3bf4, 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x3bf4, + 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c, 0x8001, 0x700e, + 0x00c0, 0x3c08, 0x127e, 0x2091, 0x8000, 0x0068, 0x3c0b, 0x2001, + 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001, 0x127f, 0x007c, + 0x2001, 0x0007, 0x007c, 0x2001, 0x0006, 0x127f, 0x007c, 0x701c, + 0xa06d, 0x0040, 0x3c22, 0x127e, 0x2091, 0x8000, 0x7010, 0x8001, + 0x7012, 0x2d04, 0x701e, 0xa005, 0x00c0, 0x3c1f, 0x701a, 0x127f, + 0x1078, 0x1348, 0x007c, 0x2019, 0x000d, 0x2304, 0x230c, 0xa10e, + 0x0040, 0x3c32, 0x2304, 0x230c, 0xa10e, 0x0040, 0x3c32, 0xa006, + 0x0078, 0x3c42, 0x732c, 0x8319, 0x7130, 0xa102, 0x00c0, 0x3c3c, + 0x2300, 0xa005, 0x0078, 0x3c42, 0x0048, 0x3c41, 0xa302, 0x0078, + 0x3c42, 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080, 0x000d, 0x7056, + 0x7053, 0x0000, 0x127e, 0x2091, 0x8000, 0x2009, 0x7859, 0x2104, + 0xc08d, 0x200a, 0x127f, 0x1078, 0x1399, 0x007c, 0x2071, 0x76cd, + 0x7003, 0x0000, 0x7007, 0x0000, 0x700f, 0x0000, 0x702b, 0x0001, + 0x704f, 0x0000, 0x7053, 0x0001, 0x705f, 0x0020, 0x7063, 0x0040, + 0x7083, 0x0000, 0x708b, 0x0000, 0x708f, 0x0001, 0x70bf, 0x0000, + 0x007c, 0x0e7e, 0x2071, 0x76cd, 0x6848, 0xa005, 0x00c0, 0x3c7f, + 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x3ca4, 0x6a50, + 0x7236, 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a, 0x685c, 0x7042, + 0x707e, 0x6848, 0x702e, 0x6840, 0x7032, 0x2009, 0x000c, 0x200a, + 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, + 0x2100, 0xa319, 0x7272, 0x7376, 0x7028, 0xc084, 0x702a, 0x7007, + 0x0001, 0x700f, 0x0000, 0xa006, 0x0e7f, 0x007c, 0x2b78, 0x2071, + 0x76cd, 0x7004, 0x1079, 0x3d04, 0x700c, 0x0079, 0x3caf, 0x3cb4, + 0x3ca9, 0x3ca9, 0x3ca9, 0x3ca9, 0x007c, 0x700c, 0x0079, 0x3cb8, + 0x3cbd, 0x3d02, 0x3d02, 0x3d03, 0x3d03, 0x7830, 0x7930, 0xa106, + 0x0040, 0x3cc7, 0x7830, 0x7930, 0xa106, 0x00c0, 0x3ced, 0x7030, + 0xa10a, 0x0040, 0x3ced, 0x00c8, 0x3ccf, 0x712c, 0xa10a, 0xa18a, + 0x0002, 0x00c8, 0x3cee, 0x1078, 0x1314, 0x0040, 0x3ced, 0x2d00, + 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, 0x7057, 0x0000, 0x127e, + 0x007e, 0x2091, 0x8000, 0x2009, 0x7859, 0x2104, 0xc085, 0x200a, + 0x007f, 0x700e, 0x127f, 0x1078, 0x1399, 0x007c, 0x1078, 0x1314, + 0x0040, 0x3ced, 0x2d00, 0x705a, 0x1078, 0x1314, 0x00c0, 0x3cfa, + 0x0078, 0x3cd9, 0x2d00, 0x7086, 0x7063, 0x0080, 0x2001, 0x0004, + 0x0078, 0x3cdd, 0x007c, 0x007c, 0x3d15, 0x3d16, 0x3d4d, 0x3d4e, + 0x3d02, 0x3d84, 0x3d89, 0x3dc0, 0x3dc1, 0x3ddc, 0x3ddd, 0x3dde, + 0x3ddf, 0x3de0, 0x3de1, 0x3e4a, 0x3e74, 0x007c, 0x700c, 0x0079, + 0x3d19, 0x3d1e, 0x3d21, 0x3d31, 0x3d4c, 0x3d4c, 0x1078, 0x3cb5, + 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e, 0x1078, 0x4153, + 0x0040, 0x3d2e, 0x2091, 0x8000, 0x1078, 0x3cb5, 0x0d7f, 0x0078, + 0x3d3a, 0x127e, 0x8001, 0x700e, 0x1078, 0x4153, 0x7058, 0x2068, + 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, + 0x00ff, 0xa08a, 0x0020, 0x00c8, 0x3d49, 0x1079, 0x3d64, 0x127f, + 0x007c, 0x127f, 0x1078, 0x3de2, 0x007c, 0x007c, 0x007c, 0x0e7e, + 0x2071, 0x76cd, 0x700c, 0x0079, 0x3d55, 0x3d5a, 0x3d5a, 0x3d5a, + 0x3d5c, 0x3d60, 0x0e7f, 0x007c, 0x700f, 0x0001, 0x0078, 0x3d62, + 0x700f, 0x0002, 0x0e7f, 0x007c, 0x3de2, 0x3de2, 0x3dfe, 0x3de2, + 0x3ee9, 0x3de2, 0x3de2, 0x3de2, 0x3de2, 0x3de2, 0x3dfe, 0x3f2e, + 0x3f77, 0x3fcf, 0x3fe2, 0x3de2, 0x3de2, 0x3e1a, 0x3dfe, 0x3de2, + 0x3de2, 0x3e30, 0x4069, 0x4086, 0x3de2, 0x3e1a, 0x3de2, 0x3de2, + 0x3de2, 0x3de2, 0x3e30, 0x4086, 0x7020, 0x2068, 0x1078, 0x1348, + 0x007c, 0x700c, 0x0079, 0x3d8c, 0x3d91, 0x3d94, 0x3da4, 0x3dbf, + 0x3dbf, 0x1078, 0x3cb5, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, + 0x007e, 0x1078, 0x4153, 0x0040, 0x3da1, 0x2091, 0x8000, 0x1078, + 0x3cb5, 0x0d7f, 0x0078, 0x3dad, 0x127e, 0x8001, 0x700e, 0x1078, + 0x4153, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, + 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a, 0x001a, 0x00c8, 0x3dbc, + 0x1079, 0x3dc2, 0x127f, 0x007c, 0x127f, 0x1078, 0x3de2, 0x007c, + 0x007c, 0x007c, 0x3de2, 0x3dfe, 0x3ed3, 0x3de2, 0x3dfe, 0x3de2, + 0x3dfe, 0x3dfe, 0x3de2, 0x3dfe, 0x3ed3, 0x3dfe, 0x3dfe, 0x3dfe, + 0x3dfe, 0x3dfe, 0x3de2, 0x3dfe, 0x3ed3, 0x3de2, 0x3de2, 0x3dfe, + 0x3de2, 0x3de2, 0x3de2, 0x3dfe, 0x007c, 0x007c, 0x007c, 0x007c, + 0x007c, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0d5, + 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3a7a, 0x127f, 0x007c, + 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5, 0x683a, 0x127e, + 0x2091, 0x8000, 0x1078, 0x3a7a, 0x127f, 0x007c, 0x7007, 0x0001, + 0x6838, 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x127e, 0x2091, 0x8000, + 0x1078, 0x3a7a, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, + 0x00ff, 0xc0dd, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3a7a, + 0x127f, 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3df0, + 0x8001, 0x00c0, 0x3e27, 0x7007, 0x0001, 0x0078, 0x3eb0, 0x7007, + 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x3eb0, 0x007c, + 0x2d00, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, + 0x20a1, 0x76f8, 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x00c8, + 0x3e0c, 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3e0c, 0xa080, 0x3ea1, + 0x2004, 0x70c6, 0x7010, 0xa015, 0x0040, 0x3e94, 0x1078, 0x1314, + 0x00c0, 0x3e55, 0x7007, 0x000f, 0x007c, 0x2d00, 0x7022, 0x70c4, + 0x2060, 0x6000, 0x6836, 0x6004, 0xad00, 0x7096, 0x6008, 0xa20a, + 0x00c8, 0x3e64, 0xa00e, 0x2200, 0x7112, 0x620c, 0x8003, 0x800b, + 0xa296, 0x0004, 0x0040, 0x3e6d, 0xa108, 0x719a, 0x810b, 0x719e, + 0xae90, 0x0022, 0x1078, 0x137f, 0x7090, 0xa08e, 0x0100, 0x0040, + 0x3e88, 0xa086, 0x0200, 0x0040, 0x3e80, 0x7007, 0x0010, 0x007c, + 0x7020, 0x2068, 0x1078, 0x1348, 0x7014, 0x2068, 0x0078, 0x3e0c, + 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000, 0x2d08, 0x2068, + 0x6906, 0x711a, 0x0078, 0x3e4a, 0x7014, 0x2068, 0x7007, 0x0001, + 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x0040, 0x40a3, 0x0078, + 0x3eb0, 0x3ea4, 0x3ea8, 0x3eac, 0x0002, 0x0011, 0x0007, 0x0004, 0x000a, 0x000f, 0x0005, 0x0006, 0x0012, 0x000f, 0x0005, 0x0006, - 0x2009, 0x6d2c, 0x210c, 0x81ff, 0x00c0, 0x3ae3, 0x6838, 0xa084, - 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x3299, 0x00c0, 0x3ad9, - 0x007c, 0x1078, 0x372d, 0x127e, 0x2091, 0x8000, 0x1078, 0x36a1, - 0x127f, 0x0078, 0x3ad8, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, - 0x3ad9, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a, 0x7010, - 0x8001, 0x7012, 0x0040, 0x3af8, 0x7007, 0x0006, 0x0078, 0x3afe, - 0x7014, 0x2068, 0x7007, 0x0001, 0x7048, 0x107a, 0x007c, 0x7007, - 0x0001, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848, 0xa084, 0x00ff, - 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x3b2a, 0x2009, 0x0000, - 0x20a9, 0x007e, 0xa096, 0x0002, 0x0040, 0x3b2a, 0xa005, 0x00c0, - 0x3b41, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x3447, 0x00c0, - 0x3b41, 0x067e, 0x6e44, 0xa6b4, 0x000f, 0x1078, 0x34e3, 0x067f, - 0x0078, 0x3b41, 0x047e, 0x2011, 0x6d0c, 0x2224, 0xc484, 0xc48c, - 0x2412, 0x047f, 0x0c7e, 0x1078, 0x3447, 0x00c0, 0x3b3d, 0x2091, - 0x8000, 0x607b, 0x0000, 0x2091, 0x8001, 0x8108, 0x00f0, 0x3b33, - 0x0c7f, 0x1078, 0x1328, 0x007c, 0x127e, 0x2091, 0x8000, 0x7007, - 0x0001, 0x2001, 0x6d52, 0x2004, 0xd0a4, 0x0040, 0x3b84, 0x6944, - 0x1078, 0x3d6e, 0x6100, 0xd184, 0x0040, 0x3b69, 0x6858, 0xa084, - 0x00ff, 0x00c0, 0x3b87, 0x6000, 0xd084, 0x0040, 0x3b84, 0x6004, - 0xa005, 0x00c0, 0x3b8a, 0x6003, 0x0000, 0x600b, 0x0000, 0x0078, - 0x3b81, 0x2011, 0x0001, 0x6860, 0xa005, 0x00c0, 0x3b71, 0x2001, - 0x001e, 0x8000, 0x6016, 0x6858, 0xa084, 0x00ff, 0x0040, 0x3b84, - 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3b84, 0x600a, - 0x6202, 0x127f, 0x0078, 0x3d41, 0x127f, 0x0078, 0x3d39, 0x127f, - 0x0078, 0x3d31, 0x127f, 0x0078, 0x3d35, 0x127e, 0x2091, 0x8000, - 0x7007, 0x0001, 0x2001, 0x6d52, 0x2004, 0xd0a4, 0x0040, 0x3be2, - 0x6944, 0x1078, 0x3d6e, 0x6000, 0xa084, 0x0001, 0x0040, 0x3be2, - 0x6204, 0x6308, 0x6c48, 0xa484, 0x0003, 0x0040, 0x3bba, 0x6958, - 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x3bb3, 0x2100, 0xa210, 0x0048, - 0x3bdf, 0x0078, 0x3bba, 0x8001, 0x00c0, 0x3bdf, 0x2100, 0xa212, - 0x0048, 0x3bdf, 0xa484, 0x000c, 0x0040, 0x3bd4, 0x6958, 0x810f, - 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0, 0x3bcc, 0x2100, 0xa318, - 0x0048, 0x3bdf, 0x0078, 0x3bd4, 0xa082, 0x0004, 0x00c0, 0x3bdf, - 0x2100, 0xa31a, 0x0048, 0x3bdf, 0x6860, 0xa005, 0x0040, 0x3bda, - 0x8000, 0x6016, 0x6206, 0x630a, 0x127f, 0x0078, 0x3d41, 0x127f, - 0x0078, 0x3d3d, 0x127f, 0x0078, 0x3d39, 0x127e, 0x2091, 0x8000, - 0x7007, 0x0001, 0x6944, 0x1078, 0x3d6e, 0x6308, 0x8318, 0x0048, - 0x3bf5, 0x630a, 0x127f, 0x0078, 0x3d4f, 0x127f, 0x0078, 0x3d3d, - 0x127e, 0x0c7e, 0x2091, 0x8000, 0x7007, 0x0001, 0x684c, 0xd0ac, - 0x0040, 0x3c0c, 0x027e, 0x2009, 0x0000, 0x2011, 0xfcff, 0x1078, - 0x41f4, 0x027f, 0x0078, 0x3c42, 0x6858, 0xa005, 0x0040, 0x3c56, - 0x685c, 0xa065, 0x0040, 0x3c52, 0x2001, 0x6d2c, 0x2004, 0xa005, - 0x0040, 0x3c1e, 0x1078, 0x6283, 0x0078, 0x3c24, 0x6013, 0x0400, - 0x2009, 0x0041, 0x1078, 0x5591, 0x6958, 0xa18c, 0xe600, 0xa186, - 0x2000, 0x0040, 0x3c3a, 0xa186, 0x0400, 0x0040, 0x3c3a, 0x6944, - 0x0c7e, 0x1078, 0x416d, 0x6000, 0xa084, 0xfdff, 0x6002, 0x0c7f, - 0x0078, 0x3c42, 0x027e, 0x2009, 0x0000, 0x2011, 0xfdff, 0x1078, - 0x41f4, 0x027f, 0x684c, 0xd0c4, 0x0040, 0x3c4e, 0x6944, 0x1078, - 0x416d, 0x6008, 0x8000, 0x0048, 0x3c4e, 0x600a, 0x0c7f, 0x127f, - 0x0078, 0x3d41, 0x0c7f, 0x127f, 0x0078, 0x3d39, 0x6954, 0xa186, - 0x0020, 0x0040, 0x3c6c, 0xa186, 0x0029, 0x00c0, 0x3c52, 0x6944, - 0xa18c, 0xff00, 0x810f, 0x1078, 0x3447, 0x00c0, 0x3c42, 0x6000, - 0xc0e4, 0x6002, 0x0078, 0x3c42, 0x685c, 0xa065, 0x0040, 0x3c52, - 0x6017, 0x0014, 0x0078, 0x3c42, 0x6944, 0x1078, 0x3d6e, 0x6000, - 0xa084, 0x0001, 0x0040, 0x3c8d, 0x2091, 0x8000, 0x6204, 0x8210, - 0x0048, 0x3c87, 0x6206, 0x2091, 0x8001, 0x0078, 0x3d4f, 0x2091, - 0x8001, 0x6853, 0x0016, 0x0078, 0x3d48, 0x6853, 0x0007, 0x0078, - 0x3d48, 0x6834, 0x8007, 0xa084, 0x00ff, 0x00c0, 0x3c9b, 0x1078, - 0x3a0f, 0x0078, 0x3cad, 0x2030, 0x8001, 0x00c0, 0x3ca5, 0x7007, - 0x0001, 0x1078, 0x3cae, 0x0078, 0x3cad, 0x7007, 0x0006, 0x7012, - 0x2d00, 0x7016, 0x701a, 0x704b, 0x3cae, 0x007c, 0x0e7e, 0x2009, - 0x6d2c, 0x210c, 0x81ff, 0x00c0, 0x3d28, 0x6848, 0x2070, 0xae82, - 0x7400, 0x0048, 0x3d18, 0x2001, 0x6d15, 0x2004, 0xae02, 0x00c8, - 0x3d18, 0x6944, 0x1078, 0x3d6e, 0x6100, 0xa184, 0x0001, 0x0040, - 0x3cfe, 0xa184, 0x0100, 0x00c0, 0x3d1c, 0xa184, 0x0200, 0x00c0, - 0x3d20, 0x601c, 0xa005, 0x00c0, 0x3d24, 0x711c, 0xa186, 0x0006, - 0x00c0, 0x3d03, 0x6853, 0x0000, 0x6803, 0x0000, 0x2d08, 0x127e, - 0x2091, 0x8000, 0x7010, 0xa005, 0x00c0, 0x3cf5, 0x7112, 0x7018, - 0xa065, 0x0040, 0x3d28, 0x6000, 0xd0e4, 0x00c0, 0x3d2c, 0x2e60, - 0x1078, 0x4176, 0x127f, 0x0e7f, 0x007c, 0x2068, 0x6800, 0xa005, - 0x00c0, 0x3cf5, 0x6902, 0x127f, 0x0e7f, 0x007c, 0x0e7f, 0x6853, - 0x0006, 0x0078, 0x3d48, 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078, - 0x3447, 0x00c0, 0x3d2c, 0x6000, 0xd0e4, 0x00c0, 0x3d2c, 0x711c, - 0xa186, 0x0007, 0x00c0, 0x3d18, 0x6853, 0x0002, 0x0078, 0x3d2e, - 0x6853, 0x0008, 0x0078, 0x3d2e, 0x6853, 0x000e, 0x0078, 0x3d2e, - 0x6853, 0x0017, 0x0078, 0x3d2e, 0x6853, 0x0035, 0x0078, 0x3d2e, - 0x6853, 0x0028, 0x0078, 0x3d2e, 0x6853, 0x0029, 0x0e7f, 0x0078, - 0x3d48, 0x2009, 0x003e, 0x0078, 0x3d43, 0x2009, 0x0004, 0x0078, - 0x3d43, 0x2009, 0x0006, 0x0078, 0x3d43, 0x2009, 0x0016, 0x0078, - 0x3d43, 0x2009, 0x0001, 0x6854, 0xa084, 0xff00, 0xa105, 0x6856, - 0x2091, 0x8000, 0x1078, 0x36a1, 0x2091, 0x8001, 0x007c, 0x1078, - 0x1328, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048, 0x3d5f, - 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076, 0x0078, 0x3d6b, 0x7070, - 0xa080, 0x0040, 0x7072, 0x00c8, 0x3d6b, 0x7074, 0xa081, 0x0000, - 0x7076, 0xa085, 0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e, 0x1078, - 0x416d, 0x0d7f, 0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204, 0xa085, - 0x8002, 0x2012, 0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08, 0x20e1, - 0x2000, 0x3d00, 0xa084, 0x7000, 0x0040, 0x3d8a, 0xa086, 0x1000, - 0x00c0, 0x3dab, 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0, 0x3d91, - 0x3e60, 0xac84, 0x0007, 0x00c0, 0x3dab, 0xac82, 0x7400, 0x0048, - 0x3dab, 0x6854, 0xac02, 0x00c8, 0x3dab, 0x2009, 0x0047, 0x1078, - 0x5591, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x7a28, 0x7a1c, 0xd284, - 0x00c0, 0x3d7c, 0x007c, 0xa016, 0x1078, 0x1532, 0x0078, 0x3da1, - 0x157e, 0x137e, 0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584, - 0x0070, 0x00c0, 0x3dd9, 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0, - 0x3dd9, 0x1078, 0x3de6, 0x0040, 0x3dd9, 0x20e1, 0x3000, 0x7828, - 0x7828, 0x1078, 0x3e04, 0x147f, 0x137f, 0x157f, 0x2009, 0x6f18, - 0x2104, 0xa005, 0x00c0, 0x3dd5, 0x007c, 0x1078, 0x476a, 0x0078, - 0x3dd4, 0x1078, 0x6c23, 0x1078, 0x3de6, 0x20e1, 0x3000, 0x7828, - 0x7828, 0x147f, 0x137f, 0x157f, 0x0078, 0x3dd4, 0xa484, 0x01ff, - 0x687a, 0xa005, 0x0040, 0x3df8, 0xa080, 0x001f, 0xa084, 0x03f8, - 0x80ac, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x007c, - 0x20a9, 0x000c, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, - 0xa085, 0x0001, 0x0078, 0x3df7, 0x7000, 0xa084, 0xff00, 0xa08c, - 0xf000, 0x8007, 0xa196, 0x0000, 0x00c0, 0x3e11, 0x0078, 0x3f51, - 0x007c, 0xa196, 0x2000, 0x00c0, 0x3e22, 0x6900, 0xa18e, 0x0001, - 0x00c0, 0x3e1e, 0x1078, 0x2aec, 0x0078, 0x3e10, 0x1078, 0x3e2a, - 0x0078, 0x3e10, 0xa196, 0x8000, 0x00c0, 0x3e10, 0x1078, 0x3fd7, - 0x0078, 0x3e10, 0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa196, - 0x0001, 0x0040, 0x3e37, 0xa196, 0x0023, 0x00c0, 0x3ef8, 0xa08e, - 0x0023, 0x00c0, 0x3e68, 0x1078, 0x404e, 0x0040, 0x3ef8, 0x7124, - 0x610a, 0x7030, 0xa08e, 0x0200, 0x00c0, 0x3e50, 0x7034, 0xa005, - 0x00c0, 0x3ef8, 0x2009, 0x0015, 0x1078, 0x5591, 0x0078, 0x3ef8, - 0xa08e, 0x0210, 0x00c0, 0x3e5a, 0x2009, 0x0015, 0x1078, 0x5591, - 0x0078, 0x3ef8, 0xa08e, 0x0100, 0x00c0, 0x3ef8, 0x7034, 0xa005, - 0x00c0, 0x3ef8, 0x2009, 0x0016, 0x1078, 0x5591, 0x0078, 0x3ef8, - 0xa08e, 0x0022, 0x00c0, 0x3ef8, 0x7030, 0xa08e, 0x0300, 0x00c0, - 0x3e79, 0x7034, 0xa005, 0x00c0, 0x3ef8, 0x2009, 0x0017, 0x0078, - 0x3eda, 0xa08e, 0x0500, 0x00c0, 0x3e85, 0x7034, 0xa005, 0x00c0, - 0x3ef8, 0x2009, 0x0018, 0x0078, 0x3eda, 0xa08e, 0x2010, 0x00c0, - 0x3e8d, 0x2009, 0x0019, 0x0078, 0x3eda, 0xa08e, 0x2110, 0x00c0, - 0x3e95, 0x2009, 0x001a, 0x0078, 0x3eda, 0xa08e, 0x5200, 0x00c0, - 0x3ea1, 0x7034, 0xa005, 0x00c0, 0x3ef8, 0x2009, 0x001b, 0x0078, - 0x3eda, 0xa08e, 0x5000, 0x00c0, 0x3ead, 0x7034, 0xa005, 0x00c0, - 0x3ef8, 0x2009, 0x001c, 0x0078, 0x3eda, 0xa08e, 0x2400, 0x00c0, - 0x3eb3, 0x0078, 0x3ed8, 0xa08e, 0x5300, 0x00c0, 0x3eb9, 0x0078, - 0x3ed8, 0xa08e, 0x0f00, 0x00c0, 0x3ec1, 0x2009, 0x0020, 0x0078, - 0x3eda, 0xa08e, 0x5300, 0x00c0, 0x3ec7, 0x0078, 0x3ed8, 0xa08e, - 0x6104, 0x00c0, 0x3ed8, 0x2009, 0x728e, 0x2011, 0x8015, 0x211c, - 0x8108, 0x2124, 0x1078, 0x2a53, 0x2009, 0x0023, 0x0078, 0x3eda, - 0x2009, 0x001d, 0x017e, 0x2011, 0x7283, 0x2204, 0x8211, 0x220c, - 0x1078, 0x1e1b, 0x00c0, 0x3efa, 0x1078, 0x3410, 0x00c0, 0x3efa, - 0x6612, 0x6516, 0x0c7e, 0x1078, 0x5504, 0x0040, 0x3efd, 0x017f, - 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x017f, 0x1078, 0x5591, - 0x0c7f, 0x007c, 0x017f, 0x0078, 0x3ef8, 0x0c7f, 0x0078, 0x3efa, - 0x0e7e, 0x0d7e, 0x2028, 0x2130, 0xa696, 0x00ff, 0x00c0, 0x3f20, - 0xa596, 0xfffd, 0x00c0, 0x3f10, 0x2009, 0x007f, 0x0078, 0x3f4d, - 0xa596, 0xfffe, 0x00c0, 0x3f18, 0x2009, 0x007e, 0x0078, 0x3f4d, - 0xa596, 0xfffc, 0x00c0, 0x3f20, 0x2009, 0x0080, 0x0078, 0x3f4d, - 0x2011, 0x0000, 0x2021, 0x007e, 0x20a9, 0x0082, 0x2071, 0x6e7e, - 0x2e1c, 0x83ff, 0x00c0, 0x3f32, 0x82ff, 0x00c0, 0x3f41, 0x2410, - 0x0078, 0x3f41, 0x2368, 0x6b10, 0x007e, 0x2100, 0xa31e, 0x007f, - 0x00c0, 0x3f41, 0x6b14, 0xa31e, 0x00c0, 0x3f41, 0x2408, 0x0078, - 0x3f4d, 0x8420, 0x8e70, 0x00f0, 0x3f28, 0x82ff, 0x00c0, 0x3f4c, - 0xa085, 0x0001, 0x0078, 0x3f4e, 0x2208, 0xa006, 0x0d7f, 0x0e7f, - 0x007c, 0xa084, 0x0007, 0x0079, 0x3f56, 0x007c, 0x3f5e, 0x3f5e, - 0x3f5e, 0x3f5e, 0x3f5e, 0x3f5f, 0x3f78, 0x3fc0, 0x007c, 0x7110, - 0xd1bc, 0x0040, 0x3f77, 0x7120, 0x2160, 0xac8c, 0x0007, 0x00c0, - 0x3f77, 0xac8a, 0x7400, 0x0048, 0x3f77, 0x6854, 0xac02, 0x00c8, - 0x3f77, 0x7124, 0x610a, 0x2009, 0x0046, 0x1078, 0x5591, 0x007c, - 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x3fbe, 0x2011, 0x7283, 0x2204, - 0x8211, 0x220c, 0x1078, 0x1e1b, 0x00c0, 0x3fbe, 0x1078, 0x3447, - 0x00c0, 0x3fbe, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, - 0x00c0, 0x3fa3, 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040, 0x3fbe, + 0x2009, 0x762c, 0x210c, 0x81ff, 0x00c0, 0x3ecd, 0x6838, 0xa084, + 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x3668, 0x00c0, 0x3ec1, + 0x007c, 0x1078, 0x3b0a, 0x127e, 0x2091, 0x8000, 0x1078, 0x6b3f, + 0x1078, 0x3a7a, 0x127f, 0x0078, 0x3ec0, 0x2001, 0x0028, 0x2009, + 0x0000, 0x0078, 0x3ec1, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, + 0x711a, 0x7010, 0x8001, 0x7012, 0x0040, 0x3ee2, 0x7007, 0x0006, + 0x0078, 0x3ee8, 0x7014, 0x2068, 0x7007, 0x0001, 0x7048, 0x107a, + 0x007c, 0x7007, 0x0001, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848, + 0xa084, 0x00ff, 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x3f14, + 0x2009, 0x0000, 0x20a9, 0x007e, 0xa096, 0x0002, 0x0040, 0x3f14, + 0xa005, 0x00c0, 0x3f2b, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078, + 0x3825, 0x00c0, 0x3f2b, 0x067e, 0x6e44, 0xa6b4, 0x000f, 0x1078, + 0x38ba, 0x067f, 0x0078, 0x3f2b, 0x047e, 0x2011, 0x760c, 0x2224, + 0xc484, 0xc48c, 0x2412, 0x047f, 0x0c7e, 0x1078, 0x3825, 0x00c0, + 0x3f27, 0x2091, 0x8000, 0x607b, 0x0000, 0x2091, 0x8001, 0x8108, + 0x00f0, 0x3f1d, 0x0c7f, 0x1078, 0x1348, 0x007c, 0x127e, 0x2091, + 0x8000, 0x7007, 0x0001, 0x2001, 0x7652, 0x2004, 0xd0a4, 0x0040, + 0x3f6e, 0x6944, 0x1078, 0x416f, 0x6100, 0xd184, 0x0040, 0x3f53, + 0x6858, 0xa084, 0x00ff, 0x00c0, 0x3f71, 0x6000, 0xd084, 0x0040, + 0x3f6e, 0x6004, 0xa005, 0x00c0, 0x3f74, 0x6003, 0x0000, 0x600b, + 0x0000, 0x0078, 0x3f6b, 0x2011, 0x0001, 0x6860, 0xa005, 0x00c0, + 0x3f5b, 0x2001, 0x001e, 0x8000, 0x6016, 0x6858, 0xa084, 0x00ff, + 0x0040, 0x3f6e, 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff, 0x0040, + 0x3f6e, 0x600a, 0x6202, 0x127f, 0x0078, 0x4142, 0x127f, 0x0078, + 0x413a, 0x127f, 0x0078, 0x4132, 0x127f, 0x0078, 0x4136, 0x127e, + 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x7652, 0x2004, 0xd0a4, + 0x0040, 0x3fcc, 0x6944, 0x1078, 0x416f, 0x6000, 0xa084, 0x0001, + 0x0040, 0x3fcc, 0x6204, 0x6308, 0x6c48, 0xa484, 0x0003, 0x0040, + 0x3fa4, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x3f9d, 0x2100, + 0xa210, 0x0048, 0x3fc9, 0x0078, 0x3fa4, 0x8001, 0x00c0, 0x3fc9, + 0x2100, 0xa212, 0x0048, 0x3fc9, 0xa484, 0x000c, 0x0040, 0x3fbe, + 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0, 0x3fb6, + 0x2100, 0xa318, 0x0048, 0x3fc9, 0x0078, 0x3fbe, 0xa082, 0x0004, + 0x00c0, 0x3fc9, 0x2100, 0xa31a, 0x0048, 0x3fc9, 0x6860, 0xa005, + 0x0040, 0x3fc4, 0x8000, 0x6016, 0x6206, 0x630a, 0x127f, 0x0078, + 0x4142, 0x127f, 0x0078, 0x413e, 0x127f, 0x0078, 0x413a, 0x127e, + 0x2091, 0x8000, 0x7007, 0x0001, 0x6944, 0x1078, 0x416f, 0x6308, + 0x8318, 0x0048, 0x3fdf, 0x630a, 0x127f, 0x0078, 0x4150, 0x127f, + 0x0078, 0x413e, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x7007, 0x0001, + 0x684c, 0xd0ac, 0x0040, 0x3ff6, 0x027e, 0x2009, 0x0000, 0x2011, + 0xfcff, 0x1078, 0x46b4, 0x027f, 0x0078, 0x402c, 0x6858, 0xa005, + 0x0040, 0x4040, 0x685c, 0xa065, 0x0040, 0x403c, 0x2001, 0x762c, + 0x2004, 0xa005, 0x0040, 0x4008, 0x1078, 0x6aa1, 0x0078, 0x400e, + 0x6013, 0x0400, 0x2009, 0x0041, 0x1078, 0x5c29, 0x6958, 0xa18c, + 0xe600, 0xa186, 0x2000, 0x0040, 0x4024, 0xa186, 0x0400, 0x0040, + 0x4024, 0x6944, 0x0c7e, 0x1078, 0x460c, 0x6000, 0xa084, 0xfdff, + 0x6002, 0x0c7f, 0x0078, 0x402c, 0x027e, 0x2009, 0x0000, 0x2011, + 0xfdff, 0x1078, 0x46b4, 0x027f, 0x684c, 0xd0c4, 0x0040, 0x4038, + 0x6944, 0x1078, 0x460c, 0x6008, 0x8000, 0x0048, 0x4038, 0x600a, + 0x0c7f, 0x127f, 0x0078, 0x4142, 0x0c7f, 0x127f, 0x0078, 0x413a, + 0x6954, 0xa186, 0x002a, 0x00c0, 0x404c, 0x2001, 0x760c, 0x200c, + 0xc194, 0x2102, 0x0078, 0x402c, 0xa186, 0x0020, 0x0040, 0x4061, + 0xa186, 0x0029, 0x00c0, 0x403c, 0x6944, 0xa18c, 0xff00, 0x810f, + 0x1078, 0x3825, 0x00c0, 0x402c, 0x6000, 0xc0e4, 0x6002, 0x0078, + 0x402c, 0x685c, 0xa065, 0x0040, 0x403c, 0x6017, 0x0014, 0x0078, + 0x402c, 0x6944, 0x1078, 0x416f, 0x6000, 0xa084, 0x0001, 0x0040, + 0x4082, 0x2091, 0x8000, 0x6204, 0x8210, 0x0048, 0x407c, 0x6206, + 0x2091, 0x8001, 0x0078, 0x4150, 0x2091, 0x8001, 0x6853, 0x0016, + 0x0078, 0x4149, 0x6853, 0x0007, 0x0078, 0x4149, 0x6834, 0x8007, + 0xa084, 0x00ff, 0x00c0, 0x4090, 0x1078, 0x3df0, 0x0078, 0x40a2, + 0x2030, 0x8001, 0x00c0, 0x409a, 0x7007, 0x0001, 0x1078, 0x40a3, + 0x0078, 0x40a2, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, + 0x704b, 0x40a3, 0x007c, 0x0e7e, 0x2009, 0x762c, 0x210c, 0x81ff, + 0x00c0, 0x4124, 0x2009, 0x760c, 0x210c, 0xd194, 0x00c0, 0x412e, + 0x6848, 0x2070, 0xae82, 0x7d00, 0x0048, 0x4113, 0x2001, 0x7615, + 0x2004, 0xae02, 0x00c8, 0x4113, 0x6944, 0x1078, 0x416f, 0x6100, + 0xa184, 0x0001, 0x0040, 0x40f9, 0xa184, 0x0100, 0x00c0, 0x4117, + 0xa184, 0x0200, 0x00c0, 0x411b, 0x601c, 0xa005, 0x00c0, 0x411f, + 0x711c, 0xa186, 0x0006, 0x00c0, 0x40fe, 0x6853, 0x0000, 0x6803, + 0x0000, 0x2d08, 0x127e, 0x2091, 0x8000, 0x7010, 0xa005, 0x00c0, + 0x40f0, 0x7112, 0x7018, 0xa065, 0x0040, 0x4123, 0x6000, 0xd0e4, + 0x00c0, 0x4128, 0x2e60, 0x1078, 0x4615, 0x127f, 0x0e7f, 0x007c, + 0x2068, 0x6800, 0xa005, 0x00c0, 0x40f0, 0x6902, 0x127f, 0x0e7f, + 0x007c, 0x0e7f, 0x6853, 0x0006, 0x0078, 0x4149, 0x6944, 0xa18c, + 0xff00, 0x810f, 0x1078, 0x3825, 0x00c0, 0x4129, 0x6000, 0xd0e4, + 0x00c0, 0x4129, 0x711c, 0xa186, 0x0007, 0x00c0, 0x4113, 0x6853, + 0x0002, 0x0078, 0x412b, 0x6853, 0x0008, 0x0078, 0x412b, 0x6853, + 0x000e, 0x0078, 0x412b, 0x6853, 0x0017, 0x0078, 0x412b, 0x6853, + 0x0035, 0x0078, 0x412b, 0x127f, 0x6853, 0x0028, 0x0078, 0x412b, + 0x127f, 0x6853, 0x0029, 0x0e7f, 0x0078, 0x4149, 0x6853, 0x002a, + 0x0078, 0x412b, 0x2009, 0x003e, 0x0078, 0x4144, 0x2009, 0x0004, + 0x0078, 0x4144, 0x2009, 0x0006, 0x0078, 0x4144, 0x2009, 0x0016, + 0x0078, 0x4144, 0x2009, 0x0001, 0x6854, 0xa084, 0xff00, 0xa105, + 0x6856, 0x2091, 0x8000, 0x1078, 0x3a7a, 0x2091, 0x8001, 0x007c, + 0x1078, 0x1348, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048, + 0x4160, 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076, 0x0078, 0x416c, + 0x7070, 0xa080, 0x0040, 0x7072, 0x00c8, 0x416c, 0x7074, 0xa081, + 0x0000, 0x7076, 0xa085, 0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e, + 0x1078, 0x460c, 0x0d7f, 0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204, + 0xa085, 0x8002, 0x2012, 0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08, + 0x20e1, 0x2000, 0x3d00, 0xa084, 0x7000, 0x0040, 0x418b, 0xa086, + 0x1000, 0x00c0, 0x41a7, 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0, + 0x4192, 0x3e60, 0xac84, 0x0007, 0x00c0, 0x41a7, 0xac82, 0x7d00, + 0x0048, 0x41a7, 0x6854, 0xac02, 0x00c8, 0x41a7, 0x2009, 0x0047, + 0x1078, 0x5c29, 0x7a1c, 0xd284, 0x00c0, 0x417d, 0x007c, 0xa016, + 0x1078, 0x1572, 0x0078, 0x41a2, 0x157e, 0x137e, 0x147e, 0x20e1, + 0x3000, 0x3d20, 0x3e28, 0xa584, 0x0070, 0x00c0, 0x41d5, 0xa484, + 0x7000, 0xa086, 0x1000, 0x00c0, 0x41d5, 0x1078, 0x41e2, 0x0040, + 0x41d5, 0x20e1, 0x3000, 0x7828, 0x7828, 0x1078, 0x4200, 0x147f, + 0x137f, 0x157f, 0x2009, 0x783e, 0x2104, 0xa005, 0x00c0, 0x41d1, + 0x007c, 0x1078, 0x4c7a, 0x0078, 0x41d0, 0x1078, 0x7574, 0x1078, + 0x41e2, 0x20e1, 0x3000, 0x7828, 0x7828, 0x147f, 0x137f, 0x157f, + 0x0078, 0x41d0, 0xa484, 0x01ff, 0x687a, 0xa005, 0x0040, 0x41f4, + 0xa080, 0x001f, 0xa084, 0x03f8, 0x80ac, 0x20e1, 0x1000, 0x2ea0, + 0x2099, 0x020a, 0x53a5, 0x007c, 0x20a9, 0x000c, 0x20e1, 0x1000, + 0x2ea0, 0x2099, 0x020a, 0x53a5, 0xa085, 0x0001, 0x0078, 0x41f3, + 0x7000, 0xa084, 0xff00, 0xa08c, 0xf000, 0x8007, 0xa196, 0x0000, + 0x00c0, 0x420d, 0x0078, 0x4381, 0x007c, 0xa196, 0x2000, 0x00c0, + 0x421e, 0x6900, 0xa18e, 0x0001, 0x00c0, 0x421a, 0x1078, 0x2eb2, + 0x0078, 0x420c, 0x1078, 0x4226, 0x0078, 0x420c, 0xa196, 0x8000, + 0x00c0, 0x420c, 0x1078, 0x4407, 0x0078, 0x420c, 0x0c7e, 0x7110, + 0xa18c, 0xff00, 0x810f, 0xa196, 0x0001, 0x0040, 0x4233, 0xa196, + 0x0023, 0x00c0, 0x4328, 0xa08e, 0x0023, 0x00c0, 0x4264, 0x1078, + 0x447e, 0x0040, 0x4328, 0x7124, 0x610a, 0x7030, 0xa08e, 0x0200, + 0x00c0, 0x424c, 0x7034, 0xa005, 0x00c0, 0x4328, 0x2009, 0x0015, + 0x1078, 0x5c29, 0x0078, 0x4328, 0xa08e, 0x0210, 0x00c0, 0x4256, + 0x2009, 0x0015, 0x1078, 0x5c29, 0x0078, 0x4328, 0xa08e, 0x0100, + 0x00c0, 0x4328, 0x7034, 0xa005, 0x00c0, 0x4328, 0x2009, 0x0016, + 0x1078, 0x5c29, 0x0078, 0x4328, 0xa08e, 0x0022, 0x00c0, 0x4328, + 0x7030, 0xa08e, 0x0300, 0x00c0, 0x4275, 0x7034, 0xa005, 0x00c0, + 0x4328, 0x2009, 0x0017, 0x0078, 0x42f4, 0xa08e, 0x0500, 0x00c0, + 0x4281, 0x7034, 0xa005, 0x00c0, 0x4328, 0x2009, 0x0018, 0x0078, + 0x42f4, 0xa08e, 0x2010, 0x00c0, 0x4289, 0x2009, 0x0019, 0x0078, + 0x42f4, 0xa08e, 0x2110, 0x00c0, 0x4291, 0x2009, 0x001a, 0x0078, + 0x42f4, 0xa08e, 0x5200, 0x00c0, 0x429d, 0x7034, 0xa005, 0x00c0, + 0x4328, 0x2009, 0x001b, 0x0078, 0x42f4, 0xa08e, 0x5000, 0x00c0, + 0x42a9, 0x7034, 0xa005, 0x00c0, 0x4328, 0x2009, 0x001c, 0x0078, + 0x42f4, 0xa08e, 0x1200, 0x00c0, 0x42b5, 0x7034, 0xa005, 0x00c0, + 0x4328, 0x2009, 0x0024, 0x0078, 0x42f4, 0xa08c, 0xff00, 0xa18e, + 0x2400, 0x00c0, 0x42bf, 0x2009, 0x002d, 0x0078, 0x42f4, 0xa08c, + 0xff00, 0xa18e, 0x5300, 0x00c0, 0x42c9, 0x2009, 0x002a, 0x0078, + 0x42f4, 0xa08e, 0x0f00, 0x00c0, 0x42d1, 0x2009, 0x0020, 0x0078, + 0x42f4, 0xa08e, 0x5300, 0x00c0, 0x42d7, 0x0078, 0x42f2, 0xa08e, + 0x6104, 0x00c0, 0x42f2, 0x2011, 0x7b8d, 0x8208, 0x2204, 0xa082, + 0x0004, 0x20a8, 0x95ac, 0x95ac, 0x2011, 0x8015, 0x211c, 0x8108, + 0x2124, 0x1078, 0x2d4a, 0x8108, 0x00f0, 0x42e4, 0x2009, 0x0023, + 0x0078, 0x42f4, 0x2009, 0x001d, 0x017e, 0x2011, 0x7b83, 0x2204, + 0x8211, 0x220c, 0x1078, 0x2085, 0x00c0, 0x432a, 0x1078, 0x37ee, + 0x00c0, 0x432a, 0x6612, 0x6516, 0x86ff, 0x0040, 0x431a, 0x017f, + 0x017e, 0xa186, 0x0017, 0x00c0, 0x431a, 0x6864, 0xa606, 0x00c0, + 0x431a, 0x6868, 0xa506, 0xa084, 0xff00, 0x00c0, 0x431a, 0x6000, + 0xc0f5, 0x6002, 0x0c7e, 0x1078, 0x5b9c, 0x0040, 0x432d, 0x017f, + 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x017f, 0x1078, 0x5c29, + 0x0c7f, 0x007c, 0x017f, 0x0078, 0x4328, 0x0c7f, 0x0078, 0x432a, + 0x0e7e, 0x0d7e, 0x2028, 0x2130, 0xa696, 0x00ff, 0x00c0, 0x4350, + 0xa596, 0xfffd, 0x00c0, 0x4340, 0x2009, 0x007f, 0x0078, 0x437d, + 0xa596, 0xfffe, 0x00c0, 0x4348, 0x2009, 0x007e, 0x0078, 0x437d, + 0xa596, 0xfffc, 0x00c0, 0x4350, 0x2009, 0x0080, 0x0078, 0x437d, + 0x2011, 0x0000, 0x2021, 0x007e, 0x20a9, 0x0082, 0x2071, 0x779e, + 0x2e1c, 0x83ff, 0x00c0, 0x4362, 0x82ff, 0x00c0, 0x4371, 0x2410, + 0x0078, 0x4371, 0x2368, 0x6b10, 0x007e, 0x2100, 0xa31e, 0x007f, + 0x00c0, 0x4371, 0x6b14, 0xa31e, 0x00c0, 0x4371, 0x2408, 0x0078, + 0x437d, 0x8420, 0x8e70, 0x00f0, 0x4358, 0x82ff, 0x00c0, 0x437c, + 0xa085, 0x0001, 0x0078, 0x437e, 0x2208, 0xa006, 0x0d7f, 0x0e7f, + 0x007c, 0xa084, 0x0007, 0x0079, 0x4386, 0x007c, 0x438e, 0x438e, + 0x438e, 0x438e, 0x438e, 0x438f, 0x43a8, 0x43f0, 0x007c, 0x7110, + 0xd1bc, 0x0040, 0x43a7, 0x7120, 0x2160, 0xac8c, 0x0007, 0x00c0, + 0x43a7, 0xac8a, 0x7d00, 0x0048, 0x43a7, 0x6854, 0xac02, 0x00c8, + 0x43a7, 0x7124, 0x610a, 0x2009, 0x0046, 0x1078, 0x5c29, 0x007c, + 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x43ee, 0x2011, 0x7b83, 0x2204, + 0x8211, 0x220c, 0x1078, 0x2085, 0x00c0, 0x43ee, 0x1078, 0x3825, + 0x00c0, 0x43ee, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, + 0x00c0, 0x43d3, 0x0c7e, 0x1078, 0x5b9c, 0x017f, 0x0040, 0x43ee, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x2009, 0x0044, 0x1078, - 0x5591, 0x0078, 0x3fbe, 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040, - 0x3fbe, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, - 0x00c0, 0x3fb6, 0x6007, 0x0005, 0x0078, 0x3fb8, 0x6007, 0x0001, - 0x6003, 0x0001, 0x1078, 0x4376, 0x1078, 0x476a, 0x0c7f, 0x007c, - 0x7110, 0xd1bc, 0x0040, 0x3fd6, 0x7020, 0x2060, 0xac84, 0x0007, - 0x00c0, 0x3fd6, 0xac82, 0x7400, 0x0048, 0x3fd6, 0x6854, 0xac02, - 0x00c8, 0x3fd6, 0x2009, 0x0045, 0x1078, 0x5591, 0x007c, 0x7110, - 0xa18c, 0xff00, 0x810f, 0xa18e, 0x0000, 0x00c0, 0x3fe7, 0xa084, - 0x000f, 0xa08a, 0x0006, 0x10c8, 0x12b7, 0x1079, 0x3fe8, 0x007c, - 0x3fee, 0x3fef, 0x3fee, 0x3fee, 0x4030, 0x403f, 0x007c, 0x7110, - 0xd1bc, 0x00c0, 0x402f, 0x700c, 0x7108, 0x1078, 0x1e1b, 0x00c0, - 0x402f, 0x1078, 0x3410, 0x00c0, 0x402f, 0x6612, 0x6516, 0x6204, - 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x4018, 0x0c7e, - 0x1078, 0x5504, 0x017f, 0x0040, 0x402f, 0x611a, 0x601f, 0x0005, - 0x7120, 0x610a, 0x2009, 0x0028, 0x1078, 0x5591, 0x0078, 0x402f, - 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040, 0x402f, 0x611a, 0x601f, - 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x402b, 0x2009, - 0x0005, 0x0078, 0x402d, 0x2009, 0x0001, 0x1078, 0x5591, 0x007c, - 0x7110, 0xd1bc, 0x0040, 0x403e, 0x1078, 0x404e, 0x0040, 0x403e, - 0x7124, 0x610a, 0x2009, 0x0029, 0x1078, 0x5591, 0x007c, 0x7110, - 0xd1bc, 0x0040, 0x404d, 0x1078, 0x404e, 0x0040, 0x404d, 0x7124, - 0x610a, 0x2009, 0x002a, 0x1078, 0x5591, 0x007c, 0x7020, 0x2060, - 0xac84, 0x0007, 0x00c0, 0x4061, 0xac82, 0x7400, 0x0048, 0x4061, - 0x2001, 0x6d15, 0x2004, 0xac02, 0x00c8, 0x4061, 0xa085, 0x0001, - 0x007c, 0xa006, 0x0078, 0x4060, 0x2071, 0x6f23, 0x7003, 0x0003, - 0x700f, 0x0361, 0xa006, 0x701a, 0x7012, 0x7017, 0x7400, 0x7007, - 0x0000, 0x7026, 0x702b, 0x4ff2, 0x7032, 0x7037, 0x503e, 0x007c, - 0x2071, 0x6f23, 0x00e0, 0x40be, 0x2091, 0x6000, 0x700c, 0x8001, - 0x700e, 0x00c0, 0x4087, 0x700f, 0x0361, 0x7007, 0x0001, 0x127e, - 0x2091, 0x8000, 0x7024, 0xa00d, 0x0040, 0x409b, 0x7020, 0x8001, - 0x7022, 0x00c0, 0x409b, 0x7023, 0x0009, 0x8109, 0x7126, 0x00c0, - 0x409b, 0x7028, 0x107a, 0x7030, 0xa00d, 0x0040, 0x40ac, 0x702c, - 0x8001, 0x702e, 0x00c0, 0x40ac, 0x702f, 0x0009, 0x8109, 0x7132, - 0x00c0, 0x40ac, 0x7034, 0x107a, 0x7018, 0xa00d, 0x0040, 0x40bd, - 0x7008, 0x8001, 0x700a, 0x00c0, 0x40bd, 0x700b, 0x0009, 0x8109, - 0x711a, 0x00c0, 0x40bd, 0x701c, 0x107a, 0x127f, 0x7004, 0x0079, - 0x40c1, 0x40e8, 0x40e9, 0x4105, 0x0e7e, 0x2071, 0x6f23, 0x7018, - 0xa005, 0x00c0, 0x40cf, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, - 0x007c, 0x0e7e, 0x007e, 0x2071, 0x6f23, 0x701c, 0xa206, 0x00c0, - 0x40db, 0x701a, 0x701e, 0x007f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, - 0x6f23, 0x6088, 0xa102, 0x0048, 0x40e6, 0x618a, 0x0e7f, 0x007c, - 0x007c, 0x7110, 0x1078, 0x3447, 0x00c0, 0x40fb, 0x6088, 0x8001, - 0x0048, 0x40fb, 0x608a, 0x00c0, 0x40fb, 0x127e, 0x2091, 0x8000, - 0x1078, 0x476a, 0x127f, 0x8108, 0xa182, 0x00ff, 0x0048, 0x4103, - 0xa00e, 0x7007, 0x0002, 0x7112, 0x007c, 0x7014, 0x2060, 0x127e, - 0x2091, 0x8000, 0x6014, 0xa005, 0x0040, 0x4134, 0x8001, 0x6016, - 0x00c0, 0x4134, 0x611c, 0xa186, 0x0003, 0x0040, 0x411b, 0xa186, - 0x0006, 0x00c0, 0x4132, 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, - 0x0048, 0x4132, 0xa082, 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048, - 0x412b, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, - 0x0078, 0x4134, 0x1078, 0x5fea, 0x127f, 0xac88, 0x0008, 0x7116, - 0x2001, 0x6d16, 0x2004, 0xa102, 0x0048, 0x4142, 0x7017, 0x7400, - 0x7007, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6f23, 0x7027, 0x07d0, - 0x7023, 0x0009, 0x0e7f, 0x007c, 0x2001, 0x6f2c, 0x2003, 0x0000, - 0x007c, 0x0e7e, 0x2071, 0x6f23, 0x7033, 0x07d0, 0x702f, 0x0009, - 0x0e7f, 0x007c, 0x2011, 0x6f2f, 0x2013, 0x0000, 0x007c, 0x0e7e, - 0x2071, 0x6f23, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, - 0x0c7e, 0x2061, 0x6fb2, 0x0c7f, 0x007c, 0xa184, 0x000f, 0x8003, - 0x8003, 0x8003, 0xa080, 0x6fb2, 0x2060, 0x007c, 0x684c, 0xa08c, - 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x41ac, 0xd0b4, 0x00c0, 0x4188, - 0xd0bc, 0x00c0, 0x419a, 0x2009, 0x0006, 0x1078, 0x41cf, 0x007c, - 0xd0fc, 0x0040, 0x4195, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, - 0x41c8, 0xa08e, 0x0000, 0x00c0, 0x41c8, 0x2009, 0x0043, 0x1078, - 0x5591, 0x007c, 0xd0fc, 0x0040, 0x41a7, 0xa084, 0x0003, 0xa08e, - 0x0003, 0x0040, 0x41c8, 0xa08e, 0x0000, 0x00c0, 0x41c8, 0x2009, - 0x0042, 0x1078, 0x5591, 0x007c, 0xd0fc, 0x0040, 0x41be, 0xa084, - 0x0003, 0xa08e, 0x0003, 0x0040, 0x41c8, 0xa08e, 0x0002, 0x0040, - 0x41c2, 0x2009, 0x0041, 0x1078, 0x5591, 0x007c, 0x1078, 0x41cd, - 0x0078, 0x41bd, 0x2009, 0x0043, 0x1078, 0x5591, 0x0078, 0x41bd, - 0x2009, 0x0004, 0x1078, 0x41cf, 0x007c, 0x2009, 0x0001, 0x6010, - 0xa0ec, 0xf000, 0x0040, 0x41f3, 0x2068, 0x6952, 0x6800, 0x6012, - 0xa186, 0x0001, 0x00c0, 0x41ed, 0x694c, 0xa18c, 0x8100, 0xa18e, - 0x8100, 0x00c0, 0x41ed, 0x0c7e, 0x6944, 0x1078, 0x416d, 0x6204, - 0x8210, 0x0048, 0x41ec, 0x6206, 0x0c7f, 0x1078, 0x36a1, 0x6010, - 0xa06d, 0x10c0, 0x4176, 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010, - 0x2061, 0x6fb2, 0x6000, 0x81ff, 0x0040, 0x4201, 0xa205, 0x0078, - 0x4202, 0xa204, 0x6002, 0xace0, 0x0008, 0x00f0, 0x41fa, 0x0c7f, - 0x157f, 0x007c, 0x6808, 0xa005, 0x0040, 0x4212, 0x8001, 0x680a, - 0xa085, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x2079, 0x6f10, - 0x127f, 0x0d7e, 0x2069, 0x6f10, 0x6803, 0x0005, 0x2069, 0x0004, + 0x5c29, 0x0078, 0x43ee, 0x0c7e, 0x1078, 0x5b9c, 0x017f, 0x0040, + 0x43ee, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, + 0x00c0, 0x43e6, 0x6007, 0x0005, 0x0078, 0x43e8, 0x6007, 0x0001, + 0x6003, 0x0001, 0x1078, 0x4872, 0x1078, 0x4c7a, 0x0c7f, 0x007c, + 0x7110, 0xd1bc, 0x0040, 0x4406, 0x7020, 0x2060, 0xac84, 0x0007, + 0x00c0, 0x4406, 0xac82, 0x7d00, 0x0048, 0x4406, 0x6854, 0xac02, + 0x00c8, 0x4406, 0x2009, 0x0045, 0x1078, 0x5c29, 0x007c, 0x7110, + 0xa18c, 0xff00, 0x810f, 0xa18e, 0x0000, 0x00c0, 0x4417, 0xa084, + 0x000f, 0xa08a, 0x0006, 0x10c8, 0x12d5, 0x1079, 0x4418, 0x007c, + 0x441e, 0x441f, 0x441e, 0x441e, 0x4460, 0x446f, 0x007c, 0x7110, + 0xd1bc, 0x00c0, 0x445f, 0x700c, 0x7108, 0x1078, 0x2085, 0x00c0, + 0x445f, 0x1078, 0x37ee, 0x00c0, 0x445f, 0x6612, 0x6516, 0x6204, + 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x4448, 0x0c7e, + 0x1078, 0x5b9c, 0x017f, 0x0040, 0x445f, 0x611a, 0x601f, 0x0005, + 0x7120, 0x610a, 0x2009, 0x0088, 0x1078, 0x5c29, 0x0078, 0x445f, + 0x0c7e, 0x1078, 0x5b9c, 0x017f, 0x0040, 0x445f, 0x611a, 0x601f, + 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x445b, 0x2009, + 0x0005, 0x0078, 0x445d, 0x2009, 0x0001, 0x1078, 0x5c29, 0x007c, + 0x7110, 0xd1bc, 0x0040, 0x446e, 0x1078, 0x447e, 0x0040, 0x446e, + 0x7124, 0x610a, 0x2009, 0x0089, 0x1078, 0x5c29, 0x007c, 0x7110, + 0xd1bc, 0x0040, 0x447d, 0x1078, 0x447e, 0x0040, 0x447d, 0x7124, + 0x610a, 0x2009, 0x008a, 0x1078, 0x5c29, 0x007c, 0x7020, 0x2060, + 0xac84, 0x0007, 0x00c0, 0x4491, 0xac82, 0x7d00, 0x0048, 0x4491, + 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8, 0x4491, 0xa085, 0x0001, + 0x007c, 0xa006, 0x0078, 0x4490, 0x2071, 0x7849, 0x7003, 0x0003, + 0x700f, 0x0361, 0xa006, 0x701a, 0x7012, 0x7017, 0x7d00, 0x7007, + 0x0000, 0x7026, 0x702b, 0x558f, 0x7032, 0x7037, 0x55d0, 0x703b, + 0x0002, 0x703f, 0x0000, 0x007c, 0x2071, 0x7849, 0x00e0, 0x455b, + 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x00c0, 0x4524, 0x700f, + 0x0361, 0x7007, 0x0001, 0x127e, 0x2091, 0x8000, 0x7138, 0x8109, + 0x713a, 0x00c0, 0x4522, 0x703b, 0x0002, 0x2009, 0x0100, 0x2104, + 0xa082, 0x0003, 0x00c8, 0x4522, 0x703c, 0xa086, 0x0001, 0x00c0, + 0x44ff, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, + 0x44dd, 0x6803, 0x1000, 0x0078, 0x44e4, 0x6804, 0xa084, 0x1000, + 0x0040, 0x44e4, 0x6803, 0x0100, 0x6803, 0x0000, 0x703f, 0x0000, + 0x2069, 0x7836, 0x6804, 0xa082, 0x0006, 0x00c0, 0x44f1, 0x6807, + 0x0000, 0x6830, 0xa082, 0x0003, 0x00c0, 0x44f8, 0x6833, 0x0000, + 0x1078, 0x4c7a, 0x1078, 0x4d3a, 0x0d7f, 0x0078, 0x4522, 0x0d7e, + 0x2069, 0x7600, 0x6944, 0x6860, 0xa102, 0x00c8, 0x4521, 0x2069, + 0x7836, 0x6804, 0xa086, 0x0000, 0x00c0, 0x4521, 0x6830, 0xa086, + 0x0000, 0x00c0, 0x4521, 0x703f, 0x0001, 0x6807, 0x0006, 0x6833, + 0x0003, 0x2069, 0x0100, 0x6830, 0x689e, 0x2069, 0x0140, 0x6803, + 0x0600, 0x0d7f, 0x0078, 0x4527, 0x127e, 0x2091, 0x8000, 0x7024, + 0xa00d, 0x0040, 0x4538, 0x7020, 0x8001, 0x7022, 0x00c0, 0x4538, + 0x7023, 0x0009, 0x8109, 0x7126, 0x00c0, 0x4538, 0x7028, 0x107a, + 0x7030, 0xa00d, 0x0040, 0x4549, 0x702c, 0x8001, 0x702e, 0x00c0, + 0x4549, 0x702f, 0x0009, 0x8109, 0x7132, 0x00c0, 0x4549, 0x7034, + 0x107a, 0x7018, 0xa00d, 0x0040, 0x455a, 0x7008, 0x8001, 0x700a, + 0x00c0, 0x455a, 0x700b, 0x0009, 0x8109, 0x711a, 0x00c0, 0x455a, + 0x701c, 0x107a, 0x127f, 0x7004, 0x0079, 0x455e, 0x4585, 0x4586, + 0x45a2, 0x0e7e, 0x2071, 0x7849, 0x7018, 0xa005, 0x00c0, 0x456c, + 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0e7e, 0x007e, + 0x2071, 0x7849, 0x701c, 0xa206, 0x00c0, 0x4578, 0x701a, 0x701e, + 0x007f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x7849, 0x6088, 0xa102, + 0x0048, 0x4583, 0x618a, 0x0e7f, 0x007c, 0x007c, 0x7110, 0x1078, + 0x3825, 0x00c0, 0x4598, 0x6088, 0x8001, 0x0048, 0x4598, 0x608a, + 0x00c0, 0x4598, 0x127e, 0x2091, 0x8000, 0x1078, 0x4c7a, 0x127f, + 0x8108, 0xa182, 0x00ff, 0x0048, 0x45a0, 0xa00e, 0x7007, 0x0002, + 0x7112, 0x007c, 0x7014, 0x2060, 0x127e, 0x2091, 0x8000, 0x6014, + 0xa005, 0x0040, 0x45d1, 0x8001, 0x6016, 0x00c0, 0x45d1, 0x611c, + 0xa186, 0x0003, 0x0040, 0x45b8, 0xa186, 0x0006, 0x00c0, 0x45cf, + 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, 0x0048, 0x45cf, 0xa082, + 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048, 0x45c8, 0x2001, 0x1999, + 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0078, 0x45d1, 0x1078, + 0x67c9, 0x127f, 0xac88, 0x0008, 0x7116, 0x2001, 0x7616, 0x2004, + 0xa102, 0x0048, 0x45df, 0x7017, 0x7d00, 0x7007, 0x0000, 0x007c, + 0x0e7e, 0x2071, 0x7849, 0x7027, 0x07d0, 0x7023, 0x0009, 0x703b, + 0x0002, 0x0e7f, 0x007c, 0x2001, 0x7852, 0x2003, 0x0000, 0x007c, + 0x0e7e, 0x2071, 0x7849, 0x7033, 0x07d0, 0x702f, 0x0009, 0x0e7f, + 0x007c, 0x2011, 0x7855, 0x2013, 0x0000, 0x007c, 0x0e7e, 0x2071, + 0x7849, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0c7e, + 0x2061, 0x78da, 0x0c7f, 0x007c, 0xa184, 0x000f, 0x8003, 0x8003, + 0x8003, 0xa080, 0x78da, 0x2060, 0x007c, 0x6854, 0xa08a, 0x199a, + 0x0048, 0x461c, 0x2001, 0x1999, 0xa005, 0x00c0, 0x462c, 0x6944, + 0x0c7e, 0x1078, 0x460c, 0x6014, 0x0c7f, 0xa005, 0x00c0, 0x4631, + 0x2001, 0x001e, 0x0078, 0x4631, 0xa08e, 0xffff, 0x00c0, 0x4631, + 0xa006, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x684c, 0xa08c, + 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x466c, 0xd0b4, 0x00c0, 0x4648, + 0xd0bc, 0x00c0, 0x465a, 0x2009, 0x0006, 0x1078, 0x468f, 0x007c, + 0xd0fc, 0x0040, 0x4655, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, + 0x4688, 0xa08e, 0x0000, 0x00c0, 0x4688, 0x2009, 0x0043, 0x1078, + 0x5c29, 0x007c, 0xd0fc, 0x0040, 0x4667, 0xa084, 0x0003, 0xa08e, + 0x0003, 0x0040, 0x4688, 0xa08e, 0x0000, 0x00c0, 0x4688, 0x2009, + 0x0042, 0x1078, 0x5c29, 0x007c, 0xd0fc, 0x0040, 0x467e, 0xa084, + 0x0003, 0xa08e, 0x0003, 0x0040, 0x4688, 0xa08e, 0x0002, 0x0040, + 0x4682, 0x2009, 0x0041, 0x1078, 0x5c29, 0x007c, 0x1078, 0x468d, + 0x0078, 0x467d, 0x2009, 0x0043, 0x1078, 0x5c29, 0x0078, 0x467d, + 0x2009, 0x0004, 0x1078, 0x468f, 0x007c, 0x2009, 0x0001, 0x6010, + 0xa0ec, 0xf000, 0x0040, 0x46b3, 0x2068, 0x6952, 0x6800, 0x6012, + 0xa186, 0x0001, 0x00c0, 0x46ad, 0x694c, 0xa18c, 0x8100, 0xa18e, + 0x8100, 0x00c0, 0x46ad, 0x0c7e, 0x6944, 0x1078, 0x460c, 0x6204, + 0x8210, 0x0048, 0x46ac, 0x6206, 0x0c7f, 0x1078, 0x3a7a, 0x6010, + 0xa06d, 0x10c0, 0x4615, 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010, + 0x2061, 0x78da, 0x6000, 0x81ff, 0x0040, 0x46c1, 0xa205, 0x0078, + 0x46c2, 0xa204, 0x6002, 0xace0, 0x0008, 0x00f0, 0x46ba, 0x0c7f, + 0x157f, 0x007c, 0x6808, 0xa005, 0x0040, 0x46d2, 0x8001, 0x680a, + 0xa085, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x2079, 0x7836, + 0x127f, 0x0d7e, 0x2069, 0x7836, 0x6803, 0x0005, 0x2069, 0x0004, 0x2d04, 0xa085, 0x8001, 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027, - 0x0001, 0x7804, 0xa084, 0x0007, 0x0079, 0x422e, 0x4238, 0x425d, - 0x428e, 0x423e, 0x425d, 0x4236, 0x4236, 0x4236, 0x1078, 0x12b7, - 0x1078, 0x414c, 0x1078, 0x476a, 0x0c7f, 0x007c, 0x62c0, 0x82ff, - 0x00c0, 0x4244, 0x0c7f, 0x007c, 0x2011, 0x318e, 0x1078, 0x40d1, - 0x7828, 0xa092, 0x0002, 0x00c8, 0x4253, 0x8000, 0x782a, 0x1078, - 0x31c2, 0x0078, 0x4242, 0x1078, 0x318e, 0x7807, 0x0003, 0x7827, - 0x0000, 0x782b, 0x0000, 0x0078, 0x4242, 0x1078, 0x414c, 0x62c0, - 0x82ff, 0x00c0, 0x426f, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, - 0x12b7, 0x2009, 0x0013, 0x1078, 0x5591, 0x0c7f, 0x007c, 0x0c7e, - 0x7824, 0xa065, 0x1040, 0x12b7, 0x7804, 0xa086, 0x0004, 0x0040, - 0x42cc, 0x7828, 0xa092, 0x2710, 0x00c8, 0x4285, 0x8000, 0x782a, - 0x0c7f, 0x1078, 0x4fd7, 0x0078, 0x426d, 0x1078, 0x6c76, 0x2009, - 0x0014, 0x1078, 0x5591, 0x0c7f, 0x0078, 0x426d, 0x2001, 0x6f2c, - 0x2003, 0x0000, 0x62c0, 0x82ff, 0x00c0, 0x42a2, 0x782b, 0x0000, - 0x7824, 0xa065, 0x1040, 0x12b7, 0x2009, 0x0013, 0x1078, 0x55df, - 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x7824, 0xa005, 0x1040, 0x12b7, - 0x781c, 0xa06d, 0x1040, 0x12b7, 0x6800, 0xc0dc, 0x6802, 0x7924, - 0x2160, 0x1078, 0x556a, 0x693c, 0x81ff, 0x1040, 0x12b7, 0x8109, - 0x693e, 0x6854, 0xa015, 0x0040, 0x42c0, 0x7a1e, 0x0078, 0x42c2, - 0x7918, 0x791e, 0x7807, 0x0000, 0x7827, 0x0000, 0x0d7f, 0x0c7f, - 0x1078, 0x476a, 0x0078, 0x42a0, 0x6104, 0xa186, 0x0002, 0x0040, - 0x42d7, 0xa186, 0x0004, 0x0040, 0x42d7, 0x0078, 0x4279, 0x7808, - 0xac06, 0x0040, 0x4279, 0x1078, 0x4671, 0x1078, 0x4376, 0x0c7f, - 0x1078, 0x476a, 0x0078, 0x426d, 0x0c7e, 0x6027, 0x0002, 0x2011, - 0x6f2f, 0x2013, 0x0000, 0x62c8, 0x82ff, 0x00c0, 0x42fe, 0x62c4, - 0x82ff, 0x00c0, 0x42fe, 0x793c, 0xa1e5, 0x0000, 0x0040, 0x42fc, - 0x2009, 0x0049, 0x1078, 0x5591, 0x0c7f, 0x007c, 0x6017, 0x0010, - 0x793c, 0x81ff, 0x0040, 0x42fc, 0x7944, 0xa192, 0x2710, 0x00c8, - 0x431d, 0x8108, 0x7946, 0x1078, 0x4151, 0x793c, 0xa188, 0x0007, - 0x210c, 0xa18e, 0x0006, 0x00c0, 0x4319, 0x6017, 0x0012, 0x0078, - 0x42fc, 0x6017, 0x0016, 0x0078, 0x42fc, 0x1078, 0x6c76, 0x793c, - 0x2160, 0x2009, 0x004a, 0x1078, 0x5591, 0x0078, 0x42fc, 0x007e, - 0x017e, 0x0c7e, 0x127e, 0x600f, 0x0000, 0x2c08, 0x2061, 0x6f10, - 0x2091, 0x8000, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005, 0x0040, - 0x4342, 0xa080, 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f, 0x017f, - 0x007f, 0x007c, 0x6116, 0x6112, 0x0078, 0x433d, 0x0d7e, 0x2069, - 0x6f10, 0x6000, 0xd0d4, 0x0040, 0x435d, 0x6820, 0x8000, 0x6822, - 0xa086, 0x0001, 0x00c0, 0x4356, 0x2c00, 0x681e, 0x6804, 0xa084, - 0x0007, 0x0079, 0x4772, 0x0d7f, 0x007c, 0xc0d5, 0x6002, 0x6818, - 0xa005, 0x0040, 0x436f, 0x6056, 0x605b, 0x0000, 0x007e, 0x2c00, - 0x681a, 0x0d7f, 0x685a, 0x2069, 0x6f10, 0x0078, 0x434d, 0x6056, - 0x605a, 0x2c00, 0x681a, 0x681e, 0x0078, 0x434d, 0x007e, 0x017e, - 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, - 0x6f10, 0x6020, 0x8000, 0x6022, 0x6008, 0xa005, 0x0040, 0x4391, - 0xa080, 0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f, 0x007f, - 0x007c, 0x610e, 0x610a, 0x0078, 0x438c, 0x0c7e, 0x600f, 0x0000, - 0x2c08, 0x2061, 0x6f10, 0x6034, 0xa005, 0x0040, 0x43a5, 0xa080, - 0x0003, 0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136, 0x0078, - 0x43a3, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, - 0x127e, 0x2071, 0x6f10, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, - 0x8cff, 0x0040, 0x4405, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, - 0x00c0, 0x4400, 0x703c, 0xac06, 0x00c0, 0x43cb, 0x6003, 0x000a, - 0x630a, 0x0078, 0x4400, 0x7038, 0xac36, 0x00c0, 0x43d1, 0x660c, - 0x763a, 0x7034, 0xac36, 0x00c0, 0x43df, 0x2c00, 0xaf36, 0x0040, - 0x43dd, 0x2f00, 0x7036, 0x0078, 0x43df, 0x7037, 0x0000, 0x660c, - 0x067e, 0x2c00, 0xaf06, 0x0040, 0x43e8, 0x7e0e, 0x0078, 0x43e9, - 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, - 0x00c0, 0x440e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, - 0x36a1, 0x1078, 0x6276, 0x1078, 0x6283, 0x0c7f, 0x0078, 0x43b8, - 0x2c78, 0x600c, 0x2060, 0x0078, 0x43b8, 0x127f, 0x007f, 0x027f, - 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, - 0x0006, 0x00c0, 0x43f2, 0x1078, 0x6bb3, 0x0078, 0x43fb, 0x007e, - 0x067e, 0x0c7e, 0x0d7e, 0x0f7e, 0x2031, 0x0000, 0x127e, 0x2091, - 0x8000, 0x2079, 0x6f10, 0x7838, 0xa065, 0x0040, 0x444a, 0x600c, - 0x007e, 0x600f, 0x0000, 0x783c, 0xac06, 0x00c0, 0x4435, 0x6003, - 0x000a, 0x630a, 0x2c30, 0x0078, 0x4447, 0x6010, 0x2068, 0x601c, - 0xa086, 0x0003, 0x00c0, 0x4453, 0x6837, 0x0103, 0x6b4a, 0x6847, - 0x0000, 0x1078, 0x36a1, 0x1078, 0x6276, 0x1078, 0x6283, 0x007f, - 0x0078, 0x4424, 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f, 0x0c7f, - 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x443c, - 0x1078, 0x6bb3, 0x0078, 0x4445, 0x027e, 0x1078, 0x4470, 0x1078, - 0x4507, 0x027f, 0x007c, 0x0f7e, 0x127e, 0x2079, 0x6f10, 0x2091, - 0x8000, 0x1078, 0x4599, 0x1078, 0x4601, 0x127f, 0x0f7f, 0x007c, - 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091, - 0x8000, 0x2071, 0x6f10, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0040, - 0x44f6, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x44f1, - 0x7024, 0xac06, 0x00c0, 0x44b6, 0x2069, 0x0100, 0x68c0, 0xa005, - 0x0040, 0x44b1, 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4, - 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, - 0x0040, 0x44a6, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, - 0x6824, 0xd084, 0x0040, 0x44ae, 0x6827, 0x0001, 0x037f, 0x0078, - 0x44b6, 0x6003, 0x0009, 0x630a, 0x0078, 0x44f1, 0x7014, 0xac36, - 0x00c0, 0x44bc, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x44ca, - 0x2c00, 0xaf36, 0x0040, 0x44c8, 0x2f00, 0x7012, 0x0078, 0x44ca, - 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x44d3, - 0x7e0e, 0x0078, 0x44d4, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, - 0x1078, 0x6120, 0x0040, 0x44ea, 0x601c, 0xa086, 0x0003, 0x00c0, - 0x44fe, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1, - 0x1078, 0x6276, 0x1078, 0x6283, 0x1078, 0x5374, 0x0c7f, 0x0078, - 0x447e, 0x2c78, 0x600c, 0x2060, 0x0078, 0x447e, 0x127f, 0x007f, + 0x0001, 0x7804, 0xa084, 0x0007, 0x0079, 0x46ee, 0x46f8, 0x471d, + 0x4778, 0x46fe, 0x471d, 0x46f6, 0x46f6, 0x46f6, 0x1078, 0x12d5, + 0x1078, 0x45eb, 0x1078, 0x4c7a, 0x0c7f, 0x007c, 0x62c0, 0x82ff, + 0x00c0, 0x4704, 0x0c7f, 0x007c, 0x2011, 0x3542, 0x1078, 0x456e, + 0x7828, 0xa092, 0x0002, 0x00c8, 0x4713, 0x8000, 0x782a, 0x1078, + 0x3572, 0x0078, 0x4702, 0x1078, 0x3542, 0x7807, 0x0003, 0x7827, + 0x0000, 0x782b, 0x0000, 0x0078, 0x4702, 0x1078, 0x45eb, 0x3c00, + 0x007e, 0x2011, 0x0209, 0x20e1, 0x4000, 0x2214, 0x007f, 0x20e0, + 0x82ff, 0x0040, 0x473b, 0x62c0, 0x82ff, 0x00c0, 0x473b, 0x782b, + 0x0000, 0x7824, 0xa065, 0x1040, 0x12d5, 0x2009, 0x0013, 0x1078, + 0x5c29, 0x0c7f, 0x007c, 0x3900, 0xa082, 0x797a, 0x00c8, 0x4742, + 0x1078, 0x5b2c, 0x0c7e, 0x7824, 0xa065, 0x1040, 0x12d5, 0x7804, + 0xa086, 0x0004, 0x0040, 0x47bd, 0x7828, 0xa092, 0x2710, 0x00c8, + 0x4758, 0x8000, 0x782a, 0x0c7f, 0x1078, 0x5574, 0x0078, 0x4739, + 0x6104, 0xa186, 0x0003, 0x00c0, 0x476f, 0x0e7e, 0x2071, 0x7600, + 0x70c8, 0x0e7f, 0xd08c, 0x0040, 0x476f, 0x0c7e, 0x0e7e, 0x2061, + 0x0100, 0x2071, 0x7600, 0x1078, 0x357b, 0x0e7f, 0x0c7f, 0x1078, + 0x75c7, 0x2009, 0x0014, 0x1078, 0x5c29, 0x0c7f, 0x0078, 0x4739, + 0x2001, 0x7852, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x00c0, 0x478c, + 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x12d5, 0x2009, 0x0013, + 0x1078, 0x5c77, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x3900, 0xa082, + 0x797a, 0x00c8, 0x4795, 0x1078, 0x5b2c, 0x7824, 0xa005, 0x1040, + 0x12d5, 0x781c, 0xa06d, 0x1040, 0x12d5, 0x6800, 0xc0dc, 0x6802, + 0x7924, 0x2160, 0x1078, 0x5c02, 0x693c, 0x81ff, 0x1040, 0x12d5, + 0x8109, 0x693e, 0x6854, 0xa015, 0x0040, 0x47b1, 0x7a1e, 0x0078, + 0x47b3, 0x7918, 0x791e, 0x7807, 0x0000, 0x7827, 0x0000, 0x0d7f, + 0x0c7f, 0x1078, 0x4c7a, 0x0078, 0x478a, 0x6104, 0xa186, 0x0002, + 0x0040, 0x47c8, 0xa186, 0x0004, 0x0040, 0x47c8, 0x0078, 0x474c, + 0x7808, 0xac06, 0x0040, 0x474c, 0x1078, 0x4b81, 0x1078, 0x4872, + 0x0c7f, 0x1078, 0x4c7a, 0x0078, 0x4739, 0x0c7e, 0x6027, 0x0002, + 0x2011, 0x7855, 0x2013, 0x0000, 0x62c8, 0x82ff, 0x00c0, 0x47ef, + 0x62c4, 0x82ff, 0x00c0, 0x47ef, 0x793c, 0xa1e5, 0x0000, 0x0040, + 0x47ed, 0x2009, 0x0049, 0x1078, 0x5c29, 0x0c7f, 0x007c, 0x3908, + 0xa192, 0x797a, 0x00c8, 0x47f6, 0x1078, 0x5b2c, 0x6017, 0x0010, + 0x793c, 0x81ff, 0x0040, 0x47ed, 0x7944, 0xa192, 0x7530, 0x00c8, + 0x4815, 0x8108, 0x7946, 0x1078, 0x45f0, 0x793c, 0xa188, 0x0007, + 0x210c, 0xa18e, 0x0006, 0x00c0, 0x4811, 0x6017, 0x0012, 0x0078, + 0x47ed, 0x6017, 0x0016, 0x0078, 0x47ed, 0x037e, 0x2019, 0x0001, + 0x1078, 0x5768, 0x037f, 0x1078, 0x75c7, 0x793c, 0x2160, 0x2009, + 0x004a, 0x1078, 0x5c29, 0x0078, 0x47ed, 0x007e, 0x017e, 0x0c7e, + 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0x7836, + 0x6020, 0x8000, 0x6022, 0x6010, 0xa005, 0x0040, 0x4840, 0xa080, + 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, + 0x6116, 0x6112, 0x0078, 0x483b, 0x0d7e, 0x2069, 0x7836, 0x6000, + 0xd0d4, 0x0040, 0x4859, 0x6820, 0x8000, 0x6822, 0xa086, 0x0001, + 0x00c0, 0x4854, 0x2c00, 0x681e, 0x6804, 0xa084, 0x0007, 0x0079, + 0x4c82, 0xc0d5, 0x6002, 0x6818, 0xa005, 0x0040, 0x486b, 0x6056, + 0x605b, 0x0000, 0x007e, 0x2c00, 0x681a, 0x0d7f, 0x685a, 0x2069, + 0x7836, 0x0078, 0x484b, 0x6056, 0x605a, 0x2c00, 0x681a, 0x681e, + 0x0078, 0x484b, 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, + 0x600f, 0x0000, 0x2c08, 0x2061, 0x7836, 0x6020, 0x8000, 0x6022, + 0x6008, 0xa005, 0x0040, 0x488d, 0xa080, 0x0003, 0x2102, 0x610a, + 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x610e, 0x610a, 0x0078, + 0x4888, 0x0c7e, 0x600f, 0x0000, 0x2c08, 0x2061, 0x7836, 0x6034, + 0xa005, 0x0040, 0x48a1, 0xa080, 0x0003, 0x2102, 0x6136, 0x0c7f, + 0x007c, 0x613a, 0x6136, 0x0078, 0x489f, 0x0f7e, 0x0e7e, 0x0d7e, + 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2071, 0x7836, 0x7638, + 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x4907, 0x6018, + 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x4902, 0x703c, 0xac06, + 0x00c0, 0x48c7, 0x6003, 0x000a, 0x630a, 0x0078, 0x4902, 0x7038, + 0xac36, 0x00c0, 0x48cd, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, + 0x48db, 0x2c00, 0xaf36, 0x0040, 0x48d9, 0x2f00, 0x7036, 0x0078, + 0x48db, 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, + 0x48e4, 0x7e0e, 0x0078, 0x48e5, 0x2678, 0x600f, 0x0000, 0x1078, + 0x693e, 0x0040, 0x48fd, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, + 0x00c0, 0x4910, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, + 0x6b3f, 0x1078, 0x3a7a, 0x1078, 0x6a94, 0x1078, 0x6aa1, 0x0c7f, + 0x0078, 0x48b4, 0x2c78, 0x600c, 0x2060, 0x0078, 0x48b4, 0x127f, + 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, + 0x601c, 0xa086, 0x0006, 0x00c0, 0x48f2, 0x1078, 0x74fd, 0x0078, + 0x48fd, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x0f7e, 0x2031, 0x0000, + 0x127e, 0x2091, 0x8000, 0x2079, 0x7836, 0x7838, 0xa065, 0x0040, + 0x4950, 0x600c, 0x007e, 0x600f, 0x0000, 0x783c, 0xac06, 0x00c0, + 0x4937, 0x6003, 0x000a, 0x630a, 0x2c30, 0x0078, 0x494d, 0x1078, + 0x693e, 0x0040, 0x494b, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, + 0x00c0, 0x4959, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, + 0x3a7a, 0x1078, 0x6a94, 0x1078, 0x6aa1, 0x007f, 0x0078, 0x4926, + 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f, 0x0c7f, 0x067f, 0x007f, + 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x4942, 0x1078, 0x74fd, + 0x0078, 0x494b, 0x027e, 0x1078, 0x4976, 0x1078, 0x4a0f, 0x027f, + 0x007c, 0x0f7e, 0x127e, 0x2079, 0x7836, 0x2091, 0x8000, 0x1078, + 0x4aa6, 0x1078, 0x4b0e, 0x127f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, + 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, + 0x7836, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0040, 0x49fe, 0x6018, + 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x49f9, 0x7024, 0xac06, + 0x00c0, 0x49bc, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x49b7, + 0x1078, 0x5582, 0x68c3, 0x0000, 0x1078, 0x5a32, 0x7027, 0x0000, + 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x49ac, + 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, + 0x0040, 0x49b4, 0x6827, 0x0001, 0x037f, 0x0078, 0x49bc, 0x6003, + 0x0009, 0x630a, 0x0078, 0x49f9, 0x7014, 0xac36, 0x00c0, 0x49c2, + 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x49d0, 0x2c00, 0xaf36, + 0x0040, 0x49ce, 0x2f00, 0x7012, 0x0078, 0x49d0, 0x7013, 0x0000, + 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x49d9, 0x7e0e, 0x0078, + 0x49da, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078, 0x693e, + 0x0040, 0x49f2, 0x601c, 0xa086, 0x0003, 0x00c0, 0x4a06, 0x6837, + 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x6b3f, 0x1078, 0x3a7a, + 0x1078, 0x6a94, 0x1078, 0x6aa1, 0x1078, 0x5902, 0x0c7f, 0x0078, + 0x4984, 0x2c78, 0x600c, 0x2060, 0x0078, 0x4984, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, - 0x0006, 0x00c0, 0x44e1, 0x1078, 0x6bb3, 0x0078, 0x44ea, 0x0c7e, - 0x007e, 0x127e, 0x2091, 0x8000, 0xa280, 0x6e00, 0x2004, 0xa065, - 0x0040, 0x4595, 0x0f7e, 0x0e7e, 0x0d7e, 0x067e, 0x2071, 0x6f10, - 0x6654, 0x7018, 0xac06, 0x00c0, 0x451e, 0x761a, 0x701c, 0xac06, - 0x00c0, 0x452a, 0x86ff, 0x00c0, 0x4529, 0x7018, 0x701e, 0x0078, - 0x452a, 0x761e, 0x6058, 0xa07d, 0x0040, 0x452f, 0x7e56, 0xa6ed, - 0x0000, 0x0040, 0x4535, 0x2f00, 0x685a, 0x6057, 0x0000, 0x605b, - 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x33c4, 0x0040, - 0x4591, 0x7624, 0x86ff, 0x0040, 0x4586, 0xa680, 0x0004, 0x2004, - 0xad06, 0x00c0, 0x4586, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, - 0x0040, 0x457d, 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4, + 0x0006, 0x00c0, 0x49e7, 0x1078, 0x74fd, 0x0078, 0x49f2, 0x0c7e, + 0x007e, 0x127e, 0x2091, 0x8000, 0xa280, 0x7720, 0x2004, 0xa065, + 0x0040, 0x4aa2, 0x0f7e, 0x0e7e, 0x0d7e, 0x067e, 0x2071, 0x7836, + 0x6654, 0x7018, 0xac06, 0x00c0, 0x4a26, 0x761a, 0x701c, 0xac06, + 0x00c0, 0x4a32, 0x86ff, 0x00c0, 0x4a31, 0x7018, 0x701e, 0x0078, + 0x4a32, 0x761e, 0x6058, 0xa07d, 0x0040, 0x4a37, 0x7e56, 0xa6ed, + 0x0000, 0x0040, 0x4a3d, 0x2f00, 0x685a, 0x6057, 0x0000, 0x605b, + 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x37a2, 0x0040, + 0x4a9e, 0x7624, 0x86ff, 0x0040, 0x4a8e, 0xa680, 0x0004, 0x2004, + 0xad06, 0x00c0, 0x4a8e, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, + 0x0040, 0x4a85, 0x1078, 0x5582, 0x68c3, 0x0000, 0x1078, 0x5a32, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, - 0x0040, 0x4566, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, - 0x6824, 0xd084, 0x0040, 0x456e, 0x6827, 0x0001, 0x037f, 0x0d7f, - 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4577, 0x8001, 0x603e, 0x2660, - 0x1078, 0x6283, 0x0c7f, 0x0078, 0x4586, 0x0d7f, 0x0c7e, 0x2660, - 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x453d, 0x6837, 0x0103, - 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1, 0x1078, 0x5374, 0x0078, - 0x453d, 0x067f, 0x0d7f, 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f, - 0x007c, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814, - 0xa065, 0x0040, 0x45f1, 0x600c, 0x007e, 0x600f, 0x0000, 0x7824, - 0xac06, 0x00c0, 0x45d6, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, - 0x45d0, 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4, 0x7827, - 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, - 0x45c5, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, - 0xd084, 0x0040, 0x45cd, 0x6827, 0x0001, 0x037f, 0x0078, 0x45d6, - 0x6003, 0x0009, 0x630a, 0x2c30, 0x0078, 0x45ee, 0x6010, 0x2068, - 0x1078, 0x6120, 0x0040, 0x45ea, 0x601c, 0xa086, 0x0003, 0x00c0, - 0x45f8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1, - 0x1078, 0x6276, 0x1078, 0x6283, 0x1078, 0x5374, 0x007f, 0x0078, - 0x45a0, 0x7e16, 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, - 0x601c, 0xa086, 0x0006, 0x00c0, 0x45e1, 0x1078, 0x6bb3, 0x0078, - 0x45ea, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040, - 0x466a, 0x6054, 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, - 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x33c4, 0x0040, 0x4667, 0x7e24, - 0x86ff, 0x0040, 0x465c, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, - 0x465c, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4653, - 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4, 0x7827, 0x0000, - 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x463c, - 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, - 0x0040, 0x4644, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, - 0xa005, 0x0040, 0x464d, 0x8001, 0x603e, 0x2660, 0x1078, 0x6283, - 0x0c7f, 0x0078, 0x465c, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, - 0x630a, 0x0c7f, 0x0078, 0x4613, 0x6837, 0x0103, 0x6b4a, 0x6847, - 0x0000, 0x1078, 0x36a1, 0x1078, 0x5374, 0x0078, 0x4613, 0x007f, - 0x0078, 0x4606, 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f, 0x007f, - 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x6f10, 0x7004, 0xa084, 0x0007, - 0x0079, 0x467a, 0x4684, 0x4687, 0x46a0, 0x46bc, 0x4701, 0x4684, - 0x4682, 0x4682, 0x1078, 0x12b7, 0x0c7f, 0x0e7f, 0x007c, 0x7024, - 0xa065, 0x0040, 0x4695, 0x7020, 0x8001, 0x7022, 0x600c, 0xa015, - 0x0040, 0x469c, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, - 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078, 0x4695, - 0x6018, 0x2060, 0x1078, 0x33c4, 0x6000, 0xc0dc, 0x6002, 0x7020, - 0x8001, 0x7022, 0x0040, 0x46b1, 0x6054, 0xa015, 0x0040, 0x46b8, + 0x0040, 0x4a6e, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, + 0x6824, 0xd084, 0x0040, 0x4a76, 0x6827, 0x0001, 0x037f, 0x0d7f, + 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4a7f, 0x8001, 0x603e, 0x2660, + 0x1078, 0x6aa1, 0x0c7f, 0x0078, 0x4a8e, 0x0d7f, 0x0c7e, 0x2660, + 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x4a45, 0x8dff, 0x0040, + 0x4a9a, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x6b3f, + 0x1078, 0x3a7a, 0x1078, 0x5902, 0x0078, 0x4a45, 0x067f, 0x0d7f, + 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f, 0x007c, 0x007e, 0x067e, + 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814, 0xa065, 0x0040, 0x4afe, + 0x600c, 0x007e, 0x600f, 0x0000, 0x7824, 0xac06, 0x00c0, 0x4ae3, + 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4add, 0x1078, 0x5582, + 0x68c3, 0x0000, 0x1078, 0x5a32, 0x7827, 0x0000, 0x037e, 0x2069, + 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x4ad2, 0x6803, 0x0100, + 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4ada, + 0x6827, 0x0001, 0x037f, 0x0078, 0x4ae3, 0x6003, 0x0009, 0x630a, + 0x2c30, 0x0078, 0x4afb, 0x6010, 0x2068, 0x1078, 0x693e, 0x0040, + 0x4af7, 0x601c, 0xa086, 0x0003, 0x00c0, 0x4b05, 0x6837, 0x0103, + 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3a7a, 0x1078, 0x6a94, 0x1078, + 0x6aa1, 0x1078, 0x5902, 0x007f, 0x0078, 0x4aad, 0x7e16, 0x7e12, + 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, + 0x00c0, 0x4aee, 0x1078, 0x74fd, 0x0078, 0x4af7, 0x007e, 0x067e, + 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040, 0x4b7a, 0x6054, 0x007e, + 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, + 0x1078, 0x37a2, 0x0040, 0x4b77, 0x7e24, 0x86ff, 0x0040, 0x4b69, + 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x4b69, 0x0d7e, 0x2069, + 0x0100, 0x68c0, 0xa005, 0x0040, 0x4b60, 0x1078, 0x5582, 0x68c3, + 0x0000, 0x1078, 0x5a32, 0x7827, 0x0000, 0x037e, 0x2069, 0x0140, + 0x6b04, 0xa384, 0x1000, 0x0040, 0x4b49, 0x6803, 0x0100, 0x6803, + 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4b51, 0x6827, + 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4b5a, + 0x8001, 0x603e, 0x2660, 0x1078, 0x6aa1, 0x0c7f, 0x0078, 0x4b69, + 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, + 0x4b20, 0x8dff, 0x0040, 0x4b73, 0x6837, 0x0103, 0x6b4a, 0x6847, + 0x0000, 0x1078, 0x3a7a, 0x1078, 0x5902, 0x0078, 0x4b20, 0x007f, + 0x0078, 0x4b13, 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f, 0x007f, + 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x7836, 0x7004, 0xa084, 0x0007, + 0x0079, 0x4b8a, 0x4b94, 0x4b97, 0x4bb0, 0x4bcc, 0x4c11, 0x4b94, + 0x4b94, 0x4b92, 0x1078, 0x12d5, 0x0c7f, 0x0e7f, 0x007c, 0x7024, + 0xa065, 0x0040, 0x4ba5, 0x7020, 0x8001, 0x7022, 0x600c, 0xa015, + 0x0040, 0x4bac, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, + 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078, 0x4ba5, + 0x6018, 0x2060, 0x1078, 0x37a2, 0x6000, 0xc0dc, 0x6002, 0x7020, + 0x8001, 0x7022, 0x0040, 0x4bc1, 0x6054, 0xa015, 0x0040, 0x4bc8, 0x721e, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, - 0x7218, 0x721e, 0x0078, 0x46b1, 0x7024, 0xa065, 0x0040, 0x46fe, - 0x700c, 0xac06, 0x00c0, 0x46d3, 0x1078, 0x5374, 0x600c, 0xa015, - 0x0040, 0x46cf, 0x720e, 0x600f, 0x0000, 0x0078, 0x46fc, 0x720e, - 0x720a, 0x0078, 0x46fc, 0x7014, 0xac06, 0x00c0, 0x46e6, 0x1078, - 0x5374, 0x600c, 0xa015, 0x0040, 0x46e2, 0x7216, 0x600f, 0x0000, - 0x0078, 0x46fc, 0x7216, 0x7212, 0x0078, 0x46fc, 0x6018, 0x2060, - 0x1078, 0x33c4, 0x6000, 0xc0dc, 0x6002, 0x1078, 0x5374, 0x701c, - 0xa065, 0x0040, 0x46fc, 0x6054, 0xa015, 0x0040, 0x46fa, 0x721e, - 0x0078, 0x46fc, 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f, 0x0e7f, - 0x007c, 0x7024, 0xa065, 0x0040, 0x470e, 0x1078, 0x5374, 0x600c, - 0xa015, 0x0040, 0x4715, 0x720e, 0x600f, 0x0000, 0x1078, 0x54a4, + 0x7218, 0x721e, 0x0078, 0x4bc1, 0x7024, 0xa065, 0x0040, 0x4c0e, + 0x700c, 0xac06, 0x00c0, 0x4be3, 0x1078, 0x5902, 0x600c, 0xa015, + 0x0040, 0x4bdf, 0x720e, 0x600f, 0x0000, 0x0078, 0x4c0c, 0x720e, + 0x720a, 0x0078, 0x4c0c, 0x7014, 0xac06, 0x00c0, 0x4bf6, 0x1078, + 0x5902, 0x600c, 0xa015, 0x0040, 0x4bf2, 0x7216, 0x600f, 0x0000, + 0x0078, 0x4c0c, 0x7216, 0x7212, 0x0078, 0x4c0c, 0x6018, 0x2060, + 0x1078, 0x37a2, 0x6000, 0xc0dc, 0x6002, 0x1078, 0x5902, 0x701c, + 0xa065, 0x0040, 0x4c0c, 0x6054, 0xa015, 0x0040, 0x4c0a, 0x721e, + 0x0078, 0x4c0c, 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f, 0x0e7f, + 0x007c, 0x7024, 0xa065, 0x0040, 0x4c1e, 0x1078, 0x5902, 0x600c, + 0xa015, 0x0040, 0x4c25, 0x720e, 0x600f, 0x0000, 0x1078, 0x5a32, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a, 0x0078, - 0x470e, 0x0d7e, 0x2069, 0x6f10, 0x6830, 0xa084, 0x0003, 0x0079, - 0x4721, 0x4727, 0x4729, 0x474f, 0x4725, 0x1078, 0x12b7, 0x0d7f, - 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040, 0x4745, 0x683c, - 0xa065, 0x0040, 0x473a, 0x600c, 0xa015, 0x0040, 0x4741, 0x6a3a, + 0x4c1e, 0x0d7e, 0x2069, 0x7836, 0x6830, 0xa084, 0x0003, 0x0079, + 0x4c31, 0x4c37, 0x4c39, 0x4c5f, 0x4c37, 0x1078, 0x12d5, 0x0d7f, + 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040, 0x4c55, 0x683c, + 0xa065, 0x0040, 0x4c4a, 0x600c, 0xa015, 0x0040, 0x4c51, 0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c7f, 0x0d7f, - 0x007c, 0x683a, 0x6836, 0x0078, 0x473a, 0x6843, 0x0000, 0x6838, - 0xa065, 0x0040, 0x473a, 0x6003, 0x0003, 0x0078, 0x473a, 0x0c7e, - 0x6843, 0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0040, 0x4767, - 0x600c, 0xa015, 0x0040, 0x4763, 0x6a3a, 0x600f, 0x0000, 0x683f, - 0x0000, 0x0078, 0x4767, 0x683f, 0x0000, 0x683a, 0x6836, 0x0c7f, - 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x6f10, 0x6804, 0xa084, 0x0007, - 0x0079, 0x4772, 0x477c, 0x4810, 0x4810, 0x4810, 0x4810, 0x4812, - 0x477a, 0x477a, 0x1078, 0x12b7, 0x6820, 0xa005, 0x00c0, 0x4782, - 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x4791, 0x6807, - 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x4858, 0x0c7f, 0x0d7f, - 0x007c, 0x6814, 0xa065, 0x0040, 0x479f, 0x6807, 0x0001, 0x6826, - 0x682b, 0x0000, 0x1078, 0x4858, 0x0c7f, 0x0d7f, 0x007c, 0x0e7e, - 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x480b, 0x704c, 0xa00d, - 0x0040, 0x47ae, 0x7088, 0xa005, 0x0040, 0x47c6, 0x7054, 0xa075, - 0x0040, 0x47b7, 0xa20e, 0x0040, 0x480b, 0x0078, 0x47bc, 0x6818, - 0xa20e, 0x0040, 0x480b, 0x2070, 0x704c, 0xa00d, 0x0040, 0x47ae, - 0x7088, 0xa005, 0x00c0, 0x47ae, 0x2e00, 0x681e, 0x733c, 0x7038, - 0xa302, 0x00c8, 0x47ae, 0x1078, 0x5539, 0x0040, 0x480b, 0x8318, + 0x007c, 0x683a, 0x6836, 0x0078, 0x4c4a, 0x6843, 0x0000, 0x6838, + 0xa065, 0x0040, 0x4c4a, 0x6003, 0x0003, 0x0078, 0x4c4a, 0x0c7e, + 0x6843, 0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0040, 0x4c77, + 0x600c, 0xa015, 0x0040, 0x4c73, 0x6a3a, 0x600f, 0x0000, 0x683f, + 0x0000, 0x0078, 0x4c77, 0x683f, 0x0000, 0x683a, 0x6836, 0x0c7f, + 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x7836, 0x6804, 0xa084, 0x0007, + 0x0079, 0x4c82, 0x4c8c, 0x4d29, 0x4d29, 0x4d29, 0x4d29, 0x4d2b, + 0x4d29, 0x4c8a, 0x1078, 0x12d5, 0x6820, 0xa005, 0x00c0, 0x4c92, + 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x4ca1, 0x6807, + 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x4d71, 0x0c7f, 0x0d7f, + 0x007c, 0x6814, 0xa065, 0x0040, 0x4caf, 0x6807, 0x0001, 0x6826, + 0x682b, 0x0000, 0x1078, 0x4d71, 0x0c7f, 0x0d7f, 0x007c, 0x0e7e, + 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x4d24, 0x704c, 0xa00d, + 0x0040, 0x4cbe, 0x7088, 0xa005, 0x0040, 0x4cd6, 0x7054, 0xa075, + 0x0040, 0x4cc7, 0xa20e, 0x0040, 0x4d24, 0x0078, 0x4ccc, 0x6818, + 0xa20e, 0x0040, 0x4d24, 0x2070, 0x704c, 0xa00d, 0x0040, 0x4cbe, + 0x7088, 0xa005, 0x00c0, 0x4cbe, 0x2e00, 0x681e, 0x733c, 0x7038, + 0xa302, 0x00c8, 0x4cbe, 0x1078, 0x5bd1, 0x0040, 0x4d24, 0x8318, 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180, 0x0015, 0x2004, 0xa08a, - 0x199a, 0x0048, 0x47dd, 0x2001, 0x1999, 0x8003, 0x801b, 0x831b, + 0x199a, 0x0048, 0x4ced, 0x2001, 0x1999, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xd1bc, 0x0040, - 0x47ed, 0x2009, 0x0000, 0x0078, 0x47f2, 0xa1e0, 0x2091, 0x2c0c, - 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078, 0x4c44, 0x7300, - 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000, - 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x0f7f, 0x0e7f, - 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f, 0x0078, 0x4809, - 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x481e, 0x6807, - 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x4858, 0x0c7f, 0x0d7f, - 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0x6f10, 0x6830, 0xa086, 0x0000, - 0x00c0, 0x483f, 0x6838, 0xa07d, 0x0040, 0x483f, 0x6833, 0x0001, - 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091, 0x2200, 0x027f, - 0x1078, 0x1838, 0x00c0, 0x4842, 0x127f, 0x1078, 0x4ed5, 0x0d7f, - 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000, 0x7803, 0x0002, 0x780c, - 0xa015, 0x0040, 0x4854, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000, - 0x683f, 0x0000, 0x0078, 0x483f, 0x683a, 0x6836, 0x0078, 0x484e, - 0x601c, 0xa084, 0x000f, 0x1079, 0x485e, 0x007c, 0x4867, 0x4869, - 0x4b33, 0x4c15, 0x4869, 0x4b33, 0x4c15, 0x4867, 0x4869, 0x1078, - 0x12b7, 0x157e, 0x137e, 0x147e, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, - 0x0024, 0x10c8, 0x12b7, 0x6118, 0x2178, 0x79a0, 0xa1f8, 0x2091, - 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0x1079, - 0x4887, 0x0f7f, 0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c, 0x48ad, - 0x48ec, 0x4904, 0x494c, 0x4979, 0x4981, 0x49a2, 0x49b3, 0x49c4, - 0x49cc, 0x49dd, 0x49cc, 0x4a25, 0x49b3, 0x4a55, 0x4a5d, 0x49c4, - 0x4a5d, 0x4a6e, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab, - 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x50b8, 0x50cd, - 0x50f0, 0x5114, 0x49a2, 0x1078, 0x12b7, 0x20a1, 0x020b, 0x1078, - 0x4a83, 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x6d51, - 0x6804, 0xd084, 0x0040, 0x48ce, 0x6828, 0x017e, 0x2069, 0x6d00, - 0x694c, 0xa106, 0x017f, 0x00c0, 0x48ce, 0x20a3, 0x0000, 0x6030, - 0xa084, 0x00ff, 0x20a2, 0x0d7f, 0x0078, 0x48d3, 0x0d7f, 0x20a3, - 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x6d05, 0x53a6, - 0x20a9, 0x0004, 0x2099, 0x6d01, 0x53a6, 0x20a3, 0x0000, 0x6030, - 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, - 0x001c, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83, - 0x20a3, 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030, 0xa084, - 0x00ff, 0x20a2, 0x20a9, 0x0004, 0x2099, 0x6d05, 0x53a6, 0x60c3, - 0x0010, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83, - 0x7818, 0xa080, 0x0028, 0x2004, 0xa086, 0x007e, 0x00c0, 0x4917, - 0x20a3, 0x0400, 0x620c, 0xc2b4, 0x620e, 0x0078, 0x4919, 0x20a3, - 0x0300, 0x20a3, 0x0000, 0x2099, 0x6f00, 0x20a9, 0x0008, 0x53a6, - 0x20a9, 0x0004, 0x2099, 0x6d05, 0x53a6, 0x20a9, 0x0004, 0x2099, - 0x6d01, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x492c, - 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4932, 0x2099, 0x6f08, + 0x4d06, 0x7100, 0xd1f4, 0x0040, 0x4d02, 0x7114, 0xa18c, 0x00ff, + 0x0078, 0x4d0b, 0x2009, 0x0000, 0x0078, 0x4d0b, 0xa1e0, 0x232f, + 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078, 0x51c2, + 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, + 0x0000, 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x0f7f, + 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f, 0x0078, + 0x4d22, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x4d37, + 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x4d71, 0x0c7f, + 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0x7836, 0x6830, 0xa086, + 0x0000, 0x00c0, 0x4d58, 0x6838, 0xa07d, 0x0040, 0x4d58, 0x6833, + 0x0001, 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091, 0x2200, + 0x027f, 0x1078, 0x1a4c, 0x00c0, 0x4d5b, 0x127f, 0x1078, 0x5457, + 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000, 0x7803, 0x0002, + 0x780c, 0xa015, 0x0040, 0x4d6d, 0x6a3a, 0x780f, 0x0000, 0x6833, + 0x0000, 0x683f, 0x0000, 0x0078, 0x4d58, 0x683a, 0x6836, 0x0078, + 0x4d67, 0x601c, 0xa084, 0x000f, 0x1079, 0x4d77, 0x007c, 0x4d80, + 0x4d85, 0x508c, 0x5182, 0x4d85, 0x508c, 0x5182, 0x4d80, 0x4d85, + 0x1078, 0x4b81, 0x1078, 0x4c7a, 0x007c, 0x157e, 0x137e, 0x147e, + 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x12d5, 0x6118, + 0x2178, 0x79a0, 0xd1bc, 0x0040, 0x4da2, 0x7900, 0xd1f4, 0x0040, + 0x4d9e, 0x7914, 0xa18c, 0x00ff, 0x0078, 0x4da7, 0x2009, 0x0000, + 0x0078, 0x4da7, 0xa1f8, 0x232f, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, + 0x2061, 0x0100, 0x619a, 0x1079, 0x4db3, 0x0f7f, 0x0c7f, 0x147f, + 0x137f, 0x157f, 0x007c, 0x4de5, 0x4e1d, 0x4e35, 0x4eb4, 0x4ee1, + 0x4ee9, 0x4f0a, 0x4f1b, 0x4f2c, 0x4f34, 0x4f45, 0x4f34, 0x4f8d, + 0x4f1b, 0x4fae, 0x4fb6, 0x4f2c, 0x4fb6, 0x4fc7, 0x4de3, 0x4de3, + 0x4de3, 0x4de3, 0x4de3, 0x4de3, 0x4de3, 0x4de3, 0x4de3, 0x4de3, + 0x4de3, 0x4de3, 0x5640, 0x5655, 0x5678, 0x569c, 0x4f0a, 0x4de3, + 0x4f0a, 0x4f34, 0x4de3, 0x4e35, 0x4eb4, 0x4de3, 0x5b4c, 0x4f34, + 0x4de3, 0x5b6f, 0x4f34, 0x1078, 0x12d5, 0x20a1, 0x020b, 0x1078, + 0x4fdc, 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x7651, + 0x6804, 0xd084, 0x0040, 0x4dff, 0x6828, 0x20a3, 0x0000, 0x017e, + 0x1078, 0x209a, 0x21a2, 0x017f, 0x0d7f, 0x0078, 0x4e04, 0x0d7f, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x7605, + 0x53a6, 0x20a9, 0x0004, 0x2099, 0x7601, 0x53a6, 0x20a3, 0x0000, + 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x60c3, 0x001c, 0x1078, 0x556e, 0x007c, 0x20a1, 0x020b, 0x1078, + 0x4fdc, 0x20a3, 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030, + 0xa084, 0x00ff, 0x20a2, 0x20a9, 0x0004, 0x2099, 0x7605, 0x53a6, + 0x60c3, 0x0010, 0x1078, 0x556e, 0x007c, 0x20a1, 0x020b, 0x1078, + 0x4fdc, 0x7818, 0xa080, 0x0028, 0x2004, 0xa086, 0x007e, 0x00c0, + 0x4e48, 0x20a3, 0x0400, 0x620c, 0xc2b4, 0x620e, 0x0078, 0x4e4a, + 0x20a3, 0x0300, 0x20a3, 0x0000, 0x7818, 0xa080, 0x0028, 0x2004, + 0xa086, 0x007e, 0x00c0, 0x4e83, 0x2099, 0x7820, 0x33a6, 0x9398, + 0x33a6, 0x9398, 0x3304, 0xa084, 0x3fff, 0x20a2, 0x9398, 0x33a6, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x20a9, 0x0004, 0x2099, 0x7605, 0x53a6, 0x20a9, 0x0004, 0x2099, + 0x7601, 0x53a6, 0x20a9, 0x0010, 0x20a3, 0x0000, 0x00f0, 0x4e74, + 0x2099, 0x7828, 0x33a6, 0x20a9, 0x0007, 0x20a3, 0x0000, 0x00f0, + 0x4e7d, 0x0078, 0x4ea3, 0x2099, 0x7820, 0x20a9, 0x0008, 0x53a6, + 0x20a9, 0x0004, 0x2099, 0x7605, 0x53a6, 0x20a9, 0x0004, 0x2099, + 0x7601, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4e94, + 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4e9a, 0x2099, 0x7828, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, - 0x493d, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x4943, 0x60c3, - 0x0074, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83, + 0x4ea5, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x4eab, 0x60c3, + 0x0074, 0x1078, 0x556e, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4fdc, 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, - 0x6d51, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4968, 0xa085, 0x0020, - 0xd1a4, 0x0040, 0x496d, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, - 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4fd1, - 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83, 0x20a3, 0x5000, 0x0078, - 0x4919, 0x20a1, 0x020b, 0x1078, 0x4a83, 0x20a3, 0x2110, 0x20a3, - 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0x20a3, 0x0000, 0x20a3, + 0x7651, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4ed0, 0xa085, 0x0020, + 0xd1a4, 0x0040, 0x4ed5, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, + 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x556e, + 0x007c, 0x20a1, 0x020b, 0x1078, 0x4fdc, 0x20a3, 0x5000, 0x0078, + 0x4e4a, 0x20a1, 0x020b, 0x1078, 0x4fdc, 0x20a3, 0x2110, 0x20a3, + 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, - 0x0022, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, - 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4afa, 0x20a3, 0x0200, + 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, + 0x556e, 0x007c, 0x20a1, 0x020b, 0x1078, 0x5053, 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, - 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4afa, 0x20a3, + 0x1078, 0x556e, 0x007c, 0x20a1, 0x020b, 0x1078, 0x5053, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, - 0x0008, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4afa, - 0x20a3, 0x0200, 0x0078, 0x4919, 0x20a1, 0x020b, 0x1078, 0x4afa, + 0x0008, 0x1078, 0x556e, 0x007c, 0x20a1, 0x020b, 0x1078, 0x5053, + 0x20a3, 0x0200, 0x0078, 0x4e4a, 0x20a1, 0x020b, 0x1078, 0x5053, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x7810, 0x20a2, - 0x60c3, 0x0008, 0x1078, 0x4fd1, 0x007c, 0x0d7e, 0x20a1, 0x020b, - 0x1078, 0x4afa, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800, - 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0, 0x4a03, 0x6998, - 0xa184, 0xc000, 0x00c0, 0x49ff, 0xd1ec, 0x0040, 0x49fb, 0x20a3, - 0x2100, 0x0078, 0x4a05, 0x20a3, 0x0100, 0x0078, 0x4a05, 0x20a3, - 0x0400, 0x0078, 0x4a05, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2, - 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x6d51, 0x7904, 0x0f7f, - 0xd1ac, 0x00c0, 0x4a15, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x4a1a, + 0x60c3, 0x0008, 0x1078, 0x556e, 0x007c, 0x0d7e, 0x20a1, 0x020b, + 0x1078, 0x5053, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800, + 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0, 0x4f6b, 0x6998, + 0xa184, 0xc000, 0x00c0, 0x4f67, 0xd1ec, 0x0040, 0x4f63, 0x20a3, + 0x2100, 0x0078, 0x4f6d, 0x20a3, 0x0100, 0x0078, 0x4f6d, 0x20a3, + 0x0400, 0x0078, 0x4f6d, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2, + 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x7651, 0x7904, 0x0f7f, + 0xd1ac, 0x00c0, 0x4f7d, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x4f82, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a2, 0x20a2, 0x60c3, - 0x0014, 0x1078, 0x4fd1, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, - 0x4afa, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x6018, - 0x0d7e, 0x2068, 0x6804, 0x0d7f, 0xa084, 0x00ff, 0xa086, 0x0006, - 0x0040, 0x4a3e, 0x20a3, 0x0400, 0x0078, 0x4a40, 0x20a3, 0x0100, - 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, - 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, - 0x60c3, 0x0014, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, - 0x4afa, 0x20a3, 0x0200, 0x0078, 0x48b3, 0x20a1, 0x020b, 0x1078, - 0x4afa, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, - 0x2a00, 0x60c3, 0x0008, 0x1078, 0x4fd1, 0x007c, 0x20e1, 0x9080, - 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078, 0x4afa, 0x20a3, 0x0100, - 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008, - 0x1078, 0x4fd1, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, - 0x7818, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e, 0x00c0, 0x4a96, - 0x20a3, 0x22ff, 0x20a3, 0xfffe, 0x0078, 0x4ac4, 0xa286, 0x007f, - 0x00c0, 0x4aa1, 0x0d7e, 0x20a3, 0x22ff, 0x20a3, 0xfffd, 0x0078, - 0x4ab8, 0xd2bc, 0x0040, 0x4ac0, 0xa286, 0x0080, 0x0d7e, 0x00c0, - 0x4aaf, 0x20a3, 0x22ff, 0x20a3, 0xfffc, 0x0078, 0x4ab8, 0xa2e8, - 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x2200, 0x20a2, 0x6814, 0x20a2, - 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4ac8, - 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, - 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2, 0x20a3, - 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, - 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, - 0x02ff, 0x2011, 0xfffc, 0x22a2, 0x0d7e, 0x2069, 0x6d19, 0x2da6, - 0x8d68, 0x2da6, 0x0d7f, 0x20a3, 0x2029, 0x20a3, 0x0000, 0x0078, - 0x4acc, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0xfc02, 0x20a3, - 0x0000, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, - 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x4b19, 0x0d7e, - 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x2300, 0x20a2, 0x6814, - 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, - 0x4b21, 0x20a3, 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, - 0x22a2, 0x20a3, 0x0198, 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2, - 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, - 0x0000, 0x027f, 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0025, - 0x1048, 0x12b7, 0xa08a, 0x002c, 0x10c8, 0x12b7, 0x6118, 0x2178, - 0x79a0, 0xa1f8, 0x2091, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, - 0x0100, 0x619a, 0xa082, 0x0025, 0x1079, 0x4b51, 0x0f7f, 0x0c7f, - 0x007c, 0x4b5a, 0x4b65, 0x4b7f, 0x4b58, 0x4b58, 0x4b58, 0x4b5a, - 0x1078, 0x12b7, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4b8e, 0x60c3, - 0x0000, 0x1078, 0x4fd1, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, - 0x1078, 0x4bbb, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, - 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, - 0x0000, 0x60c3, 0x000c, 0x1078, 0x4fd1, 0x147f, 0x007c, 0x147e, - 0x20a1, 0x020b, 0x1078, 0x4be8, 0x20a3, 0x0003, 0x20a3, 0x0300, - 0x60c3, 0x0004, 0x1078, 0x4fd1, 0x147f, 0x007c, 0x027e, 0x20e1, - 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, - 0x007e, 0x0048, 0x4bad, 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c, 0x6810, - 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x6d19, 0x2da6, - 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4bb5, 0x20a3, 0x8100, 0x6298, - 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0009, 0x20a3, - 0x0000, 0x0078, 0x4acc, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, - 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x4bda, - 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x8400, 0x20a2, - 0x6814, 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, - 0x0078, 0x4be2, 0x20a3, 0x8400, 0x6298, 0x22a2, 0x20a3, 0x0000, - 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4b25, - 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, - 0x2004, 0xa092, 0x007e, 0x0048, 0x4c07, 0x0d7e, 0xa0e8, 0x6e00, - 0x2d6c, 0x6810, 0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2, 0x2069, - 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4c0f, 0x20a3, - 0x8500, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, - 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4b25, 0x0c7e, 0x0f7e, 0x2c78, - 0x7804, 0xa08a, 0x0040, 0x1048, 0x12b7, 0xa08a, 0x004f, 0x10c8, - 0x12b7, 0x7918, 0x2160, 0x61a0, 0xa1e0, 0x2091, 0x2c0c, 0xa18c, - 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082, 0x0040, 0x1079, 0x4c33, - 0x0f7f, 0x0c7f, 0x007c, 0x4c44, 0x4d28, 0x4cd0, 0x4e50, 0x4c42, - 0x4c42, 0x4c42, 0x4c42, 0x4c42, 0x4c42, 0x4c42, 0x528d, 0x529e, - 0x52af, 0x52c0, 0x1078, 0x12b7, 0x0d7e, 0x157e, 0x147e, 0x20a1, - 0x020b, 0x1078, 0x4c93, 0x7910, 0x2168, 0x6944, 0xa18c, 0x00ff, - 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, 0x0006, - 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x4c61, 0x20a3, 0x0002, 0x0078, - 0x4c6d, 0xd1b4, 0x0040, 0x4c68, 0x20a3, 0x0001, 0x0078, 0x4c6d, - 0x20a3, 0x0000, 0x2230, 0x0078, 0x4c6f, 0x6a80, 0x6e7c, 0x20a9, - 0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000, 0x00f0, - 0x4c73, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014, - 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0x6f2c, 0x2003, - 0x07d0, 0x2001, 0x6f2b, 0x2003, 0x0009, 0x1078, 0x14e4, 0x147f, - 0x157f, 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7a18, - 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, - 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x4cb9, 0x0d7e, - 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x0600, 0x20a2, 0x6814, - 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, - 0x4cc1, 0x20a3, 0x0600, 0x6198, 0x21a2, 0x20a3, 0x0000, 0x6130, - 0x21a2, 0x20a3, 0x0829, 0x20a3, 0x0000, 0x22a2, 0x20a3, 0x0000, - 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x007c, - 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4cf0, - 0x7810, 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880, 0x20a2, - 0x687c, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x60c3, - 0x000c, 0x1078, 0x4fd1, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, - 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, - 0x2004, 0xd0bc, 0x0040, 0x4d0e, 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c, - 0x6810, 0xa085, 0x0500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x6d19, - 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4d16, 0x20a3, 0x0500, - 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889, - 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2, 0x20a3, 0x0000, 0x7a08, - 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, - 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e18, - 0x7810, 0x2068, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, - 0x7810, 0xa084, 0xf000, 0x00c0, 0x4d45, 0x7810, 0xa084, 0x0700, - 0x8007, 0x1079, 0x4d4d, 0x0078, 0x4d48, 0xa006, 0x1079, 0x4d4d, - 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x4d57, 0x4db9, 0x4dbd, - 0x4de0, 0x4ded, 0x4dff, 0x4e03, 0x4d55, 0x1078, 0x12b7, 0x017e, - 0x037e, 0x694c, 0xa18c, 0x0003, 0xa186, 0x0000, 0x00c0, 0x4d6a, - 0x6b78, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f, - 0x0078, 0x4de4, 0xa186, 0x0001, 0x00c0, 0x4db4, 0x6b78, 0x23a2, - 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2, - 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384, 0x0300, 0x0040, 0x4db3, - 0xd3c4, 0x0040, 0x4d85, 0x687c, 0xa108, 0xd3cc, 0x0040, 0x4d8a, - 0x6874, 0xa108, 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c, - 0x831f, 0x23a2, 0x8000, 0x00f0, 0x4d8f, 0x157f, 0x22a2, 0x22a2, - 0x22a2, 0xa184, 0x0003, 0x0040, 0x4db3, 0x20a1, 0x020b, 0x20e1, - 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, - 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a2, 0x1078, 0x4fc0, - 0x22a2, 0x20a3, 0x0000, 0x61c2, 0x037f, 0x017f, 0x1078, 0x4fd1, - 0x007c, 0x20a3, 0x0008, 0x0078, 0x4de2, 0x20a3, 0x0302, 0x22a2, - 0x22a2, 0x22a2, 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2, - 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2, - 0x20a3, 0x000a, 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2, - 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0032, 0x1078, 0x4fd1, 0x007c, - 0x20a3, 0x0028, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, - 0x60c3, 0x0018, 0x1078, 0x4fd1, 0x007c, 0x20a3, 0x0100, 0x22a2, - 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, - 0x22a2, 0x22a2, 0x60c3, 0x0020, 0x1078, 0x4fd1, 0x007c, 0x20a3, - 0x0008, 0x0078, 0x4de2, 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812, - 0xa384, 0x00ff, 0x8001, 0x00c0, 0x4e11, 0x22a2, 0x037f, 0x0078, - 0x4de2, 0x20a3, 0x0800, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x4de4, + 0x0014, 0x1078, 0x556e, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, + 0x5053, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, + 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x60c3, 0x0014, 0x1078, 0x556e, 0x007c, 0x20a1, 0x020b, + 0x1078, 0x5053, 0x20a3, 0x0200, 0x0078, 0x4deb, 0x20a1, 0x020b, + 0x1078, 0x5053, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, + 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078, 0x556e, 0x007c, 0x20e1, + 0x9080, 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078, 0x5053, 0x20a3, + 0x0100, 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, + 0x0008, 0x1078, 0x556e, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, + 0x4000, 0x7818, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e, 0x00c0, + 0x4fef, 0x20a3, 0x22ff, 0x20a3, 0xfffe, 0x0078, 0x501d, 0xa286, + 0x007f, 0x00c0, 0x4ffa, 0x0d7e, 0x20a3, 0x22ff, 0x20a3, 0xfffd, + 0x0078, 0x5011, 0xd2bc, 0x0040, 0x5019, 0xa286, 0x0080, 0x0d7e, + 0x00c0, 0x5008, 0x20a3, 0x22ff, 0x20a3, 0xfffc, 0x0078, 0x5011, + 0xa2e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x2200, 0x20a2, 0x6814, + 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, + 0x5021, 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, + 0x22a2, 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078, 0x555d, 0x22a2, + 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, + 0x20a3, 0x02ff, 0x2011, 0xfffc, 0x22a2, 0x0d7e, 0x2069, 0x7619, + 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x20a3, 0x2029, 0x20a3, 0x0000, + 0x0078, 0x5025, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0xfc02, + 0x20a3, 0x0000, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, + 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x5072, + 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x2300, 0x20a2, + 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, + 0x0078, 0x507a, 0x20a3, 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000, + 0x6230, 0x22a2, 0x20a3, 0x0198, 0x20a3, 0x0000, 0x1078, 0x555d, + 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x027f, 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, + 0x0085, 0x1048, 0x12d5, 0xa08a, 0x008c, 0x10c8, 0x12d5, 0x6118, + 0x2178, 0x79a0, 0xd1bc, 0x0040, 0x50aa, 0x7900, 0xd1f4, 0x0040, + 0x50a6, 0x7914, 0xa18c, 0x00ff, 0x0078, 0x50af, 0x2009, 0x0000, + 0x0078, 0x50af, 0xa1f8, 0x232f, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, + 0x2061, 0x0100, 0x619a, 0xa082, 0x0085, 0x1079, 0x50ba, 0x0f7f, + 0x0c7f, 0x007c, 0x50c3, 0x50ce, 0x50e8, 0x50c1, 0x50c1, 0x50c1, + 0x50c3, 0x1078, 0x12d5, 0x147e, 0x20a1, 0x020b, 0x1078, 0x50fb, + 0x60c3, 0x0000, 0x1078, 0x556e, 0x147f, 0x007c, 0x147e, 0x20a1, + 0x020b, 0x1078, 0x5128, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, + 0x20a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, + 0x20a3, 0x0000, 0x60c3, 0x000c, 0x1078, 0x556e, 0x147f, 0x007c, + 0x147e, 0x20a1, 0x020b, 0x1078, 0x5155, 0x20a3, 0x0003, 0x20a3, + 0x0300, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078, + 0x556e, 0x147f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, + 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x511a, + 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x8100, 0x20a2, + 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, + 0x0078, 0x5122, 0x20a3, 0x8100, 0x6298, 0x22a2, 0x20a3, 0x0000, + 0x6230, 0x22a2, 0x20a3, 0x0009, 0x20a3, 0x0000, 0x0078, 0x5025, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, - 0x2004, 0xd0bc, 0x0040, 0x4e36, 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c, - 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x6d19, - 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4e3e, 0x20a3, 0x0700, - 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, - 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2, 0x20a3, 0x0000, 0x7a08, - 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, - 0x0d7e, 0x157e, 0x137e, 0x147e, 0x017e, 0x037e, 0x7810, 0xa084, - 0x0700, 0x8007, 0x1079, 0x4e63, 0x037f, 0x017f, 0x147f, 0x137f, - 0x157f, 0x0d7f, 0x007c, 0x4e6b, 0x4e6b, 0x4e6d, 0x4e6b, 0x4e6b, - 0x4e6b, 0x4e92, 0x4e6b, 0x1078, 0x12b7, 0x7910, 0xa18c, 0xf8ff, - 0xa18d, 0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, - 0x4e9c, 0x0d7e, 0x2069, 0x6d51, 0x6804, 0xd0bc, 0x0040, 0x4e87, - 0x682c, 0xa084, 0x00ff, 0x8007, 0x20a2, 0x0078, 0x4e89, 0x20a3, - 0x3f00, 0x0d7f, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078, - 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4e9c, - 0x20a3, 0x7f00, 0x0078, 0x4e8a, 0x027e, 0x20e1, 0x9080, 0x20e1, - 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x4eba, - 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x0100, 0x20a2, - 0x6814, 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, - 0x0078, 0x4ec2, 0x20a3, 0x0100, 0x6298, 0x22a2, 0x20a3, 0x0000, - 0x6230, 0x22a2, 0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078, - 0x4fc0, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, - 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, - 0x057e, 0x047e, 0x037e, 0x2061, 0x0100, 0x2071, 0x6d00, 0x6130, - 0x7818, 0x2068, 0x68a0, 0x2028, 0xd0bc, 0x00c0, 0x4eee, 0xa080, - 0x2091, 0x2014, 0xa294, 0x00ff, 0x0078, 0x4ef2, 0x6910, 0x6a14, - 0x7364, 0x7468, 0x781c, 0xa086, 0x0006, 0x0040, 0x4f3d, 0xd5bc, - 0x0040, 0x4f02, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, - 0x0078, 0x4f08, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, - 0x6073, 0x0809, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, - 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, - 0x6086, 0x7810, 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, - 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, - 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048, 0x4f31, 0x2011, - 0x0000, 0x629e, 0x6017, 0x0016, 0x1078, 0x4151, 0x037f, 0x047f, - 0x057f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7810, 0x2070, 0x704c, - 0xa084, 0x0003, 0xa086, 0x0002, 0x0040, 0x4f83, 0xd5bc, 0x0040, - 0x4f51, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, - 0x4f57, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, - 0x0880, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, - 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, - 0x7060, 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, 0x707c, 0x60ca, - 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, - 0xa582, 0x0080, 0x0048, 0x4f7e, 0x2011, 0x0000, 0x629e, 0x6017, - 0x0012, 0x0078, 0x4f34, 0xd5bc, 0x0040, 0x4f8e, 0xa185, 0x0700, - 0x20a2, 0x6266, 0x636a, 0x646e, 0x0078, 0x4f94, 0x6063, 0x0700, - 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0898, 0x6077, 0x0000, - 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, - 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a, 0x7010, + 0x2004, 0xa092, 0x007e, 0x0048, 0x5147, 0x0d7e, 0xa0e8, 0x7720, + 0x2d6c, 0x6810, 0xa085, 0x8400, 0x20a2, 0x6814, 0x20a2, 0x2069, + 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x514f, 0x20a3, + 0x8400, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, + 0x00d1, 0x20a3, 0x0000, 0x0078, 0x507e, 0x027e, 0x20e1, 0x9080, + 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, + 0x0048, 0x5174, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085, + 0x8500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, + 0x2da6, 0x0d7f, 0x0078, 0x517c, 0x20a3, 0x8500, 0x6298, 0x22a2, + 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, + 0x0078, 0x507e, 0x0c7e, 0x0f7e, 0x2c78, 0x7804, 0xa08a, 0x0040, + 0x1048, 0x12d5, 0xa08a, 0x0050, 0x10c8, 0x12d5, 0x7918, 0x2160, + 0x61a0, 0xd1bc, 0x0040, 0x51a1, 0x6100, 0xd1f4, 0x0040, 0x519d, + 0x6114, 0xa18c, 0x00ff, 0x0078, 0x51a6, 0x2009, 0x0000, 0x0078, + 0x51a6, 0xa1e0, 0x232f, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, + 0x619a, 0xa082, 0x0040, 0x1079, 0x51b0, 0x0f7f, 0x0c7f, 0x007c, + 0x51c2, 0x52aa, 0x5252, 0x53d2, 0x51c0, 0x51c0, 0x51c0, 0x51c0, + 0x51c0, 0x51c0, 0x51c0, 0x581b, 0x582c, 0x583d, 0x584e, 0x51c0, + 0x1078, 0x12d5, 0x0d7e, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, + 0x5215, 0x7910, 0x2168, 0x6944, 0xa18c, 0x00ff, 0x21a2, 0xa016, + 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, 0x0006, 0x8004, 0x20a2, + 0xd1ac, 0x0040, 0x51df, 0x20a3, 0x0002, 0x0078, 0x51eb, 0xd1b4, + 0x0040, 0x51e6, 0x20a3, 0x0001, 0x0078, 0x51eb, 0x20a3, 0x0000, + 0x2230, 0x0078, 0x51ed, 0x6a80, 0x6e7c, 0x20a9, 0x0008, 0xad80, + 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000, 0x00f0, 0x51f1, 0x22a2, + 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014, 0xa084, 0x0004, + 0xa085, 0x0009, 0x6016, 0x2001, 0x7852, 0x2003, 0x07d0, 0x2001, + 0x7851, 0x2003, 0x0009, 0x2001, 0x7857, 0x2003, 0x0002, 0x1078, + 0x1504, 0x147f, 0x157f, 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x20e1, + 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, + 0x2202, 0x8217, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, + 0x523b, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x0600, + 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, + 0x0d7f, 0x0078, 0x5243, 0x20a3, 0x0600, 0x6198, 0x21a2, 0x20a3, + 0x0000, 0x6130, 0x21a2, 0x20a3, 0x0829, 0x20a3, 0x0000, 0x22a2, + 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, + 0x1078, 0x5272, 0x7810, 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2, + 0x6880, 0x20a2, 0x687c, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, + 0x20a2, 0x60c3, 0x000c, 0x1078, 0x556e, 0x147f, 0x137f, 0x157f, + 0x0d7f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, + 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x5290, 0x0d7e, 0xa0e8, + 0x7720, 0x2d6c, 0x6810, 0xa085, 0x0500, 0x20a2, 0x6814, 0x20a2, + 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x5298, + 0x20a3, 0x0500, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, + 0x20a3, 0x0889, 0x20a3, 0x0000, 0x1078, 0x555d, 0x22a2, 0x20a3, + 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x027f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, + 0x1078, 0x539a, 0x7810, 0x2068, 0xa016, 0x22a2, 0x22a2, 0x22a2, + 0x22a2, 0x22a2, 0x7810, 0xa084, 0xf000, 0x00c0, 0x52c7, 0x7810, + 0xa084, 0x0700, 0x8007, 0x1079, 0x52cf, 0x0078, 0x52ca, 0xa006, + 0x1079, 0x52cf, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x52d9, + 0x533b, 0x533f, 0x5362, 0x536f, 0x5381, 0x5385, 0x52d7, 0x1078, + 0x12d5, 0x017e, 0x037e, 0x694c, 0xa18c, 0x0003, 0xa186, 0x0000, + 0x00c0, 0x52ec, 0x6b78, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, + 0x037f, 0x017f, 0x0078, 0x5366, 0xa186, 0x0001, 0x00c0, 0x5336, + 0x6b78, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2, 0x6874, + 0x20a2, 0x22a2, 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384, 0x0300, + 0x0040, 0x5335, 0xd3c4, 0x0040, 0x5307, 0x687c, 0xa108, 0xd3cc, + 0x0040, 0x530c, 0x6874, 0xa108, 0x157e, 0x20a9, 0x000d, 0xad80, + 0x0020, 0x201c, 0x831f, 0x23a2, 0x8000, 0x00f0, 0x5311, 0x157f, + 0x22a2, 0x22a2, 0x22a2, 0xa184, 0x0003, 0x0040, 0x5335, 0x20a1, + 0x020b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, + 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a2, + 0x1078, 0x555d, 0x22a2, 0x20a3, 0x0000, 0x61c2, 0x037f, 0x017f, + 0x1078, 0x556e, 0x007c, 0x20a3, 0x0008, 0x0078, 0x5364, 0x20a3, + 0x0302, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0012, 0x22a2, 0x20a3, + 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x7000, 0x20a3, + 0x0500, 0x22a2, 0x20a3, 0x000a, 0x22a2, 0x22a2, 0x20a3, 0x2500, + 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0032, 0x1078, + 0x556e, 0x007c, 0x20a3, 0x0028, 0x22a2, 0x22a2, 0x22a2, 0x22a2, + 0x22a2, 0x22a2, 0x60c3, 0x0018, 0x1078, 0x556e, 0x007c, 0x20a3, + 0x0100, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0008, + 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0020, 0x1078, 0x556e, + 0x007c, 0x20a3, 0x0008, 0x0078, 0x5364, 0x037e, 0x7b10, 0xa384, + 0xff00, 0x7812, 0xa384, 0x00ff, 0x8001, 0x00c0, 0x5393, 0x22a2, + 0x037f, 0x0078, 0x5364, 0x20a3, 0x0800, 0x22a2, 0x20a2, 0x037f, + 0x0078, 0x5366, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, + 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x53b8, 0x0d7e, 0xa0e8, + 0x7720, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2, + 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x53c0, + 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, + 0x20a3, 0x0898, 0x20a3, 0x0000, 0x1078, 0x555d, 0x22a2, 0x20a3, + 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x027f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x017e, 0x037e, + 0x7810, 0xa084, 0x0700, 0x8007, 0x1079, 0x53e5, 0x037f, 0x017f, + 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x53ed, 0x53ed, 0x53ef, + 0x53ed, 0x53ed, 0x53ed, 0x5414, 0x53ed, 0x1078, 0x12d5, 0x7910, + 0xa18c, 0xf8ff, 0xa18d, 0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, + 0x0003, 0x1078, 0x541e, 0x0d7e, 0x2069, 0x7651, 0x6804, 0xd0bc, + 0x0040, 0x5409, 0x682c, 0xa084, 0x00ff, 0x8007, 0x20a2, 0x0078, + 0x540b, 0x20a3, 0x3f00, 0x0d7f, 0x22a2, 0x22a2, 0x22a2, 0x60c3, + 0x0001, 0x1078, 0x556e, 0x007c, 0x20a1, 0x020b, 0x2009, 0x0003, + 0x1078, 0x541e, 0x20a3, 0x7f00, 0x0078, 0x540c, 0x027e, 0x20e1, + 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, + 0x0040, 0x543c, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085, + 0x0100, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, + 0x2da6, 0x0d7f, 0x0078, 0x5444, 0x20a3, 0x0100, 0x6298, 0x22a2, + 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0888, 0xa18d, 0x0008, + 0x21a2, 0x1078, 0x555d, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, + 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0e7e, + 0x0d7e, 0x0c7e, 0x057e, 0x047e, 0x037e, 0x2061, 0x0100, 0x2071, + 0x7600, 0x6130, 0x7818, 0x2068, 0x68a0, 0x2028, 0xd0bc, 0x00c0, + 0x5470, 0xa080, 0x232f, 0x2014, 0xa294, 0x00ff, 0x0078, 0x5474, + 0x6910, 0x6a14, 0x7364, 0x7468, 0x781c, 0xa086, 0x0006, 0x0040, + 0x54c8, 0xd5bc, 0x0040, 0x5484, 0xa185, 0x0100, 0x6062, 0x6266, + 0x636a, 0x646e, 0x0078, 0x548a, 0x6063, 0x0100, 0x6266, 0x606b, + 0x0000, 0x616e, 0x6073, 0x0809, 0x6077, 0x0008, 0x688c, 0x8000, + 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, + 0x6082, 0x7808, 0x6086, 0x7810, 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048, - 0x4fbb, 0x2011, 0x0000, 0x629e, 0x6017, 0x0016, 0x0078, 0x4f34, - 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, - 0x8217, 0x007c, 0x0d7e, 0x2069, 0x6f10, 0x6843, 0x0001, 0x0d7f, - 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, - 0x4fdc, 0x1078, 0x4143, 0x007c, 0x007e, 0x6014, 0xa084, 0x0004, - 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e, 0x0c7e, 0x2061, - 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016, 0x0c7f, - 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e, 0x1078, 0x414c, - 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000, 0x0040, - 0x503a, 0x1078, 0x4fe5, 0x6803, 0x1000, 0x6803, 0x0000, 0x0c7e, - 0x2061, 0x6f10, 0x6128, 0xa192, 0x0002, 0x00c8, 0x5027, 0x8108, - 0x612a, 0x613c, 0x0c7f, 0x81ff, 0x0040, 0x5035, 0x1078, 0x4143, - 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x5023, 0x6017, - 0x0012, 0x0078, 0x5035, 0x1078, 0x4fdc, 0x0078, 0x5035, 0x6124, - 0xa1e5, 0x0000, 0x0040, 0x5032, 0x1078, 0x6c76, 0x2009, 0x0014, - 0x1078, 0x5591, 0x0c7f, 0x0078, 0x5035, 0x027f, 0x017f, 0x0d7f, - 0x0c7f, 0x007c, 0x1078, 0x31cb, 0x0078, 0x5035, 0x0c7e, 0x0d7e, - 0x0e7e, 0x017e, 0x027e, 0x1078, 0x415a, 0x2071, 0x6f10, 0x713c, - 0x81ff, 0x0040, 0x5079, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, - 0x017e, 0x017f, 0xa194, 0x4000, 0x0040, 0x507f, 0x6017, 0x0010, - 0x7144, 0xa192, 0x0002, 0x00c8, 0x5071, 0x8108, 0x7146, 0x1078, - 0x4151, 0x713c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, - 0x506d, 0x6017, 0x0012, 0x0078, 0x5079, 0x6017, 0x0016, 0x0078, - 0x5079, 0x1078, 0x6c76, 0x2009, 0x004a, 0x1078, 0x5591, 0x0078, - 0x5079, 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x1078, - 0x4151, 0x0078, 0x5079, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x057e, + 0x54bc, 0x6a00, 0xd2f4, 0x0040, 0x54ba, 0x6a14, 0xa294, 0x00ff, + 0x0078, 0x54bc, 0x2011, 0x0000, 0x629e, 0x6017, 0x0016, 0x1078, + 0x45f0, 0x037f, 0x047f, 0x057f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, + 0x7810, 0x2070, 0x704c, 0xa084, 0x0003, 0xa086, 0x0002, 0x0040, + 0x5517, 0xd5bc, 0x0040, 0x54dc, 0xa185, 0x0100, 0x6062, 0x6266, + 0x636a, 0x646e, 0x0078, 0x54e2, 0x6063, 0x0100, 0x6266, 0x606b, + 0x0000, 0x616e, 0x6073, 0x0880, 0x6077, 0x0008, 0x688c, 0x8000, + 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, + 0x6086, 0x7808, 0x6082, 0x7060, 0x608a, 0x705c, 0x608e, 0x7080, + 0x60c6, 0x707c, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, + 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048, 0x5512, 0x6a00, + 0xd2f4, 0x0040, 0x5510, 0x6a14, 0xa294, 0x00ff, 0x0078, 0x5512, + 0x2011, 0x0000, 0x629e, 0x6017, 0x0012, 0x0078, 0x54bf, 0xd5bc, + 0x0040, 0x5522, 0xa185, 0x0700, 0x6062, 0x6266, 0x636a, 0x646e, + 0x0078, 0x5528, 0x6063, 0x0700, 0x6266, 0x606b, 0x0000, 0x616e, + 0x6073, 0x0898, 0x6077, 0x0000, 0x688c, 0x8000, 0xa084, 0x00ff, + 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, + 0x6082, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, + 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, + 0x0000, 0xa582, 0x0080, 0x0048, 0x5558, 0x6a00, 0xd2f4, 0x0040, + 0x5556, 0x6a14, 0xa294, 0x00ff, 0x0078, 0x5558, 0x2011, 0x0000, + 0x629e, 0x6017, 0x0016, 0x0078, 0x54bf, 0x7a18, 0xa280, 0x0023, + 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0x007c, 0x0d7e, + 0x2069, 0x7836, 0x6843, 0x0001, 0x0d7f, 0x007c, 0x20e1, 0x9080, + 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x5579, 0x1078, 0x45e0, + 0x007c, 0x007e, 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, + 0x007f, 0x007c, 0x007e, 0x0c7e, 0x2061, 0x0100, 0x6014, 0xa084, + 0x0004, 0xa085, 0x0008, 0x6016, 0x0c7f, 0x007f, 0x007c, 0x0c7e, + 0x0d7e, 0x017e, 0x027e, 0x1078, 0x45eb, 0x2061, 0x0100, 0x2069, + 0x0140, 0x6904, 0xa194, 0x4000, 0x0040, 0x55cc, 0x1078, 0x5582, + 0x6803, 0x1000, 0x6803, 0x0000, 0x0c7e, 0x2061, 0x7836, 0x6128, + 0xa192, 0x0002, 0x00c8, 0x55b9, 0x8108, 0x612a, 0x6124, 0x0c7f, + 0x81ff, 0x0040, 0x55c7, 0x1078, 0x45e0, 0x1078, 0x5579, 0x0078, + 0x55c7, 0x6124, 0xa1e5, 0x0000, 0x0040, 0x55c4, 0x1078, 0x75c7, + 0x2009, 0x0014, 0x1078, 0x5c29, 0x0c7f, 0x0078, 0x55c7, 0x027f, + 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x1078, 0x357b, 0x0078, 0x55c7, + 0x0c7e, 0x0d7e, 0x0e7e, 0x017e, 0x027e, 0x1078, 0x45f9, 0x2071, + 0x7836, 0x713c, 0x81ff, 0x0040, 0x55fa, 0x2061, 0x0100, 0x2069, + 0x0140, 0x6904, 0xa194, 0x4000, 0x0040, 0x5600, 0x6803, 0x1000, + 0x6803, 0x0000, 0x037e, 0x2019, 0x0001, 0x1078, 0x5768, 0x037f, + 0x713c, 0x2160, 0x1078, 0x75c7, 0x2009, 0x004a, 0x1078, 0x5c29, + 0x0078, 0x55fa, 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, + 0x7144, 0xa192, 0x0002, 0x00c8, 0x55ea, 0x8108, 0x7146, 0x1078, + 0x45f0, 0x0078, 0x55fa, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x057e, 0x047e, 0x007e, 0x127e, 0x2091, 0x8000, 0x6018, 0x2068, 0x6ca0, - 0x2071, 0x6f10, 0x7018, 0x2068, 0x8dff, 0x0040, 0x50af, 0x68a0, - 0xa406, 0x0040, 0x509f, 0x6854, 0x2068, 0x0078, 0x5094, 0x6010, + 0x2071, 0x7836, 0x7018, 0x2068, 0x8dff, 0x0040, 0x5637, 0x68a0, + 0xa406, 0x0040, 0x5627, 0x6854, 0x2068, 0x0078, 0x561c, 0x6010, 0x2060, 0x643c, 0x6540, 0x6644, 0xa6b4, 0x000f, 0x2d60, 0x1078, - 0x3522, 0x0040, 0x50af, 0x1078, 0x5374, 0xa085, 0x0001, 0x127f, + 0x38f9, 0x0040, 0x5637, 0x1078, 0x5902, 0xa085, 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, - 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4a83, 0x20a3, 0x0f00, + 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4fdc, 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x60c3, 0x0008, - 0x1078, 0x4fd1, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1, - 0x020b, 0x1078, 0x4afa, 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a9, - 0x0006, 0x2011, 0x6d40, 0x2019, 0x6d40, 0x23a6, 0x22a6, 0xa398, - 0x0002, 0xa290, 0x0002, 0x00f0, 0x50dd, 0x20a3, 0x0000, 0x20a3, - 0x0000, 0x60c3, 0x001c, 0x1078, 0x4fd1, 0x147f, 0x157f, 0x007c, - 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b, 0x1078, 0x4ada, - 0x1078, 0x4af1, 0x7810, 0x007e, 0xa080, 0x0015, 0x2098, 0x7808, + 0x1078, 0x556e, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1, + 0x020b, 0x1078, 0x5053, 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a9, + 0x0006, 0x2011, 0x7640, 0x2019, 0x7641, 0x23a6, 0x22a6, 0xa398, + 0x0002, 0xa290, 0x0002, 0x00f0, 0x5665, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x60c3, 0x001c, 0x1078, 0x556e, 0x147f, 0x157f, 0x007c, + 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b, 0x1078, 0x5033, + 0x1078, 0x504a, 0x7810, 0x007e, 0xa080, 0x0015, 0x2098, 0x7808, 0xa088, 0x0002, 0x21a8, 0x53a6, 0xa080, 0x0004, 0x8003, 0x60c2, - 0x007f, 0xa080, 0x0001, 0x2004, 0x7812, 0x1078, 0x4fd1, 0x027f, + 0x007f, 0xa080, 0x0001, 0x2004, 0x7812, 0x1078, 0x556e, 0x027f, 0x017f, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, - 0x1078, 0x4a83, 0x20a3, 0x6200, 0x20a3, 0x0000, 0x20a3, 0x0000, - 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x4fd1, 0x147f, 0x157f, + 0x1078, 0x4fdc, 0x20a3, 0x6200, 0x20a3, 0x0000, 0x20a3, 0x0000, + 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x556e, 0x147f, 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, - 0x6f10, 0x700c, 0x2060, 0x8cff, 0x0040, 0x513f, 0x600c, 0x007e, - 0x1078, 0x556a, 0x1078, 0x5374, 0x0c7f, 0x0078, 0x5133, 0x700f, - 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f, 0x007c, + 0x7836, 0x700c, 0x2060, 0x8cff, 0x0040, 0x56cd, 0x1078, 0x6ace, + 0x00c0, 0x56c4, 0x1078, 0x5e57, 0x600c, 0x007e, 0x1078, 0x5c02, + 0x1078, 0x5902, 0x0c7f, 0x0078, 0x56bb, 0x700f, 0x0000, 0x700b, + 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f, 0x007c, 0x127e, 0x157e, + 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e, 0x007e, 0x2091, + 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x7836, 0x7024, + 0x2060, 0x8cff, 0x0040, 0x5726, 0x1078, 0x5582, 0x68c3, 0x0000, + 0x1078, 0x45eb, 0x2009, 0x0013, 0x1078, 0x5c29, 0x20a9, 0x01f4, + 0x6824, 0xd094, 0x0040, 0x5709, 0x6827, 0x0004, 0x7804, 0xa084, + 0x4000, 0x0040, 0x571b, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, + 0x571b, 0xd084, 0x0040, 0x5710, 0x6827, 0x0001, 0x0078, 0x5712, + 0x00f0, 0x56f8, 0x7804, 0xa084, 0x1000, 0x0040, 0x571b, 0x7803, + 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f, 0x027f, 0x0c7f, + 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c, 0x2001, 0x7600, + 0x2004, 0xa096, 0x0001, 0x0040, 0x575e, 0xa096, 0x0004, 0x0040, + 0x575e, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, 0x3542, 0x1078, + 0x456e, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x574c, 0x6827, + 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x575e, 0x7803, 0x1000, + 0x7803, 0x0000, 0x0078, 0x575e, 0xd084, 0x0040, 0x5753, 0x6827, + 0x0001, 0x0078, 0x5755, 0x00f0, 0x573b, 0x7804, 0xa084, 0x1000, + 0x0040, 0x575e, 0x7803, 0x0100, 0x7803, 0x0000, 0x007f, 0x017f, + 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, - 0x6f10, 0x7024, 0x2060, 0x8cff, 0x0040, 0x5198, 0x1078, 0x4fe5, - 0x68c3, 0x0000, 0x1078, 0x414c, 0x2009, 0x0013, 0x1078, 0x5591, - 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x517b, 0x6827, 0x0004, - 0x7804, 0xa084, 0x4000, 0x0040, 0x518d, 0x7803, 0x1000, 0x7803, - 0x0000, 0x0078, 0x518d, 0xd084, 0x0040, 0x5182, 0x6827, 0x0001, - 0x0078, 0x5184, 0x00f0, 0x516a, 0x7804, 0xa084, 0x1000, 0x0040, - 0x518d, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f, + 0x7836, 0x703c, 0x2060, 0x8cff, 0x0040, 0x57b6, 0x6817, 0x0010, + 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078, 0x45f9, 0x1078, 0x1c19, + 0xa39d, 0x0000, 0x00c0, 0x5790, 0x2009, 0x0049, 0x1078, 0x5c29, + 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040, 0x57a3, 0x6827, 0x0004, + 0x7804, 0xa084, 0x4000, 0x0040, 0x57b5, 0x7803, 0x1000, 0x7803, + 0x0000, 0x0078, 0x57b5, 0xd094, 0x0040, 0x57aa, 0x6827, 0x0002, + 0x0078, 0x57ac, 0x00f0, 0x5792, 0x7804, 0xa084, 0x1000, 0x0040, + 0x57b5, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c, - 0x2001, 0x6d00, 0x2004, 0xa096, 0x0001, 0x0040, 0x51d0, 0xa096, - 0x0004, 0x0040, 0x51d0, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, - 0x318e, 0x1078, 0x40d1, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, - 0x51be, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x51d0, - 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x51d0, 0xd084, 0x0040, - 0x51c5, 0x6827, 0x0001, 0x0078, 0x51c7, 0x00f0, 0x51ad, 0x7804, - 0xa084, 0x1000, 0x0040, 0x51d0, 0x7803, 0x0100, 0x7803, 0x0000, - 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, - 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, - 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, - 0x0140, 0x2071, 0x6f10, 0x703c, 0x2060, 0x8cff, 0x0040, 0x5228, - 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078, 0x415a, - 0x1078, 0x1a20, 0xa39d, 0x0000, 0x00c0, 0x5202, 0x2009, 0x0049, - 0x1078, 0x5591, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040, 0x5215, - 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5227, 0x7803, - 0x1000, 0x7803, 0x0000, 0x0078, 0x5227, 0xd094, 0x0040, 0x521c, - 0x6827, 0x0002, 0x0078, 0x521e, 0x00f0, 0x5204, 0x7804, 0xa084, - 0x1000, 0x0040, 0x5227, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, - 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, - 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0x6f10, - 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, - 0x2069, 0x6f10, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e, - 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x6f10, 0x7614, 0x2660, - 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x5286, 0x601c, 0xa206, - 0x00c0, 0x5281, 0x7014, 0xac36, 0x00c0, 0x5260, 0x660c, 0x7616, - 0x7010, 0xac36, 0x00c0, 0x526e, 0x2c00, 0xaf36, 0x0040, 0x526c, - 0x2f00, 0x7012, 0x0078, 0x526e, 0x7013, 0x0000, 0x660c, 0x067e, - 0x2c00, 0xaf06, 0x0040, 0x5277, 0x7e0e, 0x0078, 0x5278, 0x2678, - 0x600f, 0x0000, 0x1078, 0x6283, 0x1078, 0x5374, 0x0c7f, 0x0078, - 0x5253, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5253, 0x127f, 0x007f, - 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1, - 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, - 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x52cf, 0x157e, 0x147e, - 0x20a1, 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2, 0xa006, 0x20a2, - 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x52cf, 0x157e, - 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2, 0xa006, - 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078, 0x52cf, - 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2, - 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x1078, - 0x537f, 0x60c3, 0x0020, 0x1078, 0x4fd1, 0x147f, 0x157f, 0x007c, - 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120, 0xd1b4, - 0x00c0, 0x52e7, 0xd1bc, 0x00c0, 0x5331, 0x0078, 0x5371, 0x2009, + 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0x7836, 0x6a06, 0x127f, + 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0x7836, + 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x067e, + 0x007e, 0x127e, 0x2071, 0x7836, 0x7614, 0x2660, 0x2678, 0x2091, + 0x8000, 0x8cff, 0x0040, 0x5814, 0x601c, 0xa206, 0x00c0, 0x580f, + 0x7014, 0xac36, 0x00c0, 0x57ee, 0x660c, 0x7616, 0x7010, 0xac36, + 0x00c0, 0x57fc, 0x2c00, 0xaf36, 0x0040, 0x57fa, 0x2f00, 0x7012, + 0x0078, 0x57fc, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, + 0x0040, 0x5805, 0x7e0e, 0x0078, 0x5806, 0x2678, 0x600f, 0x0000, + 0x1078, 0x6aa1, 0x1078, 0x5902, 0x0c7f, 0x0078, 0x57e1, 0x2c78, + 0x600c, 0x2060, 0x0078, 0x57e1, 0x127f, 0x007f, 0x067f, 0x0c7f, + 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, + 0x5215, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, + 0x20a3, 0x4000, 0x0078, 0x585d, 0x157e, 0x147e, 0x20a1, 0x020b, + 0x1078, 0x5215, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, + 0x20a2, 0x20a3, 0x2000, 0x0078, 0x585d, 0x157e, 0x147e, 0x20a1, + 0x020b, 0x1078, 0x5215, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, + 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078, 0x585d, 0x157e, 0x147e, + 0x20a1, 0x020b, 0x1078, 0x5215, 0x7810, 0x20a2, 0xa006, 0x20a2, + 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x1078, 0x590d, 0x60c3, + 0x0020, 0x1078, 0x556e, 0x147f, 0x157f, 0x007c, 0x127e, 0x0c7e, + 0x2091, 0x8000, 0x2061, 0x0100, 0x6120, 0xd1b4, 0x00c0, 0x5875, + 0xd1bc, 0x00c0, 0x58bf, 0x0078, 0x58ff, 0x2009, 0x017f, 0x200b, + 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140, 0x20a9, 0x001e, + 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, 0x0040, 0x58b6, 0x6020, + 0xd0b4, 0x0040, 0x58b6, 0x6024, 0xd094, 0x00c0, 0x58b6, 0x2104, + 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x58b6, 0x00f0, 0x5882, + 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff, + 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b, 0xbc91, 0x6043, 0x0001, + 0x6043, 0x0000, 0x608a, 0x628e, 0x6024, 0xd094, 0x00c0, 0x58b5, + 0x6a04, 0xa294, 0x4000, 0x00c0, 0x58ac, 0x027f, 0x0d7f, 0x007f, + 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0078, 0x58ff, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, 0x0040, - 0x5328, 0x6020, 0xd0b4, 0x0040, 0x5328, 0x6024, 0xd094, 0x00c0, - 0x5328, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x5328, - 0x00f0, 0x52f4, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107, 0x6130, - 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b, 0xbc91, - 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024, 0xd094, - 0x00c0, 0x5327, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x531e, 0x027f, - 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0078, - 0x5371, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, - 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, - 0x4000, 0x0040, 0x536a, 0x6020, 0xd0bc, 0x0040, 0x536a, 0x2104, - 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x536a, 0x00f0, 0x533e, - 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff, - 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043, 0x0001, - 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000, 0x00c0, - 0x5364, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, - 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x6f10, 0x7020, - 0xa005, 0x0040, 0x537d, 0x8001, 0x7022, 0x0e7f, 0x007c, 0x20a9, - 0x0008, 0x20a2, 0x00f0, 0x5381, 0x20a2, 0x20a2, 0x007c, 0x0f7e, - 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e, 0x2091, - 0x8000, 0x2071, 0x6f10, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001, - 0x87ff, 0x0040, 0x5417, 0x8cff, 0x0040, 0x5417, 0x601c, 0xa086, - 0x0006, 0x00c0, 0x5412, 0x88ff, 0x0040, 0x53ae, 0x2800, 0xac06, - 0x00c0, 0x5412, 0x2039, 0x0000, 0x0078, 0x53b2, 0x6018, 0xa206, - 0x00c0, 0x5412, 0x7024, 0xac06, 0x00c0, 0x53e0, 0x2069, 0x0100, - 0x68c0, 0xa005, 0x0040, 0x53db, 0x6817, 0x0008, 0x68c3, 0x0000, - 0x1078, 0x54a4, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, - 0xa384, 0x1000, 0x0040, 0x53d0, 0x6803, 0x0100, 0x6803, 0x0000, - 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x53d8, 0x6827, 0x0001, - 0x037f, 0x0078, 0x53e0, 0x6003, 0x0009, 0x630a, 0x0078, 0x5412, - 0x7014, 0xac36, 0x00c0, 0x53e6, 0x660c, 0x7616, 0x7010, 0xac36, - 0x00c0, 0x53f4, 0x2c00, 0xaf36, 0x0040, 0x53f2, 0x2f00, 0x7012, - 0x0078, 0x53f4, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, - 0x0040, 0x53fd, 0x7e0e, 0x0078, 0x53fe, 0x2678, 0x600f, 0x0000, - 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x5408, 0x1078, 0x6bb3, - 0x1078, 0x6283, 0x1078, 0x5374, 0x88ff, 0x00c0, 0x5421, 0x0c7f, - 0x0078, 0x5398, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5398, 0xa006, - 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, - 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x5418, - 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, - 0x2091, 0x8000, 0x2071, 0x6f10, 0x7638, 0x2660, 0x2678, 0x8cff, - 0x0040, 0x5493, 0x601c, 0xa086, 0x0006, 0x00c0, 0x548e, 0x88ff, - 0x0040, 0x5448, 0x2800, 0xac06, 0x00c0, 0x548e, 0x0078, 0x544c, - 0x6018, 0xa206, 0x00c0, 0x548e, 0x703c, 0xac06, 0x00c0, 0x545e, - 0x037e, 0x2019, 0x0001, 0x1078, 0x51da, 0x7033, 0x0000, 0x703f, - 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x037f, 0x7038, 0xac36, - 0x00c0, 0x5464, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5472, - 0x2c00, 0xaf36, 0x0040, 0x5470, 0x2f00, 0x7036, 0x0078, 0x5472, - 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x547b, - 0x7e0e, 0x0078, 0x547c, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, - 0x1078, 0x6120, 0x0040, 0x5486, 0x1078, 0x6bb3, 0x1078, 0x6283, - 0x88ff, 0x00c0, 0x549d, 0x0c7f, 0x0078, 0x5437, 0x2c78, 0x600c, - 0x2060, 0x0078, 0x5437, 0xa006, 0x127f, 0x007f, 0x027f, 0x067f, - 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f, - 0xa8c5, 0x0001, 0x0078, 0x5494, 0x0e7e, 0x2071, 0x6f10, 0x2001, - 0x6d00, 0x2004, 0xa086, 0x0002, 0x00c0, 0x54b2, 0x7007, 0x0005, - 0x0078, 0x54b4, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e, 0x0e7e, - 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, - 0x6f10, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x54f4, - 0x2200, 0xac06, 0x00c0, 0x54ef, 0x7038, 0xac36, 0x00c0, 0x54d2, - 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x54e0, 0x2c00, 0xaf36, - 0x0040, 0x54de, 0x2f00, 0x7036, 0x0078, 0x54e0, 0x7037, 0x0000, - 0x660c, 0x2c00, 0xaf06, 0x0040, 0x54e8, 0x7e0e, 0x0078, 0x54e9, - 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x54f4, 0x2c78, - 0x600c, 0x2060, 0x0078, 0x54c5, 0x127f, 0x007f, 0x027f, 0x067f, - 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x2061, 0x7400, 0x2a70, 0x7060, - 0x7046, 0x704b, 0x7400, 0x007c, 0x0e7e, 0x127e, 0x2071, 0x6d00, - 0x2091, 0x8000, 0x7544, 0xa582, 0x0001, 0x0048, 0x5536, 0x7048, - 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5522, 0xace0, 0x0008, - 0x7054, 0xac02, 0x00c8, 0x551e, 0x0078, 0x5511, 0x2061, 0x7400, - 0x0078, 0x5511, 0x6003, 0x0008, 0x8529, 0x7546, 0xaca8, 0x0008, - 0x7054, 0xa502, 0x00c8, 0x5532, 0x754a, 0xa085, 0x0001, 0x127f, - 0x0e7f, 0x007c, 0x704b, 0x7400, 0x0078, 0x552d, 0xa006, 0x0078, - 0x552f, 0x0e7e, 0x2071, 0x6d00, 0x7544, 0xa582, 0x0001, 0x0048, - 0x5567, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5554, - 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5550, 0x0078, 0x5543, - 0x2061, 0x7400, 0x0078, 0x5543, 0x6003, 0x0008, 0x8529, 0x7546, - 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5563, 0x754a, 0xa085, - 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7400, 0x0078, 0x555f, 0xa006, - 0x0078, 0x5561, 0xac82, 0x7400, 0x1048, 0x12b7, 0x2001, 0x6d15, - 0x2004, 0xac02, 0x10c8, 0x12b7, 0xa006, 0x6006, 0x600a, 0x600e, + 0x58f8, 0x6020, 0xd0bc, 0x0040, 0x58f8, 0x2104, 0xa084, 0x000f, + 0xa086, 0x0004, 0x00c0, 0x58f8, 0x00f0, 0x58cc, 0x027e, 0x6164, + 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff, 0xa10d, 0x6088, + 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043, 0x0001, 0x6043, 0x0000, + 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x58f2, 0x027f, + 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0c7f, + 0x127f, 0x007c, 0x0e7e, 0x2071, 0x7836, 0x7020, 0xa005, 0x0040, + 0x590b, 0x8001, 0x7022, 0x0e7f, 0x007c, 0x20a9, 0x0008, 0x20a2, + 0x00f0, 0x590f, 0x20a2, 0x20a2, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, + 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, + 0x7836, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001, 0x87ff, 0x0040, + 0x59a5, 0x8cff, 0x0040, 0x59a5, 0x601c, 0xa086, 0x0006, 0x00c0, + 0x59a0, 0x88ff, 0x0040, 0x593c, 0x2800, 0xac06, 0x00c0, 0x59a0, + 0x2039, 0x0000, 0x0078, 0x5940, 0x6018, 0xa206, 0x00c0, 0x59a0, + 0x7024, 0xac06, 0x00c0, 0x596e, 0x2069, 0x0100, 0x68c0, 0xa005, + 0x0040, 0x5969, 0x6817, 0x0008, 0x68c3, 0x0000, 0x1078, 0x5a32, + 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, + 0x0040, 0x595e, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, + 0x6824, 0xd084, 0x0040, 0x5966, 0x6827, 0x0001, 0x037f, 0x0078, + 0x596e, 0x6003, 0x0009, 0x630a, 0x0078, 0x59a0, 0x7014, 0xac36, + 0x00c0, 0x5974, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x5982, + 0x2c00, 0xaf36, 0x0040, 0x5980, 0x2f00, 0x7012, 0x0078, 0x5982, + 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x598b, + 0x7e0e, 0x0078, 0x598c, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, + 0x1078, 0x693e, 0x0040, 0x5996, 0x1078, 0x74fd, 0x1078, 0x6aa1, + 0x1078, 0x5902, 0x88ff, 0x00c0, 0x59af, 0x0c7f, 0x0078, 0x5926, + 0x2c78, 0x600c, 0x2060, 0x0078, 0x5926, 0xa006, 0x127f, 0x007f, + 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, + 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x59a6, 0x0f7e, 0x0e7e, + 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, + 0x2071, 0x7836, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x5a21, + 0x601c, 0xa086, 0x0006, 0x00c0, 0x5a1c, 0x88ff, 0x0040, 0x59d6, + 0x2800, 0xac06, 0x00c0, 0x5a1c, 0x0078, 0x59da, 0x6018, 0xa206, + 0x00c0, 0x5a1c, 0x703c, 0xac06, 0x00c0, 0x59ec, 0x037e, 0x2019, + 0x0001, 0x1078, 0x5768, 0x7033, 0x0000, 0x703f, 0x0000, 0x7043, + 0x0000, 0x7047, 0x0000, 0x037f, 0x7038, 0xac36, 0x00c0, 0x59f2, + 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5a00, 0x2c00, 0xaf36, + 0x0040, 0x59fe, 0x2f00, 0x7036, 0x0078, 0x5a00, 0x7037, 0x0000, + 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5a09, 0x7e0e, 0x0078, + 0x5a0a, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078, 0x693e, + 0x0040, 0x5a14, 0x1078, 0x74fd, 0x1078, 0x6aa1, 0x88ff, 0x00c0, + 0x5a2b, 0x0c7f, 0x0078, 0x59c5, 0x2c78, 0x600c, 0x2060, 0x0078, + 0x59c5, 0xa006, 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f, + 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, + 0x0078, 0x5a22, 0x0e7e, 0x2071, 0x7836, 0x2001, 0x7600, 0x2004, + 0xa086, 0x0002, 0x00c0, 0x5a40, 0x7007, 0x0005, 0x0078, 0x5a42, + 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x067e, + 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7836, 0x2c10, + 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x5a82, 0x2200, 0xac06, + 0x00c0, 0x5a7d, 0x7038, 0xac36, 0x00c0, 0x5a60, 0x660c, 0x763a, + 0x7034, 0xac36, 0x00c0, 0x5a6e, 0x2c00, 0xaf36, 0x0040, 0x5a6c, + 0x2f00, 0x7036, 0x0078, 0x5a6e, 0x7037, 0x0000, 0x660c, 0x2c00, + 0xaf06, 0x0040, 0x5a76, 0x7e0e, 0x0078, 0x5a77, 0x2678, 0x600f, + 0x0000, 0xa085, 0x0001, 0x0078, 0x5a82, 0x2c78, 0x600c, 0x2060, + 0x0078, 0x5a53, 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0e7f, + 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, + 0x127e, 0x2091, 0x8000, 0x2071, 0x7836, 0x760c, 0x2660, 0x2678, + 0x8cff, 0x0040, 0x5b1b, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, + 0x00c0, 0x5b16, 0x7024, 0xac06, 0x00c0, 0x5ac9, 0x2069, 0x0100, + 0x68c0, 0xa005, 0x0040, 0x5ac9, 0x1078, 0x5582, 0x68c3, 0x0000, + 0x1078, 0x5a32, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, + 0xa384, 0x1000, 0x0040, 0x5ac0, 0x6803, 0x0100, 0x6803, 0x0000, + 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5ac8, 0x6827, 0x0001, + 0x037f, 0x700c, 0xac36, 0x00c0, 0x5acf, 0x660c, 0x760e, 0x7008, + 0xac36, 0x00c0, 0x5add, 0x2c00, 0xaf36, 0x0040, 0x5adb, 0x2f00, + 0x700a, 0x0078, 0x5add, 0x700b, 0x0000, 0x660c, 0x067e, 0x2c00, + 0xaf06, 0x0040, 0x5ae6, 0x7e0e, 0x0078, 0x5ae7, 0x2678, 0x600f, + 0x0000, 0x1078, 0x6aba, 0x00c0, 0x5af1, 0x1078, 0x22dd, 0x0078, + 0x5b0d, 0x1078, 0x6ace, 0x00c0, 0x5af9, 0x1078, 0x5e57, 0x0078, + 0x5b0d, 0x6010, 0x2068, 0x1078, 0x693e, 0x0040, 0x5b0d, 0x601c, + 0xa086, 0x0003, 0x00c0, 0x5b23, 0x6837, 0x0103, 0x6b4a, 0x6847, + 0x0000, 0x1078, 0x3a7a, 0x1078, 0x6a94, 0x6003, 0x0000, 0x1078, + 0x6aa1, 0x1078, 0x5902, 0x0c7f, 0x0078, 0x5a98, 0x2c78, 0x600c, + 0x2060, 0x0078, 0x5a98, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, + 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x5b04, + 0x1078, 0x74fd, 0x0078, 0x5b0d, 0x037e, 0x157e, 0x137e, 0x147e, + 0x3908, 0xa006, 0xa190, 0x0020, 0x221c, 0xa39e, 0x214f, 0x00c0, + 0x5b3d, 0x8210, 0x8000, 0x0078, 0x5b34, 0xa005, 0x0040, 0x5b47, + 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0, 0x22c8, 0x53a3, 0x147f, + 0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078, + 0x5053, 0x20a3, 0x0200, 0x20a3, 0x0014, 0x60c3, 0x0014, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x20a3, 0x514c, 0x20a3, 0x4f47, 0x20a3, + 0x4943, 0x20a3, 0x2020, 0x20a3, 0x0004, 0x20a3, 0x7878, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x1078, 0x556e, 0x0d7f, 0x007c, 0x20a1, + 0x020b, 0x1078, 0x5053, 0x20a3, 0x0210, 0x20a3, 0x0018, 0x20a3, + 0x0800, 0x7810, 0xa084, 0xff00, 0x20a2, 0x20a3, 0x0000, 0x20a3, + 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7810, + 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, + 0x0018, 0x1078, 0x556e, 0x007c, 0x2061, 0x7d00, 0x2a70, 0x7060, + 0x7046, 0x704b, 0x7d00, 0x007c, 0x0e7e, 0x127e, 0x2071, 0x7600, + 0x2091, 0x8000, 0x7544, 0xa582, 0x0001, 0x0048, 0x5bce, 0x7048, + 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5bba, 0xace0, 0x0008, + 0x7054, 0xac02, 0x00c8, 0x5bb6, 0x0078, 0x5ba9, 0x2061, 0x7d00, + 0x0078, 0x5ba9, 0x6003, 0x0008, 0x8529, 0x7546, 0xaca8, 0x0008, + 0x7054, 0xa502, 0x00c8, 0x5bca, 0x754a, 0xa085, 0x0001, 0x127f, + 0x0e7f, 0x007c, 0x704b, 0x7d00, 0x0078, 0x5bc5, 0xa006, 0x0078, + 0x5bc7, 0x0e7e, 0x2071, 0x7600, 0x7544, 0xa582, 0x0001, 0x0048, + 0x5bff, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5bec, + 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5be8, 0x0078, 0x5bdb, + 0x2061, 0x7d00, 0x0078, 0x5bdb, 0x6003, 0x0008, 0x8529, 0x7546, + 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5bfb, 0x754a, 0xa085, + 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7d00, 0x0078, 0x5bf7, 0xa006, + 0x0078, 0x5bf9, 0xac82, 0x7d00, 0x1048, 0x12d5, 0x2001, 0x7615, + 0x2004, 0xac02, 0x10c8, 0x12d5, 0xa006, 0x6006, 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000, 0x6003, 0x0000, 0x2061, - 0x6d00, 0x6044, 0x8000, 0x6046, 0xa086, 0x0001, 0x0040, 0x5589, - 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x0078, - 0x5588, 0x601c, 0xa084, 0x000f, 0x0079, 0x5596, 0x559f, 0x55a7, - 0x55c3, 0x55df, 0x629a, 0x62b6, 0x62d2, 0x559f, 0x55a7, 0xa18e, - 0x0047, 0x00c0, 0x55a6, 0xa016, 0x1078, 0x1532, 0x007c, 0x067e, - 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x55b1, 0x067f, - 0x007c, 0x55c1, 0x5698, 0x5792, 0x55c1, 0x57d7, 0x55c1, 0x55c1, - 0x55c1, 0x5653, 0x5a4d, 0x55c1, 0x55c1, 0x55c1, 0x55c1, 0x55c1, - 0x55c1, 0x1078, 0x12b7, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, - 0x12b7, 0x1079, 0x55cd, 0x067f, 0x007c, 0x55dd, 0x55dd, 0x55dd, - 0x55dd, 0x55dd, 0x55dd, 0x55dd, 0x55dd, 0x5e10, 0x5edd, 0x55dd, - 0x5e29, 0x5e8f, 0x5e29, 0x5e8f, 0x55dd, 0x1078, 0x12b7, 0x067e, - 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x55e9, 0x067f, - 0x007c, 0x55f9, 0x5a96, 0x5b05, 0x5bbb, 0x5cd2, 0x55f9, 0x55f9, - 0x55f9, 0x5a75, 0x5dc6, 0x5dca, 0x55f9, 0x55f9, 0x55f9, 0x55f9, - 0x5df0, 0x1078, 0x12b7, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0, + 0x7600, 0x6044, 0x8000, 0x6046, 0xa086, 0x0001, 0x0040, 0x5c21, + 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4c7a, 0x127f, 0x0078, + 0x5c20, 0x601c, 0xa084, 0x000f, 0x0079, 0x5c2e, 0x5c37, 0x5c3f, + 0x5c5b, 0x5c77, 0x6b4b, 0x6b67, 0x6b83, 0x5c37, 0x5c3f, 0xa18e, + 0x0047, 0x00c0, 0x5c3e, 0xa016, 0x1078, 0x1572, 0x007c, 0x067e, + 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x5c49, 0x067f, + 0x007c, 0x5c59, 0x5d40, 0x5e72, 0x5c59, 0x5ec9, 0x5c59, 0x5c59, + 0x5c59, 0x5cef, 0x6182, 0x5c59, 0x5c59, 0x5c59, 0x5c59, 0x5c59, + 0x5c59, 0x1078, 0x12d5, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, + 0x12d5, 0x1079, 0x5c65, 0x067f, 0x007c, 0x5c75, 0x5c75, 0x5c75, + 0x5c75, 0x5c75, 0x5c75, 0x5c75, 0x5c75, 0x65f2, 0x66b8, 0x5c75, + 0x660b, 0x6664, 0x660b, 0x6664, 0x5c75, 0x1078, 0x12d5, 0x067e, + 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x5c81, 0x067f, + 0x007c, 0x5c91, 0x61c0, 0x6266, 0x6328, 0x647c, 0x5c91, 0x5c91, + 0x5c91, 0x619e, 0x65a7, 0x65ab, 0x5c91, 0x5c91, 0x5c91, 0x5c91, + 0x65d1, 0x1078, 0x12d5, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, 0x9398, 0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, 0xa5a8, 0x0002, 0xa398, - 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5609, 0x0e7e, 0x6010, 0x2070, - 0x7007, 0x0000, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x556a, 0x007c, - 0x0d7e, 0x037e, 0x7330, 0xa386, 0x0200, 0x00c0, 0x562d, 0x6018, - 0x2068, 0x6813, 0x00ff, 0x6817, 0xfffd, 0x6010, 0xa005, 0x0040, - 0x5637, 0x2068, 0x6807, 0x0000, 0x6837, 0x0103, 0x6b32, 0x1078, - 0x556a, 0x037f, 0x0d7f, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98, - 0x6010, 0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x5650, 0x6018, - 0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, 0x6802, - 0x0d7f, 0x0078, 0x5615, 0x2100, 0xa1b2, 0x0024, 0x10c8, 0x12b7, - 0x0079, 0x565a, 0x5680, 0x568c, 0x5680, 0x5680, 0x5680, 0x5680, - 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, - 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, - 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, - 0x567e, 0x5680, 0x567e, 0x5680, 0x5680, 0x567e, 0x1078, 0x12b7, - 0x6003, 0x0001, 0x6106, 0x1078, 0x4376, 0x127e, 0x2091, 0x8000, - 0x1078, 0x476a, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, - 0x4376, 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x007c, - 0x6004, 0xa0b2, 0x0024, 0x10c8, 0x12b7, 0xa1b6, 0x0013, 0x00c0, - 0x56a4, 0x2008, 0x0079, 0x5706, 0xa1b6, 0x0014, 0x00c0, 0x56fd, - 0x1078, 0x4671, 0x6004, 0xa08e, 0x0000, 0x0040, 0x56fe, 0xa08e, - 0x0002, 0x0040, 0x56c9, 0xa08e, 0x0003, 0x0040, 0x56c9, 0xa08e, - 0x0004, 0x0040, 0x56c9, 0xa08e, 0x001f, 0x0040, 0x56fe, 0xa08e, - 0x0021, 0x0040, 0x5702, 0xa08e, 0x0022, 0x0040, 0x56fe, 0x0078, - 0x56f9, 0x1078, 0x206f, 0x2001, 0x0007, 0x1078, 0x33f3, 0x6018, - 0xa080, 0x0028, 0x200c, 0x1078, 0x5778, 0xa186, 0x007e, 0x00c0, - 0x56df, 0x2001, 0x6d2f, 0x2014, 0xa295, 0x0001, 0x2202, 0x017e, - 0x027e, 0x037e, 0x2110, 0x2019, 0x0028, 0x1078, 0x445c, 0x1078, - 0x43a9, 0x0c7e, 0x6018, 0xa065, 0x0040, 0x56f0, 0x1078, 0x35cf, - 0x0c7f, 0x2c08, 0x1078, 0x6a57, 0x037f, 0x027f, 0x017f, 0x1078, - 0x342f, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x1078, 0x5778, - 0x0078, 0x56f9, 0x1078, 0x5786, 0x0078, 0x56f9, 0x572c, 0x572e, - 0x5732, 0x5736, 0x573a, 0x573e, 0x572a, 0x572a, 0x572a, 0x572a, - 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, - 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, - 0x572a, 0x572a, 0x572a, 0x572a, 0x5742, 0x5748, 0x572a, 0x5752, - 0x5748, 0x572a, 0x1078, 0x12b7, 0x0078, 0x5748, 0x2001, 0x000b, - 0x0078, 0x575b, 0x2001, 0x0003, 0x0078, 0x575b, 0x2001, 0x0005, - 0x0078, 0x575b, 0x2001, 0x0001, 0x0078, 0x575b, 0x2001, 0x0009, - 0x0078, 0x575b, 0x1078, 0x12b7, 0x0078, 0x575a, 0x1078, 0x33f3, - 0x1078, 0x4671, 0x6003, 0x0002, 0x6017, 0x0028, 0x1078, 0x476a, - 0x0078, 0x575a, 0x1078, 0x4671, 0x6003, 0x0004, 0x6017, 0x0028, - 0x1078, 0x476a, 0x007c, 0x1078, 0x33f3, 0x1078, 0x4671, 0x6003, - 0x0002, 0x037e, 0x2019, 0x6d5c, 0x2304, 0xa084, 0xff00, 0x00c0, - 0x576d, 0x2019, 0x0028, 0x0078, 0x5772, 0x8007, 0x8003, 0x801b, - 0x831b, 0xa318, 0x6316, 0x037f, 0x1078, 0x476a, 0x0078, 0x575a, - 0x0e7e, 0x6010, 0xa005, 0x0040, 0x5784, 0x2070, 0x7007, 0x0000, + 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5ca1, 0x0e7e, 0x1078, 0x693e, + 0x0040, 0x5cb8, 0x6010, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, + 0x0e7f, 0x1078, 0x5c02, 0x007c, 0x0d7e, 0x037e, 0x7330, 0xa386, + 0x0200, 0x00c0, 0x5cc9, 0x6018, 0x2068, 0x6813, 0x00ff, 0x6817, + 0xfffd, 0x6010, 0xa005, 0x0040, 0x5cd3, 0x2068, 0x6807, 0x0000, + 0x6837, 0x0103, 0x6b32, 0x1078, 0x5c02, 0x037f, 0x0d7f, 0x007c, + 0x0d7e, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0, 0x53a3, 0xa1b6, + 0x0015, 0x00c0, 0x5cec, 0x6018, 0x2068, 0x7038, 0x680a, 0x703c, + 0x680e, 0x6800, 0xc08d, 0x6802, 0x0d7f, 0x0078, 0x5cad, 0x2100, + 0xa1b2, 0x0030, 0x10c8, 0x12d5, 0x0079, 0x5cf6, 0x5d28, 0x5d34, + 0x5d28, 0x5d28, 0x5d28, 0x5d28, 0x5d26, 0x5d26, 0x5d26, 0x5d26, + 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, + 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, + 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d28, 0x5d26, 0x5d28, + 0x5d28, 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d28, 0x5d26, + 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x5d26, 0x1078, 0x12d5, + 0x6003, 0x0001, 0x6106, 0x1078, 0x4872, 0x127e, 0x2091, 0x8000, + 0x1078, 0x4c7a, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, + 0x4872, 0x127e, 0x2091, 0x8000, 0x1078, 0x4c7a, 0x127f, 0x007c, + 0x6004, 0xa0b2, 0x0030, 0x10c8, 0x12d5, 0xa1b6, 0x0013, 0x00c0, + 0x5d4c, 0x2008, 0x0079, 0x5dd5, 0xa1b6, 0x0027, 0x00c0, 0x5da2, + 0x1078, 0x4b81, 0x6004, 0x1078, 0x6aba, 0x0040, 0x5d65, 0x1078, + 0x6ace, 0x0040, 0x5d9a, 0xa08e, 0x0021, 0x0040, 0x5d9e, 0xa08e, + 0x0022, 0x0040, 0x5d9a, 0x0078, 0x5d95, 0x1078, 0x22dd, 0x2001, + 0x0007, 0x1078, 0x37d1, 0x6018, 0xa080, 0x0028, 0x200c, 0x1078, + 0x5e57, 0xa186, 0x007e, 0x00c0, 0x5d7b, 0x2001, 0x762f, 0x2014, + 0xa295, 0x0001, 0x2202, 0x017e, 0x027e, 0x037e, 0x2110, 0x2019, + 0x0028, 0x1078, 0x4962, 0x1078, 0x48a5, 0x0c7e, 0x6018, 0xa065, + 0x0040, 0x5d8c, 0x1078, 0x39a6, 0x0c7f, 0x2c08, 0x1078, 0x737b, + 0x037f, 0x027f, 0x017f, 0x1078, 0x380d, 0x1078, 0x5c02, 0x1078, + 0x4c7a, 0x007c, 0x1078, 0x5e57, 0x0078, 0x5d95, 0x1078, 0x5e66, + 0x0078, 0x5d95, 0xa186, 0x0014, 0x00c0, 0x5d99, 0x1078, 0x4b81, + 0x1078, 0x22bb, 0x1078, 0x6aba, 0x00c0, 0x5dc2, 0x1078, 0x22dd, + 0x6018, 0xa080, 0x0028, 0x200c, 0x1078, 0x5e57, 0xa186, 0x007e, + 0x00c0, 0x5dc0, 0x2001, 0x762f, 0x200c, 0xa18d, 0x0001, 0x2102, + 0x0078, 0x5d95, 0x1078, 0x6ace, 0x00c0, 0x5dca, 0x1078, 0x5e57, + 0x0078, 0x5d95, 0x6004, 0xa08e, 0x0021, 0x0040, 0x5dc6, 0xa08e, + 0x0022, 0x1040, 0x5e66, 0x0078, 0x5d95, 0x5e07, 0x5e09, 0x5e0d, + 0x5e11, 0x5e15, 0x5e19, 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e05, + 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e05, + 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e05, + 0x5e05, 0x5e05, 0x5e05, 0x5e1d, 0x5e23, 0x5e05, 0x5e2d, 0x5e23, + 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e23, 0x5e23, 0x5e05, + 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x5e05, 0x1078, 0x12d5, 0x0078, + 0x5e23, 0x2001, 0x000b, 0x0078, 0x5e36, 0x2001, 0x0003, 0x0078, + 0x5e36, 0x2001, 0x0005, 0x0078, 0x5e36, 0x2001, 0x0001, 0x0078, + 0x5e36, 0x2001, 0x0009, 0x0078, 0x5e36, 0x1078, 0x12d5, 0x0078, + 0x5e35, 0x1078, 0x37d1, 0x1078, 0x4b81, 0x6003, 0x0002, 0x6017, + 0x0028, 0x1078, 0x4c7a, 0x0078, 0x5e35, 0x1078, 0x4b81, 0x6003, + 0x0004, 0x6017, 0x0028, 0x1078, 0x4c7a, 0x007c, 0x1078, 0x37d1, + 0x1078, 0x4b81, 0x6003, 0x0002, 0x037e, 0x2019, 0x765c, 0x2304, + 0xa084, 0xff00, 0x00c0, 0x5e48, 0x2019, 0x0028, 0x0078, 0x5e51, + 0x8007, 0xa09a, 0x0004, 0x0048, 0x5e44, 0x8003, 0x801b, 0x831b, + 0xa318, 0x6316, 0x037f, 0x1078, 0x4c7a, 0x0078, 0x5e35, 0x0e7e, + 0x1078, 0x693e, 0x0040, 0x5e64, 0x6010, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f, 0x007c, 0x0e7e, 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x7023, 0x8001, 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0x00ff, - 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x12b7, 0x6604, 0xa6b6, 0x001f, - 0x00c0, 0x57a6, 0x1078, 0x55fb, 0x0078, 0x57c6, 0x6604, 0xa6b6, - 0x0000, 0x00c0, 0x57af, 0x1078, 0x563c, 0x0078, 0x57c6, 0x6604, - 0xa6b6, 0x0022, 0x00c0, 0x57b8, 0x1078, 0x5620, 0x0078, 0x57c6, - 0xa1b6, 0x0015, 0x00c0, 0x57c0, 0x1079, 0x57cb, 0x0078, 0x57c6, - 0xa1b6, 0x0016, 0x00c0, 0x57c7, 0x1079, 0x58f6, 0x007c, 0x1078, - 0x559f, 0x0078, 0x57c6, 0x57ef, 0x57f2, 0x57ef, 0x5833, 0x57ef, - 0x5892, 0x57ef, 0x57ef, 0x57ef, 0x58ce, 0x57ef, 0x58e4, 0xa1b6, - 0x0048, 0x0040, 0x57e3, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, - 0x1078, 0x1532, 0x007c, 0x0e7e, 0xacf0, 0x0004, 0x2e74, 0x7000, - 0x2070, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x556a, 0x007c, 0x0005, - 0x0005, 0x007c, 0x0e7e, 0x2071, 0x6d00, 0x7078, 0xa086, 0x0074, - 0x00c0, 0x581c, 0x1078, 0x6a2b, 0x00c0, 0x580e, 0x0d7e, 0x6018, - 0x2068, 0x1078, 0x5820, 0x0d7f, 0x2001, 0x0006, 0x1078, 0x33f3, - 0x1078, 0x206f, 0x1078, 0x556a, 0x0078, 0x581e, 0x2001, 0x000a, - 0x1078, 0x33f3, 0x1078, 0x206f, 0x6003, 0x0001, 0x6007, 0x0001, - 0x1078, 0x4376, 0x0078, 0x581e, 0x1078, 0x5889, 0x0e7f, 0x007c, - 0x6800, 0xd084, 0x0040, 0x5832, 0x2001, 0x0000, 0x1078, 0x33df, - 0x2069, 0x6d51, 0x6804, 0xd0a4, 0x0040, 0x5832, 0x2001, 0x0006, - 0x1078, 0x3401, 0x007c, 0x0d7e, 0x2011, 0x6d1e, 0x2204, 0xa086, - 0x0074, 0x00c0, 0x5885, 0x1078, 0x599f, 0x6018, 0x2068, 0xa080, - 0x0028, 0x2014, 0xa286, 0x007e, 0x0040, 0x5850, 0xa286, 0x0080, - 0x00c0, 0x5879, 0x6813, 0x00ff, 0x6817, 0xfffc, 0x0078, 0x586f, - 0x0e7e, 0x0f7e, 0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071, 0x6d2f, - 0x2e04, 0xa085, 0x0003, 0x2072, 0x2071, 0x7280, 0x2079, 0x0100, - 0x2e04, 0xa084, 0x00ff, 0x2069, 0x6d19, 0x206a, 0x78e6, 0x8e70, - 0x2e04, 0x2069, 0x6d1a, 0x206a, 0x78ea, 0x0f7f, 0x0e7f, 0x2001, - 0x0006, 0x1078, 0x33f3, 0x1078, 0x206f, 0x1078, 0x556a, 0x0078, - 0x5887, 0x2001, 0x0004, 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007, - 0x0003, 0x1078, 0x4376, 0x0078, 0x5887, 0x1078, 0x5889, 0x0d7f, - 0x007c, 0x2001, 0x0007, 0x1078, 0x33f3, 0x1078, 0x206f, 0x1078, - 0x556a, 0x007c, 0x0e7e, 0x2071, 0x6d00, 0x7078, 0xa086, 0x0014, - 0x00c0, 0x58c8, 0x7000, 0xa086, 0x0003, 0x00c0, 0x58a5, 0x6010, - 0xa005, 0x00c0, 0x58a5, 0x1078, 0x2ad1, 0x0d7e, 0x6018, 0x2068, - 0x1078, 0x34ca, 0x1078, 0x5820, 0x0d7f, 0x1078, 0x59a9, 0x00c0, - 0x58c8, 0x2001, 0x0006, 0x1078, 0x33f3, 0x0e7e, 0x6010, 0xa005, - 0x0040, 0x58c1, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, - 0x0200, 0x0e7f, 0x1078, 0x206f, 0x1078, 0x556a, 0x0078, 0x58cc, - 0x1078, 0x5778, 0x1078, 0x5889, 0x0e7f, 0x007c, 0x2011, 0x6d1e, - 0x2204, 0xa086, 0x0014, 0x00c0, 0x58e1, 0x2001, 0x0002, 0x1078, - 0x33f3, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4376, 0x0078, - 0x58e3, 0x1078, 0x5889, 0x007c, 0x2011, 0x6d1e, 0x2204, 0xa086, - 0x0004, 0x00c0, 0x58f3, 0x2001, 0x0007, 0x1078, 0x33f3, 0x1078, - 0x556a, 0x0078, 0x58f5, 0x1078, 0x5889, 0x007c, 0x57ef, 0x5902, - 0x57ef, 0x5928, 0x57ef, 0x5952, 0x57ef, 0x57ef, 0x57ef, 0x5967, - 0x57ef, 0x597a, 0x0c7e, 0x1078, 0x598d, 0x00c0, 0x5917, 0x2001, - 0x0000, 0x1078, 0x33df, 0x2001, 0x0002, 0x1078, 0x33f3, 0x6003, - 0x0001, 0x6007, 0x0002, 0x1078, 0x4376, 0x0078, 0x5926, 0x2009, - 0x728f, 0x2104, 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x5924, - 0x1078, 0x556a, 0x0078, 0x5926, 0x1078, 0x5889, 0x0c7f, 0x007c, - 0x1078, 0x599c, 0x00c0, 0x593c, 0x2001, 0x0000, 0x1078, 0x33df, - 0x2001, 0x0002, 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007, 0x0002, - 0x1078, 0x4376, 0x0078, 0x5951, 0x1078, 0x5778, 0x2009, 0x728f, - 0x2104, 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x594f, 0x2001, - 0x0004, 0x1078, 0x33f3, 0x1078, 0x556a, 0x0078, 0x5951, 0x1078, - 0x5889, 0x007c, 0x1078, 0x599c, 0x00c0, 0x5962, 0x2001, 0x0004, - 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x4376, - 0x0078, 0x5966, 0x1078, 0x5778, 0x1078, 0x5889, 0x007c, 0x1078, - 0x599c, 0x00c0, 0x5977, 0x2001, 0x0008, 0x1078, 0x33f3, 0x6003, - 0x0001, 0x6007, 0x0005, 0x1078, 0x4376, 0x0078, 0x5979, 0x1078, - 0x5889, 0x007c, 0x1078, 0x599c, 0x00c0, 0x598a, 0x2001, 0x000a, - 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4376, - 0x0078, 0x598c, 0x1078, 0x5889, 0x007c, 0x2009, 0x728e, 0x2104, - 0xa086, 0x0003, 0x00c0, 0x599b, 0x2009, 0x728f, 0x2104, 0xa084, - 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e, - 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x3459, 0x017f, 0x0c7f, - 0x007c, 0x0e7e, 0x2071, 0x728c, 0x7004, 0xa086, 0x0014, 0x00c0, - 0x59cc, 0x7008, 0xa086, 0x0800, 0x00c0, 0x59cc, 0x700c, 0xd0ec, - 0x0040, 0x59ca, 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, 0x59ca, - 0x7024, 0xd0a4, 0x0040, 0x59ca, 0xd08c, 0x0040, 0x59ca, 0xa006, - 0x0078, 0x59cc, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e, - 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, 0x2091, - 0x8000, 0x2029, 0x6f19, 0x252c, 0x2021, 0x6f1f, 0x2424, 0x2061, - 0x7400, 0x2071, 0x6d00, 0x7244, 0x7060, 0xa202, 0x00c8, 0x5a23, - 0x1078, 0x6c0f, 0x0040, 0x5a1b, 0x671c, 0xa786, 0x0001, 0x0040, - 0x5a1b, 0xa786, 0x0007, 0x0040, 0x5a1b, 0x2500, 0xac06, 0x0040, - 0x5a1b, 0x2400, 0xac06, 0x0040, 0x5a1b, 0x0c7e, 0x6010, 0x2068, - 0x1078, 0x6120, 0x0040, 0x5a11, 0xa786, 0x0003, 0x00c0, 0x5a2d, - 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1, 0x1078, - 0x6276, 0x6000, 0xa086, 0x0004, 0x00c0, 0x5a18, 0x1078, 0x15f2, - 0x1078, 0x6283, 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, - 0x5a23, 0x0078, 0x59e3, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f, - 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, - 0x5a08, 0x1078, 0x6bb3, 0x0078, 0x5a11, 0x220c, 0x2304, 0xa106, - 0x00c0, 0x5a40, 0x8210, 0x8318, 0x00f0, 0x5a35, 0xa006, 0x007c, - 0x2304, 0xa102, 0x0048, 0x5a48, 0x2001, 0x0001, 0x0078, 0x5a4a, - 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x0024, - 0x10c8, 0x12b7, 0xa08e, 0x0000, 0x0040, 0x5a71, 0xa08e, 0x0002, - 0x0040, 0x5a68, 0xa08e, 0x0003, 0x0040, 0x5a68, 0xa08e, 0x0004, - 0x0040, 0x5a68, 0xa08e, 0x001f, 0x0040, 0x5a71, 0x0078, 0x5a6a, - 0x1078, 0x206f, 0x1078, 0x4671, 0x1078, 0x556a, 0x1078, 0x476a, - 0x007c, 0x1078, 0x5778, 0x0078, 0x5a6a, 0xa182, 0x0040, 0x0079, - 0x5a79, 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a88, - 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a8a, 0x5a8a, 0x5a8a, 0x5a8a, - 0x1078, 0x12b7, 0x6003, 0x0001, 0x6106, 0x1078, 0x4327, 0x127e, - 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x007c, 0xa186, 0x0013, - 0x00c0, 0x5a9f, 0x6004, 0xa082, 0x0040, 0x0079, 0x5adf, 0xa186, - 0x0014, 0x10c0, 0x12b7, 0x6004, 0xa082, 0x0040, 0x0079, 0x5aa8, - 0x5ab9, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7, - 0x5ab7, 0x5ab7, 0x5ab7, 0x5ad4, 0x5ad4, 0x5ad4, 0x5ad4, 0x1078, - 0x12b7, 0x2001, 0x0007, 0x1078, 0x33f3, 0x1078, 0x4671, 0x0d7e, - 0x6110, 0x2168, 0x1078, 0x6120, 0x0040, 0x5ace, 0x6837, 0x0103, - 0x684b, 0x0028, 0x1078, 0x36a1, 0x1078, 0x6276, 0x0d7f, 0x1078, - 0x556a, 0x1078, 0x476a, 0x007c, 0x2001, 0x0007, 0x1078, 0x33f3, - 0x1078, 0x4671, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x5af0, - 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee, - 0x5aee, 0x5aee, 0x5afe, 0x5afe, 0x5afe, 0x5afe, 0x1078, 0x12b7, - 0x1078, 0x4671, 0x6003, 0x0002, 0x1078, 0x476a, 0x6010, 0xa088, - 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x007c, 0x1078, 0x4671, - 0x6003, 0x000f, 0x1078, 0x476a, 0x007c, 0xa182, 0x0040, 0x0079, - 0x5b09, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b1a, 0x5b98, - 0x5bb0, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18, - 0x1078, 0x12b7, 0x0e7e, 0x0d7e, 0x2071, 0x728c, 0x6110, 0x2168, - 0x7614, 0xa6b4, 0x0fff, 0x86ff, 0x0040, 0x5b87, 0xa68c, 0x00ff, - 0xa186, 0x0002, 0x0040, 0x5b4c, 0xa186, 0x0028, 0x00c0, 0x5b36, - 0x1078, 0x628a, 0x684b, 0x001c, 0x0078, 0x5b4e, 0xd6dc, 0x0040, - 0x5b41, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, - 0x5b4e, 0xd6d4, 0x0040, 0x5b4c, 0x684b, 0x0007, 0x7318, 0x6b62, - 0x731c, 0x6b5e, 0x0078, 0x5b4e, 0x684b, 0x0000, 0x6837, 0x0103, - 0x6e46, 0xa01e, 0xd6c4, 0x0040, 0x5b61, 0x7328, 0x732c, 0x6b56, - 0x037e, 0x2308, 0x2019, 0x7298, 0xad90, 0x0019, 0x1078, 0x5f4c, - 0x037f, 0xd6cc, 0x0040, 0x5b8c, 0x7124, 0x695a, 0xa192, 0x0021, - 0x00c8, 0x5b75, 0x2071, 0x7298, 0x831c, 0x2300, 0xae18, 0xad90, - 0x001d, 0x1078, 0x5f4c, 0x0078, 0x5b8c, 0x6838, 0xd0fc, 0x0040, - 0x5b7e, 0x2009, 0x0020, 0x695a, 0x0078, 0x5b6a, 0x0f7e, 0x2d78, - 0x1078, 0x5ee4, 0x0f7f, 0x1078, 0x5f39, 0x0078, 0x5b8e, 0x684b, - 0x0000, 0x6837, 0x0103, 0x6e46, 0x1078, 0x36a1, 0x6218, 0x2268, - 0x6a3c, 0x8211, 0x6a3e, 0x0d7f, 0x0e7f, 0x1078, 0x556a, 0x007c, - 0x0f7e, 0x6003, 0x0003, 0x2079, 0x728c, 0x7c04, 0x7b00, 0x7e0c, - 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, - 0x2c10, 0x1078, 0x17de, 0x1078, 0x4395, 0x1078, 0x4821, 0x007c, - 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, - 0x1078, 0x1532, 0x007c, 0xa182, 0x0040, 0x0079, 0x5bbf, 0x5bce, - 0x5bce, 0x5bce, 0x5bce, 0x5bce, 0x5bd0, 0x5c5e, 0x5bce, 0x5bce, - 0x5c74, 0x5cb4, 0x5bce, 0x5bce, 0x5bce, 0x5bce, 0x1078, 0x12b7, - 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x728c, 0x6110, 0x2178, - 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, - 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5c59, 0xa694, - 0xff00, 0xa284, 0x0c00, 0x0040, 0x5bf1, 0x7018, 0x7862, 0x701c, - 0x785e, 0xa284, 0x0300, 0x0040, 0x5c59, 0x1078, 0x130f, 0x1040, - 0x12b7, 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837, 0x0103, - 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, - 0x00ff, 0xa186, 0x0002, 0x0040, 0x5c2b, 0xa186, 0x0028, 0x00c0, - 0x5c15, 0x684b, 0x001c, 0x0078, 0x5c2d, 0xd6dc, 0x0040, 0x5c20, - 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5c2d, - 0xd6d4, 0x0040, 0x5c2b, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, - 0x6b5e, 0x0078, 0x5c2d, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, - 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5c42, 0x7328, 0x732c, - 0x6b56, 0x037e, 0x2308, 0x2019, 0x7298, 0xad90, 0x0019, 0x1078, - 0x5f4c, 0x037f, 0xd6cc, 0x0040, 0x5c59, 0x7124, 0x695a, 0xa192, - 0x0021, 0x00c8, 0x5c56, 0x2071, 0x7298, 0x831c, 0x2300, 0xae18, - 0xad90, 0x001d, 0x1078, 0x5f4c, 0x0078, 0x5c59, 0x2d78, 0x1078, - 0x5ee4, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x0f7e, 0x6003, - 0x0003, 0x2079, 0x728c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010, - 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078, - 0x17de, 0x1078, 0x4fca, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x1078, - 0x4719, 0x1078, 0x4821, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040, - 0x5cb2, 0xd1cc, 0x0040, 0x5c8d, 0x6948, 0x017e, 0x1078, 0x1338, - 0x0d7f, 0x1078, 0x5f39, 0x0078, 0x5cb0, 0x6837, 0x0103, 0x6944, - 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5cac, 0xa086, 0x0028, - 0x00c0, 0x5c9e, 0x684b, 0x001c, 0x0078, 0x5cae, 0xd1dc, 0x0040, - 0x5ca5, 0x684b, 0x0015, 0x0078, 0x5cae, 0xd1d4, 0x0040, 0x5cac, - 0x684b, 0x0007, 0x0078, 0x5cae, 0x684b, 0x0000, 0x1078, 0x36a1, - 0x1078, 0x556a, 0x0d7f, 0x007c, 0x2001, 0x0007, 0x1078, 0x33f3, - 0x1078, 0x4719, 0x0f7e, 0x0d7e, 0x6110, 0x2178, 0x1078, 0x6120, - 0x0040, 0x5ccb, 0x7837, 0x0103, 0x784b, 0x0028, 0x2f68, 0x1078, - 0x36a1, 0x1078, 0x6276, 0x0d7f, 0x0f7f, 0x1078, 0x556a, 0x1078, - 0x4821, 0x007c, 0xa182, 0x0040, 0x0079, 0x5cd6, 0x5ce5, 0x5ce5, - 0x5ce5, 0x5ce5, 0x5ce5, 0x5ce7, 0x5ce5, 0x5d82, 0x5d8a, 0x5ce5, - 0x5ce5, 0x5ce5, 0x5ce5, 0x5ce5, 0x5ce5, 0x1078, 0x12b7, 0x077e, - 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x728c, 0x6110, 0x2178, 0x7614, - 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268, - 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5d74, 0xa694, 0xff00, - 0xa284, 0x0c00, 0x0040, 0x5d08, 0x7018, 0x7862, 0x701c, 0x785e, - 0xa284, 0x0300, 0x0040, 0x5d71, 0x1078, 0x130f, 0x1040, 0x12b7, - 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, 0x6837, 0x0103, - 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, - 0x00ff, 0xa186, 0x0002, 0x0040, 0x5d43, 0xa186, 0x0028, 0x00c0, - 0x5d2d, 0x684b, 0x001c, 0x0078, 0x5d45, 0xd6dc, 0x0040, 0x5d38, - 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5d45, - 0xd6d4, 0x0040, 0x5d43, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, - 0x6b5e, 0x0078, 0x5d45, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, - 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5d5a, 0x7328, 0x732c, - 0x6b56, 0x037e, 0x2308, 0x2019, 0x7298, 0xad90, 0x0019, 0x1078, - 0x5f4c, 0x037f, 0xd6cc, 0x0040, 0x5d71, 0x7124, 0x695a, 0xa192, - 0x0021, 0x00c8, 0x5d6e, 0x2071, 0x7298, 0x831c, 0x2300, 0xae18, - 0xad90, 0x001d, 0x1078, 0x5f4c, 0x0078, 0x5d71, 0x2d78, 0x1078, - 0x5ee4, 0xd6dc, 0x00c0, 0x5d77, 0xa006, 0x0078, 0x5d7b, 0x2001, - 0x0001, 0x7218, 0x731c, 0x1078, 0x156f, 0x0d7f, 0x0e7f, 0x0f7f, - 0x077f, 0x007c, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, - 0x1532, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168, 0x694c, - 0xd1e4, 0x0040, 0x5dc4, 0xd1cc, 0x0040, 0x5d9f, 0x6948, 0x017e, - 0x1078, 0x1338, 0x0d7f, 0x1078, 0x5f39, 0x0078, 0x5dc2, 0x6837, - 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5dbe, - 0xa086, 0x0028, 0x00c0, 0x5db0, 0x684b, 0x001c, 0x0078, 0x5dc0, - 0xd1dc, 0x0040, 0x5db7, 0x684b, 0x0015, 0x0078, 0x5dc0, 0xd1d4, - 0x0040, 0x5dbe, 0x684b, 0x0007, 0x0078, 0x5dc0, 0x684b, 0x0000, - 0x1078, 0x36a1, 0x1078, 0x556a, 0x0d7f, 0x007c, 0x1078, 0x4671, - 0x0078, 0x5dcc, 0x1078, 0x4719, 0x1078, 0x6120, 0x0040, 0x5de3, - 0x0d7e, 0x6110, 0x2168, 0x6837, 0x0103, 0x2009, 0x6d0c, 0x210c, - 0xd18c, 0x00c0, 0x5dec, 0xd184, 0x00c0, 0x5de8, 0x6108, 0x694a, - 0x1078, 0x36a1, 0x0d7f, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, - 0x684b, 0x0004, 0x0078, 0x5de0, 0x684b, 0x0004, 0x0078, 0x5de0, - 0xa182, 0x0040, 0x0079, 0x5df4, 0x5e03, 0x5e03, 0x5e03, 0x5e03, - 0x5e03, 0x5e05, 0x5e03, 0x5e08, 0x5e03, 0x5e03, 0x5e03, 0x5e03, - 0x5e03, 0x5e03, 0x5e03, 0x1078, 0x12b7, 0x1078, 0x556a, 0x007c, - 0x007e, 0x027e, 0xa016, 0x1078, 0x1532, 0x027f, 0x007f, 0x007c, - 0xa182, 0x0025, 0x0079, 0x5e14, 0x5e1d, 0x5e1b, 0x5e1b, 0x5e1b, - 0x5e1b, 0x5e1b, 0x5e1b, 0x1078, 0x12b7, 0x6003, 0x0001, 0x6106, - 0x1078, 0x4327, 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, - 0x007c, 0xa186, 0x0013, 0x00c0, 0x5e33, 0x6004, 0xa082, 0x0025, - 0x2008, 0x0079, 0x5e74, 0xa186, 0x0014, 0x00c0, 0x5e70, 0x1078, - 0x4671, 0x2001, 0x0007, 0x1078, 0x33f3, 0x6018, 0xa080, 0x0028, - 0x200c, 0x017e, 0x027e, 0x037e, 0x2110, 0x2019, 0x0028, 0x1078, - 0x445c, 0x1078, 0x43a9, 0x0c7e, 0x6018, 0xa065, 0x0040, 0x5e52, - 0x1078, 0x35cf, 0x0c7f, 0x2c08, 0x1078, 0x6a57, 0x037f, 0x027f, - 0x017f, 0x1078, 0x342f, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6120, - 0x0040, 0x5e6a, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078, 0x36a1, - 0x1078, 0x6276, 0x0d7f, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, - 0x1078, 0x559f, 0x0078, 0x5e6f, 0x5e7d, 0x5e7b, 0x5e7b, 0x5e7b, - 0x5e7b, 0x5e7b, 0x5e86, 0x1078, 0x12b7, 0x1078, 0x4671, 0x6017, - 0x0014, 0x6003, 0x000c, 0x1078, 0x476a, 0x007c, 0x1078, 0x4671, - 0x6017, 0x0014, 0x6003, 0x000e, 0x1078, 0x476a, 0x007c, 0xa182, - 0x002c, 0x00c8, 0x5e99, 0xa182, 0x0025, 0x0048, 0x5e99, 0x0079, - 0x5e9c, 0x1078, 0x559f, 0x007c, 0x5ea3, 0x5ea3, 0x5ea3, 0x5ea3, - 0x5ea5, 0x5ebf, 0x5ea3, 0x1078, 0x12b7, 0x0d7e, 0x1078, 0x6276, - 0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xa084, 0x0040, 0x0040, - 0x5eb5, 0x684b, 0x0006, 0x0078, 0x5eb7, 0x684b, 0x0005, 0x6847, - 0x0000, 0x1078, 0x36a1, 0x1078, 0x556a, 0x0d7f, 0x007c, 0x0d7e, - 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x5ed9, 0x6837, 0x0103, - 0x6850, 0xa084, 0x0040, 0x0040, 0x5ed1, 0x684b, 0x0006, 0x0078, - 0x5ed3, 0x684b, 0x0005, 0x6847, 0x0000, 0x1078, 0x36a1, 0x1078, - 0x6276, 0x0d7f, 0x1078, 0x556a, 0x007c, 0x1078, 0x4671, 0x1078, - 0x556a, 0x1078, 0x476a, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e, - 0x2029, 0x0001, 0xa182, 0x0101, 0x00c8, 0x5ef0, 0x0078, 0x5ef2, - 0x2009, 0x0100, 0x2130, 0x2069, 0x7298, 0x831c, 0x2300, 0xad18, - 0x2009, 0x0020, 0xaf90, 0x001d, 0x1078, 0x5f4c, 0xa6b2, 0x0020, - 0x7804, 0xa06d, 0x0040, 0x5f06, 0x1078, 0x1338, 0x1078, 0x130f, - 0x0040, 0x5f30, 0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20, - 0x7c06, 0xa68a, 0x003d, 0x00c8, 0x5f1c, 0x2608, 0xad90, 0x000f, - 0x1078, 0x5f4c, 0x0078, 0x5f30, 0xa6b2, 0x003c, 0x2009, 0x003c, - 0x2d78, 0xad90, 0x000f, 0x1078, 0x5f4c, 0x0078, 0x5f06, 0x0f7f, - 0x852f, 0xa5ad, 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x5f35, - 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f, - 0x007c, 0x0f7e, 0x8dff, 0x0040, 0x5f4a, 0x6804, 0xa07d, 0x0040, - 0x5f48, 0x6807, 0x0000, 0x1078, 0x36a1, 0x2f68, 0x0078, 0x5f3d, - 0x1078, 0x36a1, 0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040, - 0x5f52, 0x8108, 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318, - 0x8210, 0x00f0, 0x5f54, 0x157f, 0x007c, 0x127e, 0x2091, 0x8000, - 0x601c, 0xa084, 0x000f, 0x1079, 0x5f67, 0x127f, 0x007c, 0x5f76, - 0x5f6f, 0x5f71, 0x5f8d, 0x5f6f, 0x5f71, 0x5f71, 0x5f71, 0x1078, - 0x12b7, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0x0d7e, 0x6010, - 0x2068, 0x1078, 0x6120, 0x0040, 0x5f8a, 0xa00e, 0x2001, 0x0005, - 0x1078, 0x372d, 0x1078, 0x36a1, 0x1078, 0x556a, 0xa085, 0x0001, - 0x0d7f, 0x007c, 0xa006, 0x0078, 0x5f88, 0x6000, 0xa08a, 0x0010, - 0x10c8, 0x12b7, 0x1079, 0x5f95, 0x007c, 0x5fa5, 0x5fc4, 0x5fa7, - 0x5fd5, 0x5fc0, 0x5fa5, 0x5f71, 0x5f76, 0x5f76, 0x5f71, 0x5f71, - 0x5f71, 0x5f71, 0x5f71, 0x5f71, 0x5f71, 0x1078, 0x12b7, 0x0d7e, - 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x5fb2, 0x6850, 0xa085, - 0x0005, 0x6852, 0x0d7f, 0x6007, 0x0025, 0x6003, 0x000b, 0x601f, - 0x0002, 0x1078, 0x4327, 0x1078, 0x476a, 0xa085, 0x0001, 0x007c, - 0x1078, 0x15f2, 0x0078, 0x5fa7, 0x0e7e, 0x2071, 0x6f10, 0x7024, - 0xac06, 0x00c0, 0x5fcd, 0x1078, 0x5148, 0x1078, 0x5083, 0x0e7f, - 0x00c0, 0x5fa7, 0x1078, 0x5f71, 0x007c, 0x037e, 0x0e7e, 0x2071, - 0x6f10, 0x703c, 0xac06, 0x00c0, 0x5fe1, 0x2019, 0x0000, 0x1078, - 0x51da, 0x1078, 0x54b6, 0x0e7f, 0x037f, 0x00c0, 0x5fa7, 0x1078, - 0x5f71, 0x007c, 0x0c7e, 0x601c, 0xa084, 0x000f, 0x1079, 0x5ff2, - 0x0c7f, 0x007c, 0x5ffb, 0x605b, 0x60c8, 0x5fff, 0x5ffb, 0x5ffb, - 0x5ffb, 0x556a, 0x605b, 0x007c, 0x6017, 0x0001, 0x007c, 0x6000, - 0xa08a, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x6007, 0x007c, 0x6017, - 0x6019, 0x603a, 0x604d, 0x604d, 0x6017, 0x5ffb, 0x5ffb, 0x5ffb, - 0x604d, 0x604d, 0x6017, 0x6017, 0x6017, 0x6017, 0x6058, 0x1078, - 0x12b7, 0x0e7e, 0x6010, 0x2070, 0x7050, 0xa085, 0x0040, 0x7052, - 0x2071, 0x6f10, 0x7024, 0xac06, 0x0040, 0x6036, 0x1078, 0x5083, - 0x6007, 0x0025, 0x6003, 0x000b, 0x601f, 0x0002, 0x6017, 0x0014, - 0x1078, 0x4327, 0x1078, 0x476a, 0x0e7f, 0x007c, 0x6017, 0x0001, - 0x0078, 0x6034, 0x0d7e, 0x6010, 0x2068, 0x6850, 0xa085, 0x0040, - 0x6852, 0x0d7f, 0x6007, 0x0025, 0x6003, 0x000b, 0x601f, 0x0002, - 0x1078, 0x4327, 0x1078, 0x476a, 0x007c, 0x0d7e, 0x6017, 0x0001, - 0x6010, 0x2068, 0x6850, 0xa085, 0x0040, 0x6852, 0x0d7f, 0x007c, - 0x1078, 0x556a, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12b7, - 0x1079, 0x6063, 0x007c, 0x6073, 0x5ffc, 0x6075, 0x6073, 0x6075, - 0x6073, 0x6073, 0x6073, 0x5ffb, 0x5ffb, 0x6073, 0x6073, 0x6073, - 0x6073, 0x6073, 0x6073, 0x1078, 0x12b7, 0x0d7e, 0x6018, 0x2068, - 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c, 0x10c8, 0x12b7, - 0x1079, 0x6083, 0x007c, 0x608f, 0x60b1, 0x608f, 0x60b1, 0x608f, - 0x60b1, 0x6091, 0x609a, 0x608f, 0x60b1, 0x608f, 0x60aa, 0x1078, - 0x12b7, 0x6004, 0xa08e, 0x0004, 0x0040, 0x60ac, 0xa08e, 0x0002, - 0x0040, 0x60ac, 0xa08e, 0x0000, 0x0040, 0x60c0, 0xa08e, 0x001f, - 0x0040, 0x60c0, 0xa08e, 0x0021, 0x0040, 0x60c4, 0xa08e, 0x0022, - 0x0040, 0x60c0, 0x1078, 0x2051, 0x1078, 0x5778, 0x1078, 0x556a, - 0x007c, 0x1078, 0x5778, 0x1078, 0x2051, 0x0e7e, 0x127e, 0x2091, - 0x8000, 0x1078, 0x206f, 0x127f, 0x0e7f, 0x1078, 0x556a, 0x007c, - 0x1078, 0x5778, 0x0078, 0x60ac, 0x1078, 0x5786, 0x0078, 0x60ac, - 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x60d0, 0x007c, - 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0, - 0x60e0, 0x5ffb, 0x60e0, 0x5ffc, 0x60e2, 0x5ffc, 0x60eb, 0x60e0, - 0x1078, 0x12b7, 0x6007, 0x002b, 0x6003, 0x000d, 0x1078, 0x4327, - 0x1078, 0x476a, 0x007c, 0x1078, 0x6276, 0x1078, 0x6120, 0x0040, - 0x6109, 0x1078, 0x2051, 0x0d7e, 0x6010, 0x2068, 0x6837, 0x0103, - 0x684b, 0x0006, 0x1078, 0x36a1, 0x0d7f, 0x601f, 0x0001, 0x6007, - 0x0001, 0x6003, 0x0001, 0x1078, 0x4376, 0x1078, 0x476a, 0x0078, - 0x610b, 0x1078, 0x556a, 0x007c, 0xa284, 0x0007, 0x00c0, 0x611d, - 0xa282, 0x7400, 0x0048, 0x611d, 0x2001, 0x6d15, 0x2004, 0xa202, - 0x00c8, 0x611d, 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x611c, - 0x027e, 0x0e7e, 0x2071, 0x6d00, 0x6210, 0x7058, 0xa202, 0x0048, - 0x6132, 0x705c, 0xa202, 0x00c8, 0x6132, 0xa085, 0x0001, 0x0e7f, - 0x027f, 0x007c, 0xa006, 0x0078, 0x612f, 0x0e7e, 0x0c7e, 0x037e, - 0x007e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7400, 0x2071, 0x6d00, - 0x7344, 0x7060, 0xa302, 0x00c8, 0x6155, 0x601c, 0xa206, 0x00c0, - 0x614d, 0x0c7e, 0x1078, 0x556a, 0x0c7f, 0xace0, 0x0008, 0x7054, - 0xac02, 0x00c8, 0x6155, 0x0078, 0x6140, 0x127f, 0x007f, 0x037f, - 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x017e, 0x127e, 0x2091, - 0x8000, 0xa188, 0x6e00, 0x210c, 0x81ff, 0x0040, 0x6182, 0x2061, - 0x7400, 0x2071, 0x6d00, 0x7344, 0x7060, 0xa302, 0x00c8, 0x6182, - 0x6018, 0xa106, 0x00c0, 0x617c, 0x1078, 0x2051, 0x017e, 0x0c7e, - 0x1078, 0x556a, 0x0c7f, 0x017f, 0xace0, 0x0008, 0x7054, 0xac02, - 0x0048, 0x6170, 0x127f, 0x017f, 0x0c7f, 0x0e7f, 0x007c, 0x0c7e, - 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5504, 0x057f, - 0x0040, 0x61a0, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009, 0x004b, - 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, - 0xa006, 0x0078, 0x619c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, - 0x62a0, 0x0c7e, 0x1078, 0x5504, 0x057f, 0x0040, 0x61ca, 0x6013, - 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078, 0x35cf, - 0x0c7f, 0x1078, 0x445c, 0x1078, 0x43a9, 0x2c08, 0x1078, 0x6a57, - 0x2009, 0x004c, 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x057f, - 0x0c7f, 0x007c, 0xa006, 0x0078, 0x61c6, 0x0c7e, 0x057e, 0x127e, - 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5504, 0x057f, 0x0040, - 0x61f5, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005, 0x0c7e, - 0x2560, 0x1078, 0x35cf, 0x0c7f, 0x1078, 0x445c, 0x1078, 0x43a9, - 0x2c08, 0x1078, 0x6a57, 0x2009, 0x004d, 0x1078, 0x5591, 0xa085, - 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x61f1, - 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, - 0x5504, 0x057f, 0x0040, 0x6220, 0x6612, 0x651a, 0x601f, 0x0003, - 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x35cf, 0x0c7f, 0x1078, - 0x445c, 0x1078, 0x43a9, 0x2c08, 0x1078, 0x6a57, 0x2009, 0x004e, - 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, - 0xa006, 0x0078, 0x621c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, - 0x1078, 0x5504, 0x017f, 0x0040, 0x623c, 0x660a, 0x611a, 0x601f, - 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x5591, 0xa085, - 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6239, 0x0c7e, - 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040, - 0x6258, 0x660a, 0x611a, 0x601f, 0x0008, 0x2d00, 0x6012, 0x2009, - 0x0021, 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, - 0xa006, 0x0078, 0x6255, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, - 0x1078, 0x5504, 0x017f, 0x0040, 0x6273, 0x611a, 0x601f, 0x0001, - 0x2d00, 0x6012, 0x2009, 0x0000, 0x1078, 0x5591, 0xa085, 0x0001, - 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6270, 0x027e, 0x0d7e, - 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0040, 0x6280, 0x8211, 0x6a3e, - 0x0d7f, 0x027f, 0x007c, 0x6013, 0x0000, 0x601f, 0x0007, 0x6017, - 0x0014, 0x007c, 0x067e, 0x0c7e, 0x2031, 0x6d52, 0x2634, 0xd6e4, - 0x0040, 0x6297, 0x6618, 0x2660, 0x6e44, 0x1078, 0x3507, 0x0c7f, - 0x067f, 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7, - 0x1079, 0x62a4, 0x067f, 0x007c, 0x62b4, 0x640b, 0x64d4, 0x62b4, - 0x62b4, 0x62b4, 0x62b4, 0x62b4, 0x62ee, 0x6542, 0x62b4, 0x62b4, - 0x62b4, 0x62b4, 0x62b4, 0x62b4, 0x1078, 0x12b7, 0x067e, 0x6000, - 0xa0b2, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x62c0, 0x067f, 0x007c, - 0x62d0, 0x6837, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0, - 0x6812, 0x687d, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0, - 0x1078, 0x12b7, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7, - 0x1079, 0x62dc, 0x067f, 0x007c, 0x62ec, 0x668f, 0x66fb, 0x671c, - 0x6769, 0x62ec, 0x62ec, 0x67be, 0x654e, 0x67fa, 0x67fe, 0x62ec, - 0x62ec, 0x62ec, 0x62ec, 0x62ec, 0x1078, 0x12b7, 0xa1b2, 0x0024, - 0x10c8, 0x12b7, 0x2100, 0x0079, 0x62f5, 0x6319, 0x63f5, 0x6319, - 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, - 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, - 0x6319, 0x6319, 0x6319, 0x6319, 0x631b, 0x634a, 0x6354, 0x637c, - 0x6382, 0x63b6, 0x63ee, 0x6319, 0x6319, 0x63fd, 0x6319, 0x6319, - 0x6404, 0x1078, 0x12b7, 0x1078, 0x364d, 0x6618, 0x0c7e, 0x2660, - 0x1078, 0x3459, 0x0c7f, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, - 0xa082, 0x0006, 0x0048, 0x633c, 0x1078, 0x6993, 0x00c0, 0x6376, - 0x1078, 0x6931, 0x00c0, 0x6338, 0x6007, 0x0008, 0x0078, 0x63f0, - 0x6007, 0x0009, 0x0078, 0x63f0, 0x1078, 0x6b02, 0x0040, 0x6346, - 0x1078, 0x6993, 0x0040, 0x6330, 0x0078, 0x6376, 0x6013, 0x1900, - 0x0078, 0x6338, 0x1078, 0x68b7, 0x6007, 0x0006, 0x0078, 0x63f0, - 0x6007, 0x0007, 0x0078, 0x63f0, 0x0d7e, 0x6618, 0x2668, 0x6e04, - 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6366, 0xa686, - 0x0004, 0x0040, 0x6366, 0x0d7f, 0x0078, 0x6376, 0x1078, 0x69f1, - 0x00c0, 0x6371, 0x1078, 0x34ca, 0x6007, 0x000a, 0x0d7f, 0x0078, - 0x63f0, 0x6007, 0x000b, 0x0d7f, 0x0078, 0x63f0, 0x1078, 0x2051, - 0x6007, 0x0001, 0x0078, 0x63f0, 0x1078, 0x2051, 0x6007, 0x000c, - 0x0078, 0x63f0, 0x1078, 0x364d, 0x6618, 0xa6b0, 0x0001, 0x2634, - 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x63a3, 0xa6b4, 0xff00, - 0x8637, 0xa686, 0x0006, 0x00c0, 0x6376, 0x1078, 0x6a00, 0x00c0, - 0x639d, 0x6007, 0x000e, 0x0078, 0x63f0, 0x1078, 0x2051, 0x6007, - 0x000f, 0x0078, 0x63f0, 0x1078, 0x6b02, 0x0040, 0x63b0, 0xa6b4, - 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6395, 0x0078, 0x6376, - 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x63f0, 0x1078, 0x364d, - 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, - 0x0048, 0x63db, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0, - 0x6376, 0x1078, 0x6a2b, 0x00c0, 0x63d5, 0x1078, 0x6931, 0x00c0, - 0x63d5, 0x6007, 0x0010, 0x0078, 0x63f0, 0x1078, 0x2051, 0x6007, - 0x0011, 0x0078, 0x63f0, 0x1078, 0x6b02, 0x0040, 0x63e8, 0xa6b4, - 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x63c9, 0x0078, 0x6376, - 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x63f0, 0x6007, 0x0012, - 0x6003, 0x0001, 0x1078, 0x4376, 0x007c, 0x6007, 0x0001, 0x6003, - 0x0001, 0x1078, 0x4376, 0x0078, 0x63f4, 0x6007, 0x0020, 0x6003, - 0x0001, 0x1078, 0x4376, 0x007c, 0x6007, 0x0023, 0x6003, 0x0001, - 0x1078, 0x4376, 0x007c, 0x6004, 0xa0b2, 0x0024, 0x10c8, 0x12b7, - 0xa1b6, 0x0013, 0x00c0, 0x6417, 0x2008, 0x0079, 0x6426, 0xa1b6, - 0x0014, 0x10c0, 0x12b7, 0x2001, 0x0007, 0x1078, 0x3401, 0x1078, - 0x4671, 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0x644a, 0x644c, - 0x644a, 0x644a, 0x644a, 0x644c, 0x6454, 0x64af, 0x6472, 0x64af, - 0x6486, 0x64af, 0x6454, 0x64af, 0x64a7, 0x64af, 0x64a7, 0x64af, - 0x64af, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, - 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x64af, 0x644a, - 0x644a, 0x64af, 0x1078, 0x12b7, 0x1078, 0x4671, 0x6003, 0x0002, - 0x1078, 0x476a, 0x0078, 0x64b5, 0x0f7e, 0x2079, 0x6d51, 0x7804, - 0x0f7f, 0xd0ac, 0x00c0, 0x64af, 0x2001, 0x0000, 0x1078, 0x33df, - 0x2001, 0x0002, 0x1078, 0x33f3, 0x1078, 0x4671, 0x601f, 0x0001, - 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4376, 0x1078, 0x476a, - 0x0078, 0x64b5, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4, - 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x64af, 0xa686, 0x0004, - 0x0040, 0x64af, 0x2001, 0x0004, 0x0078, 0x64ad, 0x2001, 0x6d00, - 0x2004, 0xa086, 0x0003, 0x00c0, 0x648f, 0x1078, 0x2ad1, 0x2001, - 0x0006, 0x1078, 0x64b6, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, - 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x64af, 0x2001, - 0x0006, 0x0078, 0x64ad, 0x2001, 0x0004, 0x0078, 0x64ad, 0x2001, - 0x0006, 0x1078, 0x64b6, 0x0078, 0x64af, 0x1078, 0x3401, 0x1078, - 0x4671, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x017e, 0x0d7e, - 0x6118, 0x2168, 0x6900, 0xd184, 0x0040, 0x64d1, 0x6104, 0xa18e, - 0x000a, 0x00c0, 0x64c9, 0x699c, 0xd1a4, 0x00c0, 0x64c9, 0x2001, - 0x0007, 0x1078, 0x33f3, 0x2001, 0x0000, 0x1078, 0x33df, 0x1078, - 0x206f, 0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, - 0xa084, 0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x12b7, - 0xa1b6, 0x0015, 0x00c0, 0x64e8, 0x1079, 0x64ef, 0x0078, 0x64ee, - 0xa1b6, 0x0016, 0x10c0, 0x12b7, 0x1079, 0x6527, 0x007c, 0x57ef, - 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x64fb, 0x57ef, - 0x57ef, 0x57ef, 0x57ef, 0x0f7e, 0x2079, 0x6d51, 0x7804, 0x0f7f, - 0xd0ac, 0x00c0, 0x6517, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001, - 0x0002, 0x1078, 0x33f3, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, - 0x0002, 0x1078, 0x4376, 0x1078, 0x476a, 0x0078, 0x6526, 0x2011, - 0x7283, 0x220c, 0x017e, 0x0c7e, 0x1078, 0x3447, 0x00c0, 0x6526, - 0x1078, 0x3256, 0x0c7f, 0x017f, 0x1078, 0x556a, 0x007c, 0x57ef, - 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x6533, 0x57ef, - 0x57ef, 0x57ef, 0x57ef, 0x1078, 0x599c, 0x00c0, 0x653f, 0x6003, - 0x0001, 0x6007, 0x0001, 0x1078, 0x4376, 0x0078, 0x6541, 0x1078, - 0x556a, 0x007c, 0x6004, 0xa08a, 0x0024, 0x10c8, 0x12b7, 0x1078, - 0x4671, 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0xa182, 0x0040, - 0x0079, 0x6552, 0x6561, 0x6561, 0x6561, 0x6561, 0x6563, 0x6561, - 0x6561, 0x6561, 0x6561, 0x6561, 0x6561, 0x6561, 0x6561, 0x6561, - 0x6561, 0x1078, 0x12b7, 0x0d7e, 0x0e7e, 0x0f7e, 0x157e, 0x047e, - 0x027e, 0x2071, 0x7280, 0x7444, 0xa4a4, 0xe600, 0x0040, 0x65d4, - 0xa486, 0x2000, 0x0040, 0x6592, 0xa486, 0x0400, 0x0040, 0x6592, - 0x7130, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8, 0x6663, 0x0c7e, - 0x1078, 0x416d, 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, - 0x6644, 0x1078, 0x420a, 0x0040, 0x666f, 0xa295, 0x0200, 0x6a02, - 0x0078, 0x6598, 0x2009, 0x0001, 0x2011, 0x0200, 0x1078, 0x41f4, - 0x1078, 0x130f, 0x1040, 0x12b7, 0x6003, 0x0007, 0x6106, 0x2d00, - 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x6c5a, 0x2c00, - 0x685e, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, 0xa18c, 0x00ff, - 0xa10d, 0x6946, 0x684f, 0x0000, 0x6857, 0x0036, 0x1078, 0x36a1, - 0xa486, 0x2000, 0x00c0, 0x65c2, 0x2019, 0x0017, 0x1078, 0x6b8f, - 0x0078, 0x6631, 0xa486, 0x0400, 0x00c0, 0x65cc, 0x2019, 0x0002, - 0x1078, 0x6b8f, 0x0078, 0x6631, 0xa486, 0x0200, 0x00c0, 0x65d2, - 0x1078, 0x6b80, 0x0078, 0x6631, 0x7130, 0xa18c, 0x00ff, 0xa182, - 0x0010, 0x00c8, 0x6687, 0x0c7e, 0x1078, 0x416d, 0x2c68, 0x0c7f, - 0x6a00, 0xa284, 0x0001, 0x0040, 0x668b, 0xa284, 0x0300, 0x00c0, - 0x6683, 0x6804, 0xa005, 0x0040, 0x666f, 0x8001, 0x6806, 0x6003, - 0x0007, 0x6106, 0x1078, 0x12f4, 0x0040, 0x6638, 0x6013, 0x0000, - 0x6803, 0x0000, 0x6837, 0x0116, 0x683b, 0x0000, 0x2c00, 0x684a, - 0x6018, 0x2078, 0x78a0, 0x8007, 0xa10d, 0x6946, 0x6853, 0x003d, - 0x7044, 0xa084, 0x0003, 0xa086, 0x0002, 0x00c0, 0x6613, 0x684f, - 0x0040, 0x0078, 0x661d, 0xa086, 0x0001, 0x00c0, 0x661b, 0x684f, - 0x0080, 0x0078, 0x661d, 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001, - 0x7290, 0xad90, 0x0015, 0x200c, 0x810f, 0x2112, 0x8000, 0x8210, - 0x00f0, 0x6623, 0x200c, 0x6982, 0x8000, 0x200c, 0x697e, 0x1078, - 0x36a1, 0x027f, 0x047f, 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c, - 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x4327, - 0x1078, 0x476a, 0x0078, 0x6631, 0x2069, 0x7292, 0x2d04, 0xa084, - 0xff00, 0xa086, 0x1200, 0x00c0, 0x6663, 0x2069, 0x7280, 0x686c, - 0xa084, 0x00ff, 0x017e, 0x6110, 0xa18c, 0x0700, 0xa10d, 0x6112, - 0x017f, 0x6003, 0x0001, 0x6007, 0x0043, 0x1078, 0x4327, 0x1078, - 0x476a, 0x0078, 0x6631, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007, - 0x0041, 0x1078, 0x4327, 0x1078, 0x476a, 0x0078, 0x6631, 0xa284, - 0x0004, 0x00c0, 0x6677, 0x6013, 0x0300, 0x0078, 0x6679, 0x6013, - 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x4327, 0x1078, - 0x476a, 0x0078, 0x6631, 0x6013, 0x0500, 0x0078, 0x6679, 0x6013, - 0x0600, 0x0078, 0x6644, 0x6013, 0x0200, 0x0078, 0x6644, 0xa186, - 0x0013, 0x00c0, 0x66a1, 0x6004, 0xa08a, 0x0040, 0x1048, 0x12b7, - 0xa08a, 0x004f, 0x10c8, 0x12b7, 0xa082, 0x0040, 0x2008, 0x0079, - 0x66cd, 0xa186, 0x0047, 0x00c0, 0x66a7, 0x0078, 0x66fb, 0xa186, - 0x0014, 0x10c0, 0x12b7, 0x6004, 0xa082, 0x0040, 0x2008, 0x0079, - 0x66b1, 0x66c0, 0x66c2, 0x66c2, 0x66c0, 0x66c0, 0x66c0, 0x66c0, - 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0, - 0x1078, 0x12b7, 0x2001, 0x0007, 0x1078, 0x3401, 0x1078, 0x4671, - 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0x66dc, 0x66ec, 0x66e5, - 0x66f5, 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x66dc, - 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x1078, 0x12b7, 0x6010, 0xa088, - 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x1078, 0x4671, 0x6003, - 0x0002, 0x1078, 0x476a, 0x007c, 0x1078, 0x4671, 0x1078, 0x41cd, - 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x1078, 0x4671, 0x2009, - 0x0041, 0x0078, 0x67be, 0xa182, 0x0040, 0x0079, 0x66ff, 0x670e, - 0x6710, 0x670e, 0x670e, 0x670e, 0x670e, 0x670e, 0x6711, 0x670e, - 0x670e, 0x670e, 0x670e, 0x670e, 0x670e, 0x670e, 0x1078, 0x12b7, + 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x12d5, 0x6604, 0xa6b6, 0x0028, + 0x00c0, 0x5e86, 0x1078, 0x6b03, 0x0078, 0x5eb8, 0x6604, 0xa6b6, + 0x0029, 0x00c0, 0x5e8f, 0x1078, 0x6b1d, 0x0078, 0x5eb8, 0x6604, + 0xa6b6, 0x001f, 0x00c0, 0x5e98, 0x1078, 0x5c93, 0x0078, 0x5eb8, + 0x6604, 0xa6b6, 0x0000, 0x00c0, 0x5ea1, 0x1078, 0x5cd8, 0x0078, + 0x5eb8, 0x6604, 0xa6b6, 0x0022, 0x00c0, 0x5eaa, 0x1078, 0x5cbc, + 0x0078, 0x5eb8, 0xa1b6, 0x0015, 0x00c0, 0x5eb2, 0x1079, 0x5ebd, + 0x0078, 0x5eb8, 0xa1b6, 0x0016, 0x00c0, 0x5eb9, 0x1079, 0x5ffa, + 0x007c, 0x1078, 0x5c37, 0x0078, 0x5eb8, 0x5ee1, 0x5ee4, 0x5ee1, + 0x5f25, 0x5ee1, 0x5f96, 0x5ee1, 0x5ee1, 0x5ee1, 0x5fd2, 0x5ee1, + 0x5fe8, 0xa1b6, 0x0048, 0x0040, 0x5ed5, 0x20e1, 0x0005, 0x3d18, + 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0x0e7e, 0xacf0, 0x0004, + 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x5c02, + 0x007c, 0x0005, 0x0005, 0x007c, 0x0e7e, 0x2071, 0x7600, 0x7078, + 0xa086, 0x0074, 0x00c0, 0x5f0e, 0x1078, 0x734f, 0x00c0, 0x5f00, + 0x0d7e, 0x6018, 0x2068, 0x1078, 0x5f12, 0x0d7f, 0x2001, 0x0006, + 0x1078, 0x37d1, 0x1078, 0x22dd, 0x1078, 0x5c02, 0x0078, 0x5f10, + 0x2001, 0x000a, 0x1078, 0x37d1, 0x1078, 0x22dd, 0x6003, 0x0001, + 0x6007, 0x0001, 0x1078, 0x4872, 0x0078, 0x5f10, 0x1078, 0x5f86, + 0x0e7f, 0x007c, 0x6800, 0xd084, 0x0040, 0x5f24, 0x2001, 0x0000, + 0x1078, 0x37bd, 0x2069, 0x7651, 0x6804, 0xd0a4, 0x0040, 0x5f24, + 0x2001, 0x0006, 0x1078, 0x37df, 0x007c, 0x0d7e, 0x2011, 0x761e, + 0x2204, 0xa086, 0x0074, 0x00c0, 0x5f82, 0x1078, 0x60d4, 0x6018, + 0x2068, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e, 0x0040, 0x5f4d, + 0xa286, 0x0080, 0x00c0, 0x5f76, 0x6813, 0x00ff, 0x6817, 0xfffc, + 0x6010, 0xa005, 0x0040, 0x5f6c, 0x2068, 0x6807, 0x0000, 0x6837, + 0x0103, 0x6833, 0x0200, 0x0078, 0x5f6c, 0x0e7e, 0x0f7e, 0x6813, + 0x00ff, 0x6817, 0xfffe, 0x2071, 0x762f, 0x2e04, 0xa085, 0x0003, + 0x2072, 0x2071, 0x7b80, 0x2079, 0x0100, 0x2e04, 0xa084, 0x00ff, + 0x2069, 0x7619, 0x206a, 0x78e6, 0x8e70, 0x2e04, 0x2069, 0x761a, + 0x206a, 0x78ea, 0x0f7f, 0x0e7f, 0x2001, 0x0006, 0x1078, 0x37d1, + 0x1078, 0x22dd, 0x1078, 0x5c02, 0x0078, 0x5f84, 0x2001, 0x0004, + 0x1078, 0x37d1, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x4872, + 0x0078, 0x5f84, 0x1078, 0x5f86, 0x0d7f, 0x007c, 0x2001, 0x7600, + 0x2004, 0xa086, 0x0003, 0x0040, 0x5f91, 0x2001, 0x0007, 0x1078, + 0x37d1, 0x1078, 0x22dd, 0x1078, 0x5c02, 0x007c, 0x0e7e, 0x2071, + 0x7600, 0x7078, 0xa086, 0x0014, 0x00c0, 0x5fcc, 0x7000, 0xa086, + 0x0003, 0x00c0, 0x5fa9, 0x6010, 0xa005, 0x00c0, 0x5fa9, 0x1078, + 0x2dc8, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x38a1, 0x1078, 0x5f12, + 0x0d7f, 0x1078, 0x60de, 0x00c0, 0x5fcc, 0x2001, 0x0006, 0x1078, + 0x37d1, 0x0e7e, 0x6010, 0xa005, 0x0040, 0x5fc5, 0x2070, 0x7007, + 0x0000, 0x7037, 0x0103, 0x7033, 0x0200, 0x0e7f, 0x1078, 0x22dd, + 0x1078, 0x5c02, 0x0078, 0x5fd0, 0x1078, 0x5e57, 0x1078, 0x5f86, + 0x0e7f, 0x007c, 0x2011, 0x761e, 0x2204, 0xa086, 0x0014, 0x00c0, + 0x5fe5, 0x2001, 0x0002, 0x1078, 0x37d1, 0x6003, 0x0001, 0x6007, + 0x0001, 0x1078, 0x4872, 0x0078, 0x5fe7, 0x1078, 0x5f86, 0x007c, + 0x2011, 0x761e, 0x2204, 0xa086, 0x0004, 0x00c0, 0x5ff7, 0x2001, + 0x0007, 0x1078, 0x37d1, 0x1078, 0x5c02, 0x0078, 0x5ff9, 0x1078, + 0x5f86, 0x007c, 0x5ee1, 0x6006, 0x5ee1, 0x602c, 0x5ee1, 0x6087, + 0x5ee1, 0x5ee1, 0x5ee1, 0x609c, 0x5ee1, 0x60af, 0x0c7e, 0x1078, + 0x60c2, 0x00c0, 0x601b, 0x2001, 0x0000, 0x1078, 0x37bd, 0x2001, + 0x0002, 0x1078, 0x37d1, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, + 0x4872, 0x0078, 0x602a, 0x2009, 0x7b8f, 0x2104, 0xa084, 0xff00, + 0xa086, 0x1900, 0x00c0, 0x6028, 0x1078, 0x5c02, 0x0078, 0x602a, + 0x1078, 0x5f86, 0x0c7f, 0x007c, 0x1078, 0x60d1, 0x00c0, 0x6040, + 0x2001, 0x0000, 0x1078, 0x37bd, 0x2001, 0x0002, 0x1078, 0x37d1, + 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4872, 0x0078, 0x6062, + 0x1078, 0x5e57, 0x2009, 0x7b8e, 0x2134, 0xa6b4, 0x00ff, 0xa686, + 0x0005, 0x0040, 0x6063, 0x2009, 0x7b8f, 0x2104, 0xa084, 0xff00, + 0xa086, 0x1900, 0x00c0, 0x6060, 0xa686, 0x0009, 0x0040, 0x6063, + 0x2001, 0x0004, 0x1078, 0x37d1, 0x1078, 0x5c02, 0x0078, 0x6062, + 0x1078, 0x5f86, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x693e, + 0x0040, 0x6071, 0x6838, 0xd0fc, 0x0040, 0x6071, 0x0d7f, 0x0078, + 0x6060, 0x6018, 0x2068, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, + 0x6082, 0x8001, 0x6842, 0x6017, 0x000a, 0x6007, 0x0016, 0x0d7f, + 0x0078, 0x6062, 0x1078, 0x22bb, 0x0d7f, 0x0078, 0x6060, 0x1078, + 0x60d1, 0x00c0, 0x6097, 0x2001, 0x0004, 0x1078, 0x37d1, 0x6003, + 0x0001, 0x6007, 0x0003, 0x1078, 0x4872, 0x0078, 0x609b, 0x1078, + 0x5e57, 0x1078, 0x5f86, 0x007c, 0x1078, 0x60d1, 0x00c0, 0x60ac, + 0x2001, 0x0008, 0x1078, 0x37d1, 0x6003, 0x0001, 0x6007, 0x0005, + 0x1078, 0x4872, 0x0078, 0x60ae, 0x1078, 0x5f86, 0x007c, 0x1078, + 0x60d1, 0x00c0, 0x60bf, 0x2001, 0x000a, 0x1078, 0x37d1, 0x6003, + 0x0001, 0x6007, 0x0001, 0x1078, 0x4872, 0x0078, 0x60c1, 0x1078, + 0x5f86, 0x007c, 0x2009, 0x7b8e, 0x2104, 0xa086, 0x0003, 0x00c0, + 0x60d0, 0x2009, 0x7b8f, 0x2104, 0xa084, 0xff00, 0xa086, 0x2a00, + 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e, 0x017e, 0xac88, 0x0006, + 0x2164, 0x1078, 0x3837, 0x017f, 0x0c7f, 0x007c, 0x0e7e, 0x2071, + 0x7b8c, 0x7004, 0xa086, 0x0014, 0x00c0, 0x6101, 0x7008, 0xa086, + 0x0800, 0x00c0, 0x6101, 0x700c, 0xd0ec, 0x0040, 0x60ff, 0xa084, + 0x0f00, 0xa086, 0x0100, 0x00c0, 0x60ff, 0x7024, 0xd0a4, 0x0040, + 0x60ff, 0xd08c, 0x0040, 0x60ff, 0xa006, 0x0078, 0x6101, 0xa085, + 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x057e, + 0x047e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2029, 0x783f, + 0x252c, 0x2021, 0x7845, 0x2424, 0x2061, 0x7d00, 0x2071, 0x7600, + 0x7244, 0x7060, 0xa202, 0x00c8, 0x6158, 0x1078, 0x7559, 0x0040, + 0x6150, 0x671c, 0xa786, 0x0001, 0x0040, 0x6150, 0xa786, 0x0007, + 0x0040, 0x6150, 0x2500, 0xac06, 0x0040, 0x6150, 0x2400, 0xac06, + 0x0040, 0x6150, 0x0c7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x613a, + 0x1078, 0x1676, 0x6010, 0x2068, 0x1078, 0x693e, 0x0040, 0x614d, + 0xa786, 0x0003, 0x00c0, 0x6162, 0x6837, 0x0103, 0x6b4a, 0x6847, + 0x0000, 0x1078, 0x3a7a, 0x1078, 0x6a94, 0x1078, 0x6aa1, 0x0c7f, + 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x6158, 0x0078, 0x6118, + 0x127f, 0x007f, 0x027f, 0x047f, 0x057f, 0x077f, 0x0c7f, 0x0d7f, + 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, 0x6144, 0x1078, 0x74fd, + 0x0078, 0x614d, 0x220c, 0x2304, 0xa106, 0x00c0, 0x6175, 0x8210, + 0x8318, 0x00f0, 0x616a, 0xa006, 0x007c, 0x2304, 0xa102, 0x0048, + 0x617d, 0x2001, 0x0001, 0x0078, 0x617f, 0x2001, 0x0000, 0xa18d, + 0x0001, 0x007c, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x12d5, 0x1078, + 0x6aba, 0x0040, 0x6191, 0x1078, 0x6ace, 0x0040, 0x619a, 0x0078, + 0x6193, 0x1078, 0x22dd, 0x1078, 0x4b81, 0x1078, 0x5c02, 0x1078, + 0x4c7a, 0x007c, 0x1078, 0x5e57, 0x0078, 0x6193, 0xa182, 0x0040, + 0x0079, 0x61a2, 0x61b2, 0x61b2, 0x61b2, 0x61b2, 0x61b2, 0x61b2, + 0x61b2, 0x61b2, 0x61b2, 0x61b2, 0x61b2, 0x61b4, 0x61b4, 0x61b4, + 0x61b4, 0x61b2, 0x1078, 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078, + 0x4825, 0x127e, 0x2091, 0x8000, 0x1078, 0x4c7a, 0x127f, 0x007c, + 0xa186, 0x0013, 0x00c0, 0x61c9, 0x6004, 0xa082, 0x0040, 0x0079, + 0x623f, 0xa186, 0x0027, 0x00c0, 0x61e6, 0x1078, 0x4b81, 0x1078, + 0x22bb, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x693e, 0x0040, 0x61e0, + 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3a7a, 0x1078, 0x6a94, + 0x0d7f, 0x1078, 0x5c02, 0x1078, 0x4c7a, 0x007c, 0xa186, 0x0014, + 0x00c0, 0x61ef, 0x6004, 0xa082, 0x0040, 0x0079, 0x620f, 0xa186, + 0x0047, 0x10c0, 0x12d5, 0x2001, 0x0109, 0x2004, 0xd084, 0x0040, + 0x620c, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x1078, + 0x46e6, 0x027f, 0x017f, 0x007f, 0x127f, 0x6000, 0xa086, 0x0002, + 0x00c0, 0x620c, 0x0078, 0x6266, 0x1078, 0x5c37, 0x007c, 0x6221, + 0x621f, 0x621f, 0x621f, 0x621f, 0x621f, 0x621f, 0x621f, 0x621f, + 0x621f, 0x621f, 0x6238, 0x6238, 0x6238, 0x6238, 0x621f, 0x1078, + 0x12d5, 0x1078, 0x4b81, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x693e, + 0x0040, 0x6232, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078, 0x3a7a, + 0x1078, 0x6a94, 0x0d7f, 0x1078, 0x5c02, 0x1078, 0x4c7a, 0x007c, + 0x1078, 0x4b81, 0x1078, 0x5c02, 0x1078, 0x4c7a, 0x007c, 0x6251, + 0x624f, 0x624f, 0x624f, 0x624f, 0x624f, 0x624f, 0x624f, 0x624f, + 0x624f, 0x624f, 0x625f, 0x625f, 0x625f, 0x625f, 0x624f, 0x1078, + 0x12d5, 0x1078, 0x4b81, 0x6003, 0x0002, 0x1078, 0x4c7a, 0x6010, + 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x007c, 0x1078, + 0x4b81, 0x6003, 0x000f, 0x1078, 0x4c7a, 0x007c, 0xa182, 0x0040, + 0x0079, 0x626a, 0x627a, 0x627a, 0x627a, 0x627a, 0x627a, 0x627c, + 0x6305, 0x631d, 0x627a, 0x627a, 0x627a, 0x627a, 0x627a, 0x627a, + 0x627a, 0x627a, 0x1078, 0x12d5, 0x0e7e, 0x0d7e, 0x2071, 0x7b8c, + 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff, 0x86ff, 0x0040, 0x62e9, + 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x62ae, 0xa186, 0x0028, + 0x00c0, 0x6298, 0x1078, 0x6aa8, 0x684b, 0x001c, 0x0078, 0x62b0, + 0xd6dc, 0x0040, 0x62a3, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, + 0x6b5e, 0x0078, 0x62b0, 0xd6d4, 0x0040, 0x62ae, 0x684b, 0x0007, + 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x62b0, 0x684b, 0x0000, + 0x6837, 0x0103, 0x6e46, 0xa01e, 0xd6c4, 0x0040, 0x62c3, 0x7328, + 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7b98, 0xad90, 0x0019, + 0x1078, 0x6727, 0x037f, 0xd6cc, 0x0040, 0x62f9, 0x7124, 0x695a, + 0xa192, 0x0021, 0x00c8, 0x62d7, 0x2071, 0x7b98, 0x831c, 0x2300, + 0xae18, 0xad90, 0x001d, 0x1078, 0x6727, 0x0078, 0x62f9, 0x6838, + 0xd0fc, 0x0040, 0x62e0, 0x2009, 0x0020, 0x695a, 0x0078, 0x62cc, + 0x0f7e, 0x2d78, 0x1078, 0x66bf, 0x0f7f, 0x1078, 0x6714, 0x0078, + 0x62fb, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0x684c, 0xd0ac, + 0x0040, 0x62f9, 0x6810, 0x6914, 0xa115, 0x0040, 0x62f9, 0x1078, + 0x646d, 0x1078, 0x3a7a, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, + 0x0d7f, 0x0e7f, 0x1078, 0x5c02, 0x007c, 0x0f7e, 0x6003, 0x0003, + 0x2079, 0x7b8c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, + 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x19cf, + 0x1078, 0x4891, 0x1078, 0x4d3a, 0x007c, 0x6003, 0x0004, 0x6110, + 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, + 0xa182, 0x0040, 0x0079, 0x632c, 0x633c, 0x633c, 0x633c, 0x633c, + 0x633c, 0x633e, 0x63d5, 0x633c, 0x633c, 0x63eb, 0x644d, 0x633c, + 0x633c, 0x633c, 0x633c, 0x6454, 0x1078, 0x12d5, 0x077e, 0x0f7e, + 0x0e7e, 0x0d7e, 0x2071, 0x7b8c, 0x6110, 0x2178, 0x7614, 0xa6b4, + 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, + 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x63d0, 0xa694, 0xff00, 0xa284, + 0x0c00, 0x0040, 0x635f, 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, + 0x0300, 0x0040, 0x63d0, 0x1078, 0x132f, 0x1040, 0x12d5, 0x2d00, + 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, + 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, + 0x0002, 0x0040, 0x6399, 0xa186, 0x0028, 0x00c0, 0x6383, 0x684b, + 0x001c, 0x0078, 0x639b, 0xd6dc, 0x0040, 0x638e, 0x684b, 0x0015, + 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x639b, 0xd6d4, 0x0040, + 0x6399, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, + 0x639b, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, + 0xa01e, 0xd6c4, 0x0040, 0x63b0, 0x7328, 0x732c, 0x6b56, 0x037e, + 0x2308, 0x2019, 0x7b98, 0xad90, 0x0019, 0x1078, 0x6727, 0x037f, + 0xd6cc, 0x0040, 0x63d0, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, + 0x63c4, 0x2071, 0x7b98, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, + 0x1078, 0x6727, 0x0078, 0x63d0, 0x7838, 0xd0fc, 0x0040, 0x63cd, + 0x2009, 0x0020, 0x695a, 0x0078, 0x63b9, 0x2d78, 0x1078, 0x66bf, + 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x0f7e, 0x6003, 0x0003, + 0x2079, 0x7b8c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, + 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x19cf, + 0x1078, 0x5567, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x1078, 0x4c29, + 0x1078, 0x4d3a, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040, 0x644b, + 0xd1cc, 0x0040, 0x6426, 0x6948, 0x6838, 0xd0fc, 0x0040, 0x641e, + 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d, 0xa198, + 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318, + 0x8210, 0x00f0, 0x640d, 0x157f, 0x007f, 0x6852, 0x007f, 0x684e, + 0x017f, 0x2168, 0x1078, 0x1358, 0x0078, 0x6449, 0x017e, 0x1078, + 0x1358, 0x0d7f, 0x1078, 0x6714, 0x0078, 0x6449, 0x6837, 0x0103, + 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x6445, 0xa086, + 0x0028, 0x00c0, 0x6437, 0x684b, 0x001c, 0x0078, 0x6447, 0xd1dc, + 0x0040, 0x643e, 0x684b, 0x0015, 0x0078, 0x6447, 0xd1d4, 0x0040, + 0x6445, 0x684b, 0x0007, 0x0078, 0x6447, 0x684b, 0x0000, 0x1078, + 0x3a7a, 0x1078, 0x5c02, 0x0d7f, 0x007c, 0x6003, 0x0002, 0x1078, + 0x4c29, 0x1078, 0x4d3a, 0x007c, 0x1078, 0x4c29, 0x1078, 0x22bb, + 0x0d7e, 0x6110, 0x2168, 0x1078, 0x693e, 0x0040, 0x6467, 0x6837, + 0x0103, 0x684b, 0x0029, 0x1078, 0x3a7a, 0x1078, 0x6a94, 0x0d7f, + 0x1078, 0x5c02, 0x1078, 0x4d3a, 0x007c, 0x684b, 0x0015, 0xd1fc, + 0x0040, 0x6479, 0x684b, 0x0007, 0x8002, 0x8000, 0x810a, 0xa189, + 0x0000, 0x6962, 0x685e, 0x007c, 0xa182, 0x0040, 0x0079, 0x6480, + 0x6490, 0x6490, 0x6490, 0x6490, 0x6490, 0x6492, 0x6490, 0x6536, + 0x653e, 0x6490, 0x6490, 0x6490, 0x6490, 0x6490, 0x6490, 0x6490, + 0x1078, 0x12d5, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x7b8c, + 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, + 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, + 0x6528, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x64b3, 0x7018, + 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x6525, 0x1078, + 0x132f, 0x1040, 0x12d5, 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200, + 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, + 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x64ee, + 0xa186, 0x0028, 0x00c0, 0x64d8, 0x684b, 0x001c, 0x0078, 0x64f0, + 0xd6dc, 0x0040, 0x64e3, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, + 0x6b5e, 0x0078, 0x64f0, 0xd6d4, 0x0040, 0x64ee, 0x684b, 0x0007, + 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x64f0, 0x684b, 0x0000, + 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, + 0x6505, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7b98, + 0xad90, 0x0019, 0x1078, 0x6727, 0x037f, 0xd6cc, 0x0040, 0x6525, + 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x6519, 0x2071, 0x7b98, + 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x6727, 0x0078, + 0x6525, 0x7838, 0xd0fc, 0x0040, 0x6522, 0x2009, 0x0020, 0x695a, + 0x0078, 0x650e, 0x2d78, 0x1078, 0x66bf, 0xd6dc, 0x00c0, 0x652b, + 0xa006, 0x0078, 0x652f, 0x2001, 0x0001, 0x7218, 0x731c, 0x1078, + 0x15b6, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x20e1, 0x0005, + 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0x0d7e, 0x6003, + 0x0002, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040, 0x65a5, 0xd1cc, + 0x0040, 0x6575, 0x6948, 0x6838, 0xd0fc, 0x0040, 0x656d, 0x017e, + 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d, 0xa198, 0x000d, + 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, + 0x00f0, 0x655c, 0x157f, 0x007f, 0x6852, 0x007f, 0x684e, 0x017f, + 0x2168, 0x1078, 0x1358, 0x0078, 0x65a3, 0x017e, 0x1078, 0x1358, + 0x0d7f, 0x1078, 0x6714, 0x0078, 0x65a3, 0x6837, 0x0103, 0x6944, + 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x6594, 0xa086, 0x0028, + 0x00c0, 0x6586, 0x684b, 0x001c, 0x0078, 0x65a1, 0xd1dc, 0x0040, + 0x658d, 0x684b, 0x0015, 0x0078, 0x65a1, 0xd1d4, 0x0040, 0x6594, + 0x684b, 0x0007, 0x0078, 0x65a1, 0x684b, 0x0000, 0x684c, 0xd0ac, + 0x0040, 0x65a1, 0x6810, 0x6914, 0xa115, 0x0040, 0x65a1, 0x1078, + 0x646d, 0x1078, 0x3a7a, 0x1078, 0x5c02, 0x0d7f, 0x007c, 0x1078, + 0x4b81, 0x0078, 0x65ad, 0x1078, 0x4c29, 0x1078, 0x693e, 0x0040, + 0x65c4, 0x0d7e, 0x6110, 0x2168, 0x6837, 0x0103, 0x2009, 0x760c, + 0x210c, 0xd18c, 0x00c0, 0x65cd, 0xd184, 0x00c0, 0x65c9, 0x6108, + 0x694a, 0x1078, 0x3a7a, 0x0d7f, 0x1078, 0x5c02, 0x1078, 0x4c7a, + 0x007c, 0x684b, 0x0004, 0x0078, 0x65c1, 0x684b, 0x0004, 0x0078, + 0x65c1, 0xa182, 0x0040, 0x0079, 0x65d5, 0x65e5, 0x65e5, 0x65e5, + 0x65e5, 0x65e5, 0x65e7, 0x65e5, 0x65ea, 0x65e5, 0x65e5, 0x65e5, + 0x65e5, 0x65e5, 0x65e5, 0x65e5, 0x65e5, 0x1078, 0x12d5, 0x1078, + 0x5c02, 0x007c, 0x007e, 0x027e, 0xa016, 0x1078, 0x1572, 0x027f, + 0x007f, 0x007c, 0xa182, 0x0085, 0x0079, 0x65f6, 0x65ff, 0x65fd, + 0x65fd, 0x65fd, 0x65fd, 0x65fd, 0x65fd, 0x1078, 0x12d5, 0x6003, + 0x0001, 0x6106, 0x1078, 0x4825, 0x127e, 0x2091, 0x8000, 0x1078, + 0x4c7a, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x6615, 0x6004, + 0xa082, 0x0085, 0x2008, 0x0079, 0x6649, 0xa186, 0x0027, 0x00c0, + 0x6636, 0x1078, 0x4b81, 0x1078, 0x22bb, 0x0d7e, 0x6010, 0x2068, + 0x1078, 0x693e, 0x0040, 0x662c, 0x6837, 0x0103, 0x684b, 0x0029, + 0x1078, 0x3a7a, 0x1078, 0x6a94, 0x0d7f, 0x1078, 0x5c02, 0x1078, + 0x4c7a, 0x007c, 0x1078, 0x5c37, 0x0078, 0x6631, 0xa186, 0x0014, + 0x00c0, 0x6632, 0x1078, 0x4b81, 0x0d7e, 0x6010, 0x2068, 0x1078, + 0x693e, 0x0040, 0x662c, 0x6837, 0x0103, 0x684b, 0x0006, 0x0078, + 0x6628, 0x6652, 0x6650, 0x6650, 0x6650, 0x6650, 0x6650, 0x665b, + 0x1078, 0x12d5, 0x1078, 0x4b81, 0x6017, 0x0014, 0x6003, 0x000c, + 0x1078, 0x4c7a, 0x007c, 0x1078, 0x4b81, 0x6017, 0x0014, 0x6003, + 0x000e, 0x1078, 0x4c7a, 0x007c, 0xa182, 0x008c, 0x00c8, 0x666e, + 0xa182, 0x0085, 0x0048, 0x666e, 0x0079, 0x6671, 0x1078, 0x5c37, + 0x007c, 0x6678, 0x6678, 0x6678, 0x6678, 0x667a, 0x6699, 0x6678, + 0x1078, 0x12d5, 0x0d7e, 0x1078, 0x6a94, 0x1078, 0x693e, 0x0040, + 0x6695, 0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, + 0x668d, 0x684b, 0x0006, 0x0078, 0x6691, 0x684b, 0x0005, 0x1078, + 0x6b47, 0x6847, 0x0000, 0x1078, 0x3a7a, 0x1078, 0x5c02, 0x0d7f, + 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x693e, 0x0040, 0x66b4, + 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x66aa, 0x684b, 0x0006, + 0x0078, 0x66ae, 0x684b, 0x0005, 0x1078, 0x6b47, 0x6847, 0x0000, + 0x1078, 0x3a7a, 0x1078, 0x6a94, 0x0d7f, 0x1078, 0x5c02, 0x007c, + 0x1078, 0x4b81, 0x1078, 0x5c02, 0x1078, 0x4c7a, 0x007c, 0x057e, + 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001, 0xa182, 0x0101, 0x00c8, + 0x66cb, 0x0078, 0x66cd, 0x2009, 0x0100, 0x2130, 0x2069, 0x7b98, + 0x831c, 0x2300, 0xad18, 0x2009, 0x0020, 0xaf90, 0x001d, 0x1078, + 0x6727, 0xa6b2, 0x0020, 0x7804, 0xa06d, 0x0040, 0x66e1, 0x1078, + 0x1358, 0x1078, 0x132f, 0x0040, 0x670b, 0x8528, 0x6837, 0x0110, + 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a, 0x003d, 0x00c8, 0x66f7, + 0x2608, 0xad90, 0x000f, 0x1078, 0x6727, 0x0078, 0x670b, 0xa6b2, + 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90, 0x000f, 0x1078, 0x6727, + 0x0078, 0x66e1, 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36, 0xa5ac, + 0x0000, 0x0078, 0x6710, 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36, + 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e, 0x8dff, 0x0040, 0x6725, + 0x6804, 0xa07d, 0x0040, 0x6723, 0x6807, 0x0000, 0x1078, 0x3a7a, + 0x2f68, 0x0078, 0x6718, 0x1078, 0x3a7a, 0x0f7f, 0x007c, 0x157e, + 0xa184, 0x0001, 0x0040, 0x672d, 0x8108, 0x810c, 0x21a8, 0x2304, + 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0, 0x672f, 0x157f, 0x007c, + 0x127e, 0x2091, 0x8000, 0x601c, 0xa084, 0x000f, 0x1079, 0x6742, + 0x127f, 0x007c, 0x6751, 0x674a, 0x674c, 0x676a, 0x674a, 0x674c, + 0x674c, 0x674c, 0x1078, 0x12d5, 0xa006, 0x007c, 0xa085, 0x0001, + 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x693e, 0x0040, 0x6767, + 0xa00e, 0x2001, 0x0005, 0x1078, 0x3b0a, 0x1078, 0x6b47, 0x1078, + 0x3a7a, 0x1078, 0x5c02, 0xa085, 0x0001, 0x0d7f, 0x007c, 0xa006, + 0x0078, 0x6765, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, + 0x6772, 0x007c, 0x6782, 0x679f, 0x6784, 0x67b0, 0x679b, 0x6782, + 0x674c, 0x6751, 0x6751, 0x674c, 0x674c, 0x674c, 0x674c, 0x674c, + 0x674c, 0x674c, 0x1078, 0x12d5, 0x0d7e, 0x6010, 0x2068, 0x1078, + 0x693e, 0x0040, 0x678d, 0x1078, 0x6b47, 0x0d7f, 0x6007, 0x0085, + 0x6003, 0x000b, 0x601f, 0x0002, 0x1078, 0x4825, 0x1078, 0x4c7a, + 0xa085, 0x0001, 0x007c, 0x1078, 0x1676, 0x0078, 0x6784, 0x0e7e, + 0x2071, 0x7836, 0x7024, 0xac06, 0x00c0, 0x67a8, 0x1078, 0x56d6, + 0x1078, 0x560b, 0x0e7f, 0x00c0, 0x6784, 0x1078, 0x674c, 0x007c, + 0x037e, 0x0e7e, 0x2071, 0x7836, 0x703c, 0xac06, 0x00c0, 0x67c0, + 0x2019, 0x0000, 0x1078, 0x5768, 0x0e7f, 0x037f, 0x0078, 0x6784, + 0x1078, 0x5a44, 0x0e7f, 0x037f, 0x00c0, 0x6784, 0x1078, 0x674c, + 0x007c, 0x0c7e, 0x601c, 0xa084, 0x000f, 0x1079, 0x67d1, 0x0c7f, + 0x007c, 0x67e0, 0x683d, 0x68e2, 0x67e4, 0x67e0, 0x67e0, 0x71dd, + 0x5c02, 0x683d, 0x1078, 0x6ace, 0x00c0, 0x67e0, 0x1078, 0x5e57, + 0x007c, 0x6017, 0x0001, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, + 0x12d5, 0x1079, 0x67ec, 0x007c, 0x67fc, 0x67fe, 0x681e, 0x6830, + 0x6830, 0x67fc, 0x67e0, 0x67e0, 0x67e0, 0x6830, 0x6830, 0x67fc, + 0x67fc, 0x67fc, 0x67fc, 0x683a, 0x1078, 0x12d5, 0x0e7e, 0x6010, + 0x2070, 0x7050, 0xc0b5, 0x7052, 0x2071, 0x7836, 0x7024, 0xac06, + 0x0040, 0x681a, 0x1078, 0x560b, 0x6007, 0x0085, 0x6003, 0x000b, + 0x601f, 0x0002, 0x6017, 0x0014, 0x1078, 0x4825, 0x1078, 0x4c7a, + 0x0e7f, 0x007c, 0x6017, 0x0001, 0x0078, 0x6818, 0x0d7e, 0x6010, + 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003, + 0x000b, 0x601f, 0x0002, 0x1078, 0x4825, 0x1078, 0x4c7a, 0x007c, + 0x0d7e, 0x6017, 0x0001, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, + 0x0d7f, 0x007c, 0x1078, 0x5c02, 0x007c, 0x6000, 0xa08a, 0x0010, + 0x10c8, 0x12d5, 0x1079, 0x6845, 0x007c, 0x6855, 0x67e1, 0x6857, + 0x6855, 0x6857, 0x6855, 0x6855, 0x6855, 0x67da, 0x67da, 0x6855, + 0x6855, 0x6855, 0x6855, 0x6855, 0x6855, 0x1078, 0x12d5, 0x0d7e, + 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c, + 0x10c8, 0x12d5, 0x1079, 0x6865, 0x007c, 0x6871, 0x6890, 0x6871, + 0x6890, 0x6871, 0x6890, 0x6873, 0x687c, 0x6871, 0x6890, 0x6871, + 0x6889, 0x1078, 0x12d5, 0x6004, 0xa08e, 0x0004, 0x0040, 0x688b, + 0xa08e, 0x0002, 0x0040, 0x688b, 0x6004, 0x1078, 0x6ace, 0x0040, + 0x68da, 0xa08e, 0x0021, 0x0040, 0x68de, 0xa08e, 0x0022, 0x0040, + 0x68da, 0x1078, 0x22bb, 0x1078, 0x5e57, 0x1078, 0x5c02, 0x007c, + 0x0c7e, 0x0d7e, 0x6104, 0xa186, 0x0016, 0x0040, 0x68ca, 0xa186, + 0x0002, 0x00c0, 0x68b9, 0x6018, 0x2068, 0x68a0, 0xd0bc, 0x00c0, + 0x68b9, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x68b9, 0x8001, + 0x6842, 0x6013, 0x0000, 0x601f, 0x0007, 0x6017, 0x0398, 0x1078, + 0x5b9c, 0x0040, 0x68b9, 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078, + 0x68ca, 0x0d7f, 0x0c7f, 0x1078, 0x5e57, 0x1078, 0x22bb, 0x0e7e, + 0x127e, 0x2091, 0x8000, 0x1078, 0x22dd, 0x127f, 0x0e7f, 0x1078, + 0x5c02, 0x007c, 0x2001, 0x0002, 0x1078, 0x37d1, 0x6003, 0x0001, + 0x6007, 0x0002, 0x1078, 0x4872, 0x1078, 0x4c7a, 0x0d7f, 0x0c7f, + 0x0078, 0x68c9, 0x1078, 0x5e57, 0x0078, 0x688d, 0x1078, 0x5e66, + 0x0078, 0x688d, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, + 0x68ea, 0x007c, 0x68fa, 0x68fa, 0x68fa, 0x68fa, 0x68fa, 0x68fa, + 0x68fa, 0x68fa, 0x68fa, 0x67e0, 0x68fa, 0x67e1, 0x68fc, 0x67e1, + 0x6905, 0x68fa, 0x1078, 0x12d5, 0x6007, 0x008b, 0x6003, 0x000d, + 0x1078, 0x4825, 0x1078, 0x4c7a, 0x007c, 0x1078, 0x6a94, 0x1078, + 0x693e, 0x0040, 0x6927, 0x1078, 0x22bb, 0x0d7e, 0x1078, 0x693e, + 0x0040, 0x691a, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006, + 0x1078, 0x3a7a, 0x0d7f, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, + 0x0001, 0x1078, 0x4872, 0x1078, 0x4c7a, 0x0078, 0x6929, 0x1078, + 0x5c02, 0x007c, 0xa284, 0x0007, 0x00c0, 0x693b, 0xa282, 0x7d00, + 0x0048, 0x693b, 0x2001, 0x7615, 0x2004, 0xa202, 0x00c8, 0x693b, + 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x693a, 0x027e, 0x0e7e, + 0x2071, 0x7600, 0x6210, 0x7058, 0xa202, 0x0048, 0x6950, 0x705c, + 0xa202, 0x00c8, 0x6950, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c, + 0xa006, 0x0078, 0x694d, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e, + 0x2091, 0x8000, 0x2061, 0x7d00, 0x2071, 0x7600, 0x7344, 0x7060, + 0xa302, 0x00c8, 0x6979, 0x601c, 0xa206, 0x00c0, 0x6971, 0x1078, + 0x6ace, 0x00c0, 0x696d, 0x1078, 0x5e57, 0x0c7e, 0x1078, 0x5c02, + 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x6979, 0x0078, + 0x695e, 0x127f, 0x007f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, + 0x0c7e, 0x017e, 0xa188, 0x7720, 0x210c, 0x81ff, 0x0040, 0x699c, + 0x2061, 0x7d00, 0x2071, 0x7600, 0x7344, 0x7060, 0xa302, 0x00c8, + 0x699c, 0x017e, 0x1078, 0x5b9c, 0x017f, 0x0040, 0x699f, 0x611a, + 0x1078, 0x22bb, 0x1078, 0x5c02, 0xa006, 0x0078, 0x69a1, 0xa085, + 0x0001, 0x017f, 0x0c7f, 0x0e7f, 0x007c, 0x0c7e, 0x057e, 0x127e, + 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5b9c, 0x057f, 0x0040, 0x69be, + 0x6612, 0x651a, 0x601f, 0x0003, 0x2009, 0x004b, 0x1078, 0x5c29, + 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, + 0x69ba, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, + 0x1078, 0x5b9c, 0x057f, 0x0040, 0x69e8, 0x6013, 0x0000, 0x651a, + 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078, 0x39a6, 0x0c7f, 0x1078, + 0x4962, 0x1078, 0x48a5, 0x2c08, 0x1078, 0x737b, 0x2009, 0x004c, + 0x1078, 0x5c29, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, + 0xa006, 0x0078, 0x69e4, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, + 0x62a0, 0x0c7e, 0x1078, 0x5b9c, 0x057f, 0x0040, 0x6a13, 0x6612, + 0x651a, 0x601f, 0x0003, 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, + 0x39a6, 0x0c7f, 0x1078, 0x4962, 0x1078, 0x48a5, 0x2c08, 0x1078, + 0x737b, 0x2009, 0x004d, 0x1078, 0x5c29, 0xa085, 0x0001, 0x127f, + 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6a0f, 0x0c7e, 0x057e, + 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5b9c, 0x057f, + 0x0040, 0x6a3e, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005, + 0x0c7e, 0x2560, 0x1078, 0x39a6, 0x0c7f, 0x1078, 0x4962, 0x1078, + 0x48a5, 0x2c08, 0x1078, 0x737b, 0x2009, 0x004e, 0x1078, 0x5c29, + 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, + 0x6a3a, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5b9c, + 0x017f, 0x0040, 0x6a5a, 0x660a, 0x611a, 0x601f, 0x0001, 0x2d00, + 0x6012, 0x2009, 0x001f, 0x1078, 0x5c29, 0xa085, 0x0001, 0x127f, + 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6a57, 0x0c7e, 0x127e, 0x2091, + 0x8000, 0x0c7e, 0x1078, 0x5b9c, 0x017f, 0x0040, 0x6a76, 0x660a, + 0x611a, 0x601f, 0x0008, 0x2d00, 0x6012, 0x2009, 0x0021, 0x1078, + 0x5c29, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, + 0x6a73, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5b9c, + 0x017f, 0x0040, 0x6a91, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, + 0x2009, 0x0000, 0x1078, 0x5c29, 0xa085, 0x0001, 0x127f, 0x0c7f, + 0x007c, 0xa006, 0x0078, 0x6a8e, 0x027e, 0x0d7e, 0x6218, 0x2268, + 0x6a3c, 0x82ff, 0x0040, 0x6a9e, 0x8211, 0x6a3e, 0x0d7f, 0x027f, + 0x007c, 0x6013, 0x0000, 0x601f, 0x0007, 0x6017, 0x0014, 0x007c, + 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x7652, 0x2634, 0xd6e4, 0x0040, + 0x6ab6, 0x6618, 0x2660, 0x6e44, 0x1078, 0x38de, 0x0d7f, 0x0c7f, + 0x067f, 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e, 0x0002, 0x0040, + 0x6acb, 0xa08e, 0x0003, 0x0040, 0x6acb, 0xa08e, 0x0004, 0x0040, + 0x6acb, 0xa085, 0x0001, 0x017f, 0x007f, 0x007c, 0x007e, 0x017e, + 0x6004, 0xa08e, 0x0000, 0x0040, 0x6ae3, 0xa08e, 0x001f, 0x0040, + 0x6ae3, 0xa08e, 0x0028, 0x0040, 0x6ae3, 0xa08e, 0x0029, 0x0040, + 0x6ae3, 0xa085, 0x0001, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x127e, + 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5b9c, 0x017f, 0x0040, 0x6b00, + 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x1078, 0x22bb, 0x2009, + 0x0028, 0x1078, 0x5c29, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, + 0xa006, 0x0078, 0x6afd, 0xa186, 0x0015, 0x00c0, 0x6b18, 0x2011, + 0x761e, 0x2204, 0xa086, 0x0074, 0x00c0, 0x6b18, 0x1078, 0x60d4, + 0x6003, 0x0001, 0x6007, 0x0029, 0x1078, 0x4872, 0x0078, 0x6b1c, + 0x1078, 0x5e57, 0x1078, 0x5c02, 0x007c, 0xa186, 0x0015, 0x00c0, + 0x6b3a, 0x2011, 0x761e, 0x2204, 0xa086, 0x0014, 0x00c0, 0x6b3a, + 0x0d7e, 0x6018, 0x2068, 0x1078, 0x38a1, 0x0d7f, 0x1078, 0x60de, + 0x00c0, 0x6b3a, 0x2001, 0x0006, 0x1078, 0x37d1, 0x1078, 0x5cad, + 0x0078, 0x6b3e, 0x1078, 0x5e57, 0x1078, 0x5c02, 0x007c, 0x6848, + 0xa086, 0x0005, 0x00c0, 0x6b46, 0x1078, 0x6b47, 0x007c, 0x6850, + 0xc0ad, 0x6852, 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, + 0x12d5, 0x1079, 0x6b55, 0x067f, 0x007c, 0x6b65, 0x6d3c, 0x6e1d, + 0x6b65, 0x6b65, 0x6b65, 0x6b65, 0x6b65, 0x6b9f, 0x6e8b, 0x6b65, + 0x6b65, 0x6b65, 0x6b65, 0x6b65, 0x6b65, 0x1078, 0x12d5, 0x067e, + 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6b71, 0x067f, + 0x007c, 0x6b81, 0x718c, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, + 0x6b81, 0x7167, 0x71d6, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, + 0x6b81, 0x1078, 0x12d5, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, + 0x12d5, 0x1079, 0x6b8d, 0x067f, 0x007c, 0x6b9d, 0x6fd8, 0x704a, + 0x706c, 0x70b8, 0x6b9d, 0x6b9d, 0x7112, 0x6e97, 0x714f, 0x7153, + 0x6b9d, 0x6b9d, 0x6b9d, 0x6b9d, 0x6b9d, 0x1078, 0x12d5, 0xa1b2, + 0x0030, 0x10c8, 0x12d5, 0x2100, 0x0079, 0x6ba6, 0x6bd6, 0x6cb3, + 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, + 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, + 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd8, 0x6c07, 0x6c12, + 0x6c3a, 0x6c40, 0x6c74, 0x6cac, 0x6bd6, 0x6bd6, 0x6cbb, 0x6bd6, + 0x6bd6, 0x6cc2, 0x6cc9, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, 0x6bd6, + 0x6ce6, 0x6bd6, 0x6bd6, 0x6cf1, 0x6bd6, 0x6bd6, 0x1078, 0x12d5, + 0x1078, 0x3a26, 0x6618, 0x0c7e, 0x2660, 0x1078, 0x3837, 0x0c7f, + 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, + 0x6bf9, 0x1078, 0x72b7, 0x00c0, 0x6c34, 0x1078, 0x7255, 0x00c0, + 0x6bf5, 0x6007, 0x0008, 0x0078, 0x6cae, 0x6007, 0x0009, 0x0078, + 0x6cae, 0x1078, 0x744c, 0x0040, 0x6c03, 0x1078, 0x72b7, 0x0040, + 0x6bed, 0x0078, 0x6c34, 0x6013, 0x1900, 0x0078, 0x6bf5, 0x6106, + 0x1078, 0x7217, 0x6007, 0x0006, 0x0078, 0x6cae, 0x6007, 0x0007, + 0x0078, 0x6cae, 0x0d7e, 0x6618, 0x2668, 0x6e04, 0xa6b4, 0xff00, + 0x8637, 0xa686, 0x0006, 0x0040, 0x6c24, 0xa686, 0x0004, 0x0040, + 0x6c24, 0x0d7f, 0x0078, 0x6c34, 0x1078, 0x7315, 0x00c0, 0x6c2f, + 0x1078, 0x38a1, 0x6007, 0x000a, 0x0d7f, 0x0078, 0x6cae, 0x6007, + 0x000b, 0x0d7f, 0x0078, 0x6cae, 0x1078, 0x22bb, 0x6007, 0x0001, + 0x0078, 0x6cae, 0x1078, 0x22bb, 0x6007, 0x000c, 0x0078, 0x6cae, + 0x1078, 0x3a26, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, + 0xa082, 0x0006, 0x0048, 0x6c61, 0xa6b4, 0xff00, 0x8637, 0xa686, + 0x0006, 0x00c0, 0x6c34, 0x1078, 0x7324, 0x00c0, 0x6c5b, 0x6007, + 0x000e, 0x0078, 0x6cae, 0x1078, 0x22bb, 0x6007, 0x000f, 0x0078, + 0x6cae, 0x1078, 0x744c, 0x0040, 0x6c6e, 0xa6b4, 0xff00, 0x8637, + 0xa686, 0x0006, 0x0040, 0x6c53, 0x0078, 0x6c34, 0x6013, 0x1900, + 0x6007, 0x0009, 0x0078, 0x6cae, 0x1078, 0x3a26, 0x6618, 0xa6b0, + 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x6c99, + 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0, 0x6c34, 0x1078, + 0x734f, 0x00c0, 0x6c93, 0x1078, 0x7255, 0x00c0, 0x6c93, 0x6007, + 0x0010, 0x0078, 0x6cae, 0x1078, 0x22bb, 0x6007, 0x0011, 0x0078, + 0x6cae, 0x1078, 0x744c, 0x0040, 0x6ca6, 0xa6b4, 0xff00, 0x8637, + 0xa686, 0x0006, 0x0040, 0x6c87, 0x0078, 0x6c34, 0x6013, 0x1900, + 0x6007, 0x0009, 0x0078, 0x6cae, 0x6007, 0x0012, 0x6003, 0x0001, + 0x1078, 0x4872, 0x007c, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, + 0x4872, 0x0078, 0x6cb2, 0x6007, 0x0020, 0x6003, 0x0001, 0x1078, + 0x4872, 0x007c, 0x6007, 0x0023, 0x6003, 0x0001, 0x1078, 0x4872, + 0x007c, 0x017e, 0x027e, 0x2011, 0x7b88, 0x2214, 0x2c08, 0x1078, + 0x7514, 0x00c0, 0x6cda, 0x2160, 0x6007, 0x0026, 0x6013, 0x1700, + 0x0078, 0x6cdf, 0x1078, 0x5c02, 0x2160, 0x6007, 0x0025, 0x6003, + 0x0001, 0x1078, 0x4872, 0x027f, 0x017f, 0x007c, 0x6106, 0x1078, + 0x6cf8, 0x6007, 0x002b, 0x0078, 0x6cae, 0x6007, 0x002c, 0x0078, + 0x6cae, 0x6106, 0x1078, 0x6cfd, 0x6007, 0x002e, 0x0078, 0x6cae, + 0x0d7e, 0x1078, 0x6d23, 0x0d7f, 0x007c, 0x0d7e, 0x1078, 0x6d32, + 0x00c0, 0x6d1c, 0x680c, 0xa08c, 0xff00, 0x6824, 0xa084, 0x00ff, + 0xa115, 0x6212, 0xd1e4, 0x0040, 0x6d11, 0x2009, 0x0001, 0x0078, + 0x6d18, 0xd1ec, 0x0040, 0x6d1c, 0x2009, 0x0000, 0xa294, 0x00ff, + 0x1078, 0x22ff, 0x0078, 0x6d20, 0xa085, 0x0001, 0x0078, 0x6d21, + 0xa006, 0x0d7f, 0x007c, 0x2069, 0x7b8d, 0x6800, 0xa082, 0x0010, + 0x00c8, 0x6d30, 0x6013, 0x0000, 0xa085, 0x0001, 0x0078, 0x6d31, + 0xa006, 0x007c, 0x6013, 0x0000, 0x2069, 0x7b8c, 0x6808, 0xa084, + 0xff00, 0xa086, 0x0800, 0x007c, 0x6004, 0xa0b2, 0x0030, 0x10c8, + 0x12d5, 0xa1b6, 0x0013, 0x00c0, 0x6d48, 0x2008, 0x0079, 0x6d5b, + 0xa1b6, 0x0027, 0x0040, 0x6d50, 0xa1b6, 0x0014, 0x10c0, 0x12d5, + 0x2001, 0x0007, 0x1078, 0x37df, 0x1078, 0x4b81, 0x1078, 0x6aa1, + 0x1078, 0x4c7a, 0x007c, 0x6d8b, 0x6d8d, 0x6d8b, 0x6d8b, 0x6d8b, + 0x6d8d, 0x6d95, 0x6df8, 0x6dbb, 0x6df8, 0x6dcf, 0x6df8, 0x6d95, + 0x6df8, 0x6df0, 0x6df8, 0x6df0, 0x6df8, 0x6df8, 0x6d8b, 0x6d8b, + 0x6d8b, 0x6d8b, 0x6d8b, 0x6d8b, 0x6d8b, 0x6d8b, 0x6d8b, 0x6d8b, + 0x6d8b, 0x6d8b, 0x6d8b, 0x6df8, 0x6d8b, 0x6d8b, 0x6df8, 0x6d8b, + 0x6df8, 0x6df8, 0x6d8b, 0x6d8b, 0x6d8b, 0x6d8b, 0x6df8, 0x6df8, + 0x6d8b, 0x6df8, 0x6df8, 0x1078, 0x12d5, 0x1078, 0x4b81, 0x6003, + 0x0002, 0x1078, 0x4c7a, 0x0078, 0x6dfe, 0x0f7e, 0x2079, 0x7651, + 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x6df8, 0x2001, 0x0000, 0x1078, + 0x37bd, 0x2001, 0x0002, 0x1078, 0x37d1, 0x1078, 0x4b81, 0x601f, + 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4872, 0x1078, + 0x4c7a, 0x0c7e, 0x6118, 0x2160, 0x2009, 0x0001, 0x1078, 0x457b, + 0x0c7f, 0x0078, 0x6dfe, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, + 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6df8, 0xa686, + 0x0004, 0x0040, 0x6df8, 0x2001, 0x0004, 0x0078, 0x6df6, 0x2001, + 0x7600, 0x2004, 0xa086, 0x0003, 0x00c0, 0x6dd8, 0x1078, 0x2dc8, + 0x2001, 0x0006, 0x1078, 0x6dff, 0x6618, 0x0d7e, 0x2668, 0x6e04, + 0x0d7f, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6df8, + 0x2001, 0x0006, 0x0078, 0x6df6, 0x2001, 0x0004, 0x0078, 0x6df6, + 0x2001, 0x0006, 0x1078, 0x6dff, 0x0078, 0x6df8, 0x1078, 0x37df, + 0x1078, 0x4b81, 0x1078, 0x5c02, 0x1078, 0x4c7a, 0x007c, 0x017e, + 0x0d7e, 0x6118, 0x2168, 0x6900, 0xd184, 0x0040, 0x6e1a, 0x6104, + 0xa18e, 0x000a, 0x00c0, 0x6e12, 0x699c, 0xd1a4, 0x00c0, 0x6e12, + 0x2001, 0x0007, 0x1078, 0x37d1, 0x2001, 0x0000, 0x1078, 0x37bd, + 0x1078, 0x22dd, 0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668, + 0x6804, 0xa084, 0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, + 0x12d5, 0xa1b6, 0x0015, 0x00c0, 0x6e31, 0x1079, 0x6e38, 0x0078, + 0x6e37, 0xa1b6, 0x0016, 0x10c0, 0x12d5, 0x1079, 0x6e70, 0x007c, + 0x5ee1, 0x5ee1, 0x5ee1, 0x5ee1, 0x5ee1, 0x5ee1, 0x5ee1, 0x6e44, + 0x5ee1, 0x5ee1, 0x5ee1, 0x5ee1, 0x0f7e, 0x2079, 0x7651, 0x7804, + 0x0f7f, 0xd0ac, 0x00c0, 0x6e60, 0x2001, 0x0000, 0x1078, 0x37bd, + 0x2001, 0x0002, 0x1078, 0x37d1, 0x601f, 0x0001, 0x6003, 0x0001, + 0x6007, 0x0002, 0x1078, 0x4872, 0x1078, 0x4c7a, 0x0078, 0x6e6f, + 0x2011, 0x7b83, 0x220c, 0x017e, 0x0c7e, 0x1078, 0x3825, 0x00c0, + 0x6e6f, 0x1078, 0x3621, 0x0c7f, 0x017f, 0x1078, 0x5c02, 0x007c, + 0x5ee1, 0x5ee1, 0x5ee1, 0x5ee1, 0x5ee1, 0x5ee1, 0x5ee1, 0x6e7c, + 0x5ee1, 0x5ee1, 0x5ee1, 0x5ee1, 0x1078, 0x60d1, 0x00c0, 0x6e88, + 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4872, 0x0078, 0x6e8a, + 0x1078, 0x5c02, 0x007c, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x12d5, + 0x1078, 0x4b81, 0x1078, 0x6aa1, 0x1078, 0x4c7a, 0x007c, 0xa182, + 0x0040, 0x0079, 0x6e9b, 0x6eab, 0x6eab, 0x6eab, 0x6eab, 0x6ead, + 0x6eab, 0x6eab, 0x6eab, 0x6eab, 0x6eab, 0x6eab, 0x6eab, 0x6eab, + 0x6eab, 0x6eab, 0x6eab, 0x1078, 0x12d5, 0x0d7e, 0x0e7e, 0x0f7e, + 0x157e, 0x047e, 0x027e, 0x6106, 0x2071, 0x7b80, 0x7444, 0xa4a4, + 0xe600, 0x0040, 0x6f1e, 0xa486, 0x2000, 0x0040, 0x6edd, 0xa486, + 0x0400, 0x0040, 0x6edd, 0x7130, 0xa18c, 0x00ff, 0xa182, 0x0010, + 0x00c8, 0x6fb0, 0x0c7e, 0x1078, 0x460c, 0x2c68, 0x0c7f, 0x6a00, + 0xa284, 0x0001, 0x0040, 0x6f91, 0x1078, 0x46ca, 0x0040, 0x6fbc, + 0xa295, 0x0200, 0x6a02, 0x0078, 0x6ee3, 0x2009, 0x0001, 0x2011, + 0x0200, 0x1078, 0x46b4, 0x1078, 0x132f, 0x1040, 0x12d5, 0x6003, + 0x0007, 0x2d00, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, + 0x6c5a, 0x2c00, 0x685e, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, + 0xa18c, 0x00ff, 0xa10d, 0x6946, 0x684f, 0x0000, 0x6857, 0x0036, + 0x1078, 0x3a7a, 0xa486, 0x2000, 0x00c0, 0x6f0c, 0x2019, 0x0017, + 0x1078, 0x74d9, 0x0078, 0x6f7e, 0xa486, 0x0400, 0x00c0, 0x6f16, + 0x2019, 0x0002, 0x1078, 0x74d9, 0x0078, 0x6f7e, 0xa486, 0x0200, + 0x00c0, 0x6f1c, 0x1078, 0x74ca, 0x0078, 0x6f7e, 0x7130, 0xa184, + 0xff00, 0x00c0, 0x6fd0, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8, + 0x6fd0, 0x0c7e, 0x1078, 0x460c, 0x2c68, 0x0c7f, 0x6a00, 0xa284, + 0x0001, 0x0040, 0x6fd4, 0xa284, 0x0300, 0x00c0, 0x6fcc, 0x6804, + 0xa005, 0x0040, 0x6fbc, 0x8001, 0x6806, 0x6003, 0x0007, 0x1078, + 0x1314, 0x0040, 0x6f85, 0x6013, 0x0000, 0x6803, 0x0000, 0x6837, + 0x0116, 0x683b, 0x0000, 0x2c00, 0x684a, 0x6018, 0x2078, 0x78a0, + 0x8007, 0xa10d, 0x6946, 0x6853, 0x003d, 0x7044, 0xa084, 0x0003, + 0xa086, 0x0002, 0x00c0, 0x6f60, 0x684f, 0x0040, 0x0078, 0x6f6a, + 0xa086, 0x0001, 0x00c0, 0x6f68, 0x684f, 0x0080, 0x0078, 0x6f6a, + 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001, 0x7b90, 0xad90, 0x0015, + 0x200c, 0x810f, 0x2112, 0x8000, 0x8210, 0x00f0, 0x6f70, 0x200c, + 0x6982, 0x8000, 0x200c, 0x697e, 0x1078, 0x3a7a, 0x027f, 0x047f, + 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c, 0x6013, 0x0100, 0x6003, + 0x0001, 0x6007, 0x0041, 0x1078, 0x4825, 0x1078, 0x4c7a, 0x0078, + 0x6f7e, 0x2069, 0x7b92, 0x2d04, 0xa084, 0xff00, 0xa086, 0x1200, + 0x00c0, 0x6fb0, 0x2069, 0x7b80, 0x686c, 0xa084, 0x00ff, 0x017e, + 0x6110, 0xa18c, 0x0700, 0xa10d, 0x6112, 0x017f, 0x6003, 0x0001, + 0x6007, 0x0043, 0x1078, 0x4825, 0x1078, 0x4c7a, 0x0078, 0x6f7e, + 0x6013, 0x0200, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x4825, + 0x1078, 0x4c7a, 0x0078, 0x6f7e, 0x6013, 0x0300, 0x0078, 0x6fc2, + 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x4825, + 0x1078, 0x4c7a, 0x0078, 0x6f7e, 0x6013, 0x0500, 0x0078, 0x6fc2, + 0x6013, 0x0600, 0x0078, 0x6f91, 0x6013, 0x0200, 0x0078, 0x6f91, + 0xa186, 0x0013, 0x00c0, 0x6fea, 0x6004, 0xa08a, 0x0040, 0x1048, + 0x12d5, 0xa08a, 0x0050, 0x10c8, 0x12d5, 0xa082, 0x0040, 0x2008, + 0x0079, 0x701b, 0xa186, 0x0047, 0x00c0, 0x6ff0, 0x0078, 0x704a, + 0xa186, 0x0027, 0x0040, 0x6ff8, 0xa186, 0x0014, 0x10c0, 0x12d5, + 0x6004, 0xa082, 0x0040, 0x2008, 0x0079, 0x6ffe, 0x700e, 0x7010, + 0x7010, 0x700e, 0x700e, 0x700e, 0x700e, 0x700e, 0x700e, 0x700e, + 0x700e, 0x700e, 0x700e, 0x700e, 0x700e, 0x700e, 0x1078, 0x12d5, + 0x2001, 0x0007, 0x1078, 0x37df, 0x1078, 0x4b81, 0x1078, 0x6aa1, + 0x1078, 0x4c7a, 0x007c, 0x702b, 0x703b, 0x7034, 0x7044, 0x702b, + 0x702b, 0x702b, 0x702b, 0x702b, 0x702b, 0x702b, 0x702b, 0x702b, + 0x702b, 0x702b, 0x702b, 0x1078, 0x12d5, 0x6010, 0xa088, 0x0013, + 0x2104, 0xa085, 0x0400, 0x200a, 0x1078, 0x4b81, 0x6003, 0x0002, + 0x1078, 0x4c7a, 0x007c, 0x1078, 0x4b81, 0x1078, 0x468d, 0x1078, + 0x5c02, 0x1078, 0x4c7a, 0x007c, 0x1078, 0x4b81, 0x2009, 0x0041, + 0x0078, 0x7112, 0xa182, 0x0040, 0x0079, 0x704e, 0x705e, 0x7060, + 0x705e, 0x705e, 0x705e, 0x705e, 0x705e, 0x7061, 0x705e, 0x705e, + 0x705e, 0x705e, 0x705e, 0x705e, 0x705e, 0x705e, 0x1078, 0x12d5, 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, - 0x2c10, 0x1078, 0x1532, 0x007c, 0xa182, 0x0040, 0x0079, 0x6720, - 0x672f, 0x672f, 0x672f, 0x672f, 0x672f, 0x672f, 0x672f, 0x672f, - 0x672f, 0x6731, 0x6754, 0x672f, 0x672f, 0x672f, 0x672f, 0x1078, - 0x12b7, 0x1078, 0x4719, 0x1078, 0x4821, 0x6010, 0x0d7e, 0x2068, - 0x684c, 0xd0fc, 0x0040, 0x6747, 0xa08c, 0x0003, 0xa18e, 0x0002, - 0x0040, 0x674d, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x67be, 0x6003, - 0x0007, 0x1078, 0x41cd, 0x0d7f, 0x007c, 0x1078, 0x41cd, 0x1078, - 0x556a, 0x0d7f, 0x0078, 0x674c, 0x2001, 0x0007, 0x1078, 0x3401, - 0x1078, 0x4719, 0x1078, 0x4821, 0x6010, 0x0d7e, 0x2068, 0x037e, - 0x2019, 0x0004, 0x1078, 0x6bb3, 0x037f, 0x1078, 0x6283, 0x0d7f, - 0x007c, 0xa186, 0x0013, 0x00c0, 0x6777, 0x6004, 0xa086, 0x0042, - 0x10c0, 0x12b7, 0x1078, 0x4671, 0x1078, 0x476a, 0x007c, 0xa186, - 0x0014, 0x00c0, 0x678b, 0x6004, 0xa086, 0x0042, 0x10c0, 0x12b7, - 0x2001, 0x0007, 0x1078, 0x3401, 0x1078, 0x4671, 0x1078, 0x6283, - 0x1078, 0x476a, 0x007c, 0xa182, 0x0040, 0x0079, 0x678f, 0x679e, - 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x67a0, 0x67ac, - 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x1078, 0x12b7, - 0x037e, 0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, - 0x1532, 0x047f, 0x037f, 0x007c, 0x6010, 0x0d7e, 0x2068, 0x684c, - 0xd0fc, 0x0040, 0x67b8, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x67be, - 0x6003, 0x0007, 0x1078, 0x41cd, 0x0d7f, 0x007c, 0xa182, 0x0040, - 0x0079, 0x67c2, 0x67d1, 0x67d3, 0x67df, 0x67eb, 0x67d1, 0x67d1, - 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1, - 0x67d1, 0x1078, 0x12b7, 0x6003, 0x0001, 0x6106, 0x1078, 0x4327, - 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x007c, 0x6003, - 0x0001, 0x6106, 0x1078, 0x4327, 0x127e, 0x2091, 0x8000, 0x1078, - 0x476a, 0x127f, 0x007c, 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078, - 0x17de, 0x127e, 0x2091, 0x8000, 0x1078, 0x4395, 0x1078, 0x4821, - 0x127f, 0x007c, 0x1078, 0x4671, 0x0078, 0x6800, 0x1078, 0x4719, - 0x6110, 0x81ff, 0x0040, 0x680d, 0x0d7e, 0x2168, 0x037e, 0x2019, - 0x0029, 0x1078, 0x6bb3, 0x037f, 0x0d7f, 0x1078, 0x6283, 0x1078, - 0x476a, 0x007c, 0xa182, 0x0025, 0x0079, 0x6816, 0x681d, 0x681d, - 0x681d, 0x681f, 0x681d, 0x681d, 0x681d, 0x1078, 0x12b7, 0x027e, - 0x0e7e, 0x2071, 0x7280, 0x7220, 0x1078, 0x6ad1, 0x0040, 0x682c, - 0x6007, 0x0026, 0x0078, 0x682e, 0x6007, 0x0027, 0x6003, 0x0001, - 0x1078, 0x4327, 0x1078, 0x476a, 0x0e7f, 0x027f, 0x007c, 0xa186, - 0x0013, 0x00c0, 0x6848, 0x6004, 0xa08a, 0x0025, 0x1048, 0x12b7, - 0xa08a, 0x002c, 0x10c8, 0x12b7, 0xa082, 0x0025, 0x0079, 0x6857, - 0xa186, 0x0014, 0x10c0, 0x12b7, 0x2001, 0x0007, 0x1078, 0x3401, - 0x1078, 0x4671, 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0x685e, - 0x6860, 0x6860, 0x685e, 0x685e, 0x685e, 0x685e, 0x1078, 0x12b7, - 0x1078, 0x4671, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0xa182, - 0x0025, 0x1048, 0x12b7, 0xa182, 0x002c, 0x10c8, 0x12b7, 0xa182, - 0x0025, 0x0079, 0x6873, 0x687a, 0x687a, 0x687a, 0x687c, 0x687a, - 0x687a, 0x687a, 0x1078, 0x12b7, 0x007c, 0x1078, 0x4671, 0x1078, - 0x6283, 0x1078, 0x476a, 0x007c, 0x127e, 0x037e, 0x087e, 0x2091, - 0x8000, 0x2c40, 0x2019, 0x0002, 0x1078, 0x5387, 0x00c0, 0x68b3, - 0x1078, 0x5428, 0x00c0, 0x68b3, 0x6000, 0xa086, 0x0000, 0x0040, - 0x68b3, 0x601c, 0xa086, 0x0007, 0x0040, 0x68b3, 0x0d7e, 0x6010, - 0x2068, 0x1078, 0x6120, 0x0040, 0x68a7, 0x1078, 0x6bb3, 0x0d7f, - 0x6000, 0xa086, 0x0004, 0x00c0, 0x68af, 0x1078, 0x15f2, 0x6013, + 0x2c10, 0x1078, 0x1572, 0x007c, 0xa182, 0x0040, 0x0079, 0x7070, + 0x7080, 0x7080, 0x7080, 0x7080, 0x7080, 0x7080, 0x7080, 0x7080, + 0x7080, 0x7082, 0x70a5, 0x7080, 0x7080, 0x7080, 0x7080, 0x70a5, + 0x1078, 0x12d5, 0x1078, 0x4c29, 0x1078, 0x4d3a, 0x6010, 0x0d7e, + 0x2068, 0x684c, 0xd0fc, 0x0040, 0x7098, 0xa08c, 0x0003, 0xa18e, + 0x0002, 0x0040, 0x709e, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x7112, + 0x6003, 0x0007, 0x1078, 0x468d, 0x0d7f, 0x007c, 0x1078, 0x468d, + 0x1078, 0x5c02, 0x0d7f, 0x0078, 0x709d, 0x037e, 0x1078, 0x4c29, + 0x1078, 0x4d3a, 0x6010, 0x0d7e, 0x2068, 0x2019, 0x0004, 0x1078, + 0x74fd, 0x1078, 0x6aa1, 0x6017, 0x0028, 0x0d7f, 0x037f, 0x007c, + 0xa186, 0x0013, 0x00c0, 0x70c6, 0x6004, 0xa086, 0x0042, 0x10c0, + 0x12d5, 0x1078, 0x4b81, 0x1078, 0x4c7a, 0x007c, 0xa186, 0x0027, + 0x0040, 0x70ce, 0xa186, 0x0014, 0x00c0, 0x70de, 0x6004, 0xa086, + 0x0042, 0x10c0, 0x12d5, 0x2001, 0x0007, 0x1078, 0x37df, 0x1078, + 0x4b81, 0x1078, 0x6aa1, 0x1078, 0x4c7a, 0x007c, 0xa182, 0x0040, + 0x0079, 0x70e2, 0x70f2, 0x70f2, 0x70f2, 0x70f2, 0x70f2, 0x70f2, + 0x70f2, 0x70f4, 0x7100, 0x70f2, 0x70f2, 0x70f2, 0x70f2, 0x70f2, + 0x70f2, 0x70f2, 0x1078, 0x12d5, 0x037e, 0x047e, 0x20e1, 0x0005, + 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1572, 0x047f, 0x037f, 0x007c, + 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x710c, 0x2009, + 0x0041, 0x0d7f, 0x0078, 0x7112, 0x6003, 0x0007, 0x1078, 0x468d, + 0x0d7f, 0x007c, 0xa182, 0x0040, 0x0079, 0x7116, 0x7126, 0x7128, + 0x7134, 0x7140, 0x7126, 0x7126, 0x7126, 0x7126, 0x7126, 0x7126, + 0x7126, 0x7126, 0x7126, 0x7126, 0x7126, 0x7126, 0x1078, 0x12d5, + 0x6003, 0x0001, 0x6106, 0x1078, 0x4825, 0x127e, 0x2091, 0x8000, + 0x1078, 0x4c7a, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, + 0x4825, 0x127e, 0x2091, 0x8000, 0x1078, 0x4c7a, 0x127f, 0x007c, + 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078, 0x19cf, 0x127e, 0x2091, + 0x8000, 0x1078, 0x4891, 0x1078, 0x4d3a, 0x127f, 0x007c, 0x1078, + 0x4b81, 0x0078, 0x7155, 0x1078, 0x4c29, 0x6110, 0x81ff, 0x0040, + 0x7162, 0x0d7e, 0x2168, 0x037e, 0x2019, 0x0029, 0x1078, 0x74fd, + 0x037f, 0x0d7f, 0x1078, 0x6aa1, 0x1078, 0x4c7a, 0x007c, 0xa182, + 0x0085, 0x0079, 0x716b, 0x7172, 0x7172, 0x7172, 0x7174, 0x7172, + 0x7172, 0x7172, 0x1078, 0x12d5, 0x027e, 0x0e7e, 0x2071, 0x7b80, + 0x7220, 0x1078, 0x7417, 0x0040, 0x7181, 0x6007, 0x0086, 0x0078, + 0x7183, 0x6007, 0x0087, 0x6003, 0x0001, 0x1078, 0x4825, 0x1078, + 0x4c7a, 0x0e7f, 0x027f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x719d, + 0x6004, 0xa08a, 0x0085, 0x1048, 0x12d5, 0xa08a, 0x008c, 0x10c8, + 0x12d5, 0xa082, 0x0085, 0x0079, 0x71b0, 0xa186, 0x0027, 0x0040, + 0x71a5, 0xa186, 0x0014, 0x10c0, 0x12d5, 0x2001, 0x0007, 0x1078, + 0x37df, 0x1078, 0x4b81, 0x1078, 0x6aa1, 0x1078, 0x4c7a, 0x007c, + 0x71b7, 0x71b9, 0x71b9, 0x71b7, 0x71b7, 0x71b7, 0x71b7, 0x1078, + 0x12d5, 0x1078, 0x4b81, 0x1078, 0x5c02, 0x1078, 0x4c7a, 0x007c, + 0xa182, 0x0085, 0x1048, 0x12d5, 0xa182, 0x008c, 0x10c8, 0x12d5, + 0xa182, 0x0085, 0x0079, 0x71cc, 0x71d3, 0x71d3, 0x71d3, 0x71d5, + 0x71d3, 0x71d3, 0x71d3, 0x1078, 0x12d5, 0x007c, 0x1078, 0x4b81, + 0x1078, 0x6aa1, 0x1078, 0x4c7a, 0x007c, 0x037e, 0x2019, 0x000b, + 0x1078, 0x71e6, 0x601f, 0x0006, 0x037f, 0x007c, 0x127e, 0x037e, + 0x087e, 0x2091, 0x8000, 0x2c40, 0x1078, 0x5915, 0x00c0, 0x7213, + 0x1078, 0x59b6, 0x00c0, 0x7213, 0x6000, 0xa086, 0x0000, 0x0040, + 0x7213, 0x601c, 0xa086, 0x0007, 0x0040, 0x7213, 0x0d7e, 0x6000, + 0xa086, 0x0004, 0x00c0, 0x7206, 0x1078, 0x1676, 0x6010, 0x2068, + 0x1078, 0x693e, 0x0040, 0x720e, 0x1078, 0x74fd, 0x0d7f, 0x6013, 0x0000, 0x601f, 0x0007, 0x087f, 0x037f, 0x127f, 0x007c, 0x0f7e, - 0x0c7e, 0x037e, 0x157e, 0x2079, 0x7280, 0x7938, 0x783c, 0x1078, - 0x1e1b, 0x00c0, 0x68e8, 0x017e, 0x0c7e, 0x1078, 0x3447, 0x00c0, - 0x68e8, 0x2011, 0x7290, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, - 0x5a35, 0x00c0, 0x68e8, 0x017f, 0x027f, 0x027e, 0x017e, 0x2019, - 0x0029, 0x1078, 0x445c, 0x1078, 0x43a9, 0x017f, 0x1078, 0x6a57, - 0x1078, 0x35cf, 0x017f, 0x1078, 0x3256, 0xa006, 0x0078, 0x68ea, - 0x0c7f, 0x017f, 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c, 0x0e7e, - 0x0d7e, 0x0c7e, 0x047e, 0x037e, 0x027e, 0x2061, 0x7400, 0x2071, - 0x6d00, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x6929, 0x2100, - 0xac06, 0x0040, 0x691b, 0x6000, 0xa086, 0x0000, 0x0040, 0x691b, - 0x6018, 0x2068, 0x68a0, 0xa206, 0x00c0, 0x691b, 0x631c, 0xa386, - 0x0004, 0x0040, 0x6925, 0xa386, 0x0005, 0x0040, 0x6925, 0xa386, - 0x0006, 0x0040, 0x6925, 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004, - 0xac02, 0x00c8, 0x6929, 0x0078, 0x68f7, 0xa085, 0x0001, 0x0078, - 0x692a, 0xa006, 0x027f, 0x037f, 0x047f, 0x0c7f, 0x0d7f, 0x0e7f, - 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x2009, 0x6d1e, 0x2104, 0xa086, - 0x0074, 0x00c0, 0x6988, 0x2069, 0x728e, 0x690c, 0xa182, 0x0100, - 0x0048, 0x6978, 0x6908, 0xa184, 0x8000, 0x0040, 0x6984, 0xa184, - 0x0800, 0x0040, 0x6984, 0x6910, 0xa18a, 0x0001, 0x0048, 0x697c, - 0x6914, 0x2069, 0x72ae, 0x6904, 0x81ff, 0x00c0, 0x6970, 0x690c, - 0xa182, 0x0100, 0x0048, 0x6978, 0x6908, 0x81ff, 0x00c0, 0x6974, - 0x6910, 0xa18a, 0x0001, 0x0048, 0x697c, 0x6918, 0xa18a, 0x0001, - 0x0048, 0x6984, 0x0078, 0x698e, 0x6013, 0x0100, 0x0078, 0x698a, - 0x6013, 0x0300, 0x0078, 0x698a, 0x6013, 0x0500, 0x0078, 0x698a, - 0x6013, 0x0700, 0x0078, 0x698a, 0x6013, 0x0900, 0x0078, 0x698a, - 0x6013, 0x0b00, 0x0078, 0x698a, 0x6013, 0x0f00, 0x0078, 0x698a, - 0x6013, 0x2d00, 0xa085, 0x0001, 0x0078, 0x698f, 0xa006, 0x017f, - 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e, 0x037e, 0x157e, - 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286, 0x0006, 0x0040, - 0x69b7, 0xa286, 0x0004, 0x0040, 0x69b7, 0xa394, 0xff00, 0x8217, - 0xa286, 0x0006, 0x0040, 0x69b7, 0xa286, 0x0004, 0x0040, 0x69b7, - 0x0c7e, 0x2d60, 0x1078, 0x3459, 0x0c7f, 0x0078, 0x69ea, 0x2011, - 0x7296, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a35, 0x00c0, - 0x69eb, 0x2011, 0x729a, 0xad98, 0x0006, 0x20a9, 0x0004, 0x1078, - 0x5a35, 0x00c0, 0x69eb, 0x047e, 0x017e, 0x6aa0, 0xa294, 0x00ff, - 0x8227, 0xa006, 0x2009, 0x6d52, 0x210c, 0xd1a4, 0x0040, 0x69df, - 0x2009, 0x0029, 0x1078, 0x6bf7, 0x6800, 0xc0e5, 0x6802, 0x2019, - 0x0029, 0x1078, 0x445c, 0x1078, 0x43a9, 0x2c08, 0x1078, 0x6a57, - 0x017f, 0x047f, 0xa006, 0x157f, 0x037f, 0x027f, 0x0d7f, 0x0c7f, - 0x007c, 0x0d7e, 0x2069, 0x728e, 0x6800, 0xa086, 0x0800, 0x0040, - 0x69fd, 0x6013, 0x0000, 0x0078, 0x69fe, 0xa006, 0x0d7f, 0x007c, - 0x0c7e, 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e, 0x2079, 0x728c, - 0x7930, 0x7834, 0x1078, 0x1e1b, 0x00c0, 0x6a24, 0x1078, 0x3447, - 0x00c0, 0x6a24, 0x2011, 0x7290, 0xac98, 0x000a, 0x20a9, 0x0004, - 0x1078, 0x5a35, 0x00c0, 0x6a24, 0x2011, 0x7294, 0xac98, 0x0006, - 0x20a9, 0x0004, 0x1078, 0x5a35, 0x157f, 0x037f, 0x027f, 0x017f, - 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, 0x007e, 0x017e, 0x027e, 0x037e, - 0x157e, 0x2011, 0x7283, 0x2204, 0x8211, 0x220c, 0x1078, 0x1e1b, - 0x00c0, 0x6a50, 0x1078, 0x3447, 0x00c0, 0x6a50, 0x2011, 0x7296, - 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a35, 0x00c0, 0x6a50, - 0x2011, 0x729a, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x5a35, - 0x157f, 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f, 0x007c, 0x0e7e, - 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, 0x127e, 0x2091, - 0x8000, 0x2029, 0x6f19, 0x252c, 0x2021, 0x6f1f, 0x2424, 0x2061, - 0x7400, 0x2071, 0x6d00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, - 0x6abc, 0x2100, 0xac06, 0x0040, 0x6ab2, 0x1078, 0x6c0f, 0x0040, - 0x6ab2, 0x671c, 0xa786, 0x0001, 0x0040, 0x6ab2, 0xa786, 0x0007, - 0x0040, 0x6ab2, 0x2500, 0xac06, 0x0040, 0x6ab2, 0x2400, 0xac06, - 0x0040, 0x6ab2, 0x6018, 0x2070, 0x70a0, 0xa206, 0x00c0, 0x6ab2, - 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x6aa6, 0xa786, - 0x0003, 0x00c0, 0x6ac5, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, - 0x017e, 0x1078, 0x36a1, 0x017f, 0x1078, 0x6276, 0x0d7f, 0x6000, - 0xa086, 0x0004, 0x00c0, 0x6ab0, 0x017e, 0x1078, 0x15f2, 0x017f, - 0x1078, 0x6283, 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004, 0xac02, - 0x00c8, 0x6abc, 0x0078, 0x6a69, 0x127f, 0x027f, 0x047f, 0x057f, - 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, - 0x6a9b, 0xa386, 0x0005, 0x0040, 0x6ab2, 0x1078, 0x6bb3, 0x0078, - 0x6aa6, 0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078, 0x6bca, - 0x017f, 0x0040, 0x6ae0, 0x601c, 0xa084, 0x000f, 0x1079, 0x6ae3, - 0x0e7f, 0x0c7f, 0x007c, 0x6aeb, 0x6aeb, 0x6aeb, 0x6aeb, 0x6aeb, - 0x6aeb, 0x6aed, 0x6aeb, 0xa006, 0x007c, 0x047e, 0x017e, 0x7018, - 0xa080, 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00, 0x2009, - 0x0020, 0x1078, 0x6bf7, 0x017f, 0x047f, 0x1078, 0x6884, 0xa085, - 0x0001, 0x007c, 0x2001, 0x0001, 0x1078, 0x33df, 0x157e, 0x017e, - 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, 0x6d05, 0x2011, 0x7296, - 0x1078, 0x5a35, 0x037f, 0x027f, 0x017f, 0x157f, 0xa005, 0x007c, - 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x027e, 0x127e, 0x2091, - 0x8000, 0x2061, 0x7400, 0x2079, 0x0001, 0x8fff, 0x0040, 0x6b73, - 0x2071, 0x6d00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x6b73, - 0x88ff, 0x0040, 0x6b39, 0x2800, 0xac06, 0x00c0, 0x6b69, 0x2079, - 0x0000, 0x1078, 0x6c0f, 0x0040, 0x6b69, 0x2400, 0xac06, 0x0040, - 0x6b69, 0x671c, 0xa786, 0x0006, 0x00c0, 0x6b69, 0xa786, 0x0007, - 0x0040, 0x6b69, 0x88ff, 0x00c0, 0x6b51, 0x6018, 0xa206, 0x00c0, - 0x6b69, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x6b5c, - 0x047e, 0x1078, 0x6bb3, 0x047f, 0x0d7f, 0x6000, 0xa086, 0x0004, - 0x00c0, 0x6b64, 0x1078, 0x15f2, 0x1078, 0x6283, 0x88ff, 0x00c0, - 0x6b7c, 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004, 0xac02, 0x00c8, - 0x6b73, 0x0078, 0x6b25, 0xa006, 0x127f, 0x027f, 0x067f, 0x077f, - 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, 0x0078, 0x6b74, - 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019, 0x0002, 0x6218, 0x1078, - 0x5387, 0x1078, 0x5428, 0x1078, 0x6b18, 0x087f, 0x007c, 0x027e, - 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20, 0x20a9, 0x007f, 0x2009, - 0x0000, 0x017e, 0x037e, 0x1078, 0x3447, 0x00c0, 0x6ba8, 0x2c10, - 0x2041, 0x0000, 0x1078, 0x5387, 0x1078, 0x5428, 0x1078, 0x6b18, - 0x037f, 0x017f, 0x8108, 0x00f0, 0x6b99, 0x157f, 0x0c7f, 0x087f, - 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e, 0x8dff, 0x0040, 0x6bc7, - 0x6800, 0xa07d, 0x0040, 0x6bc4, 0x6803, 0x0000, 0x6b52, 0x1078, - 0x36a1, 0x2f68, 0x0078, 0x6bb8, 0x6b52, 0x1078, 0x36a1, 0x0f7f, - 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061, 0x7400, 0x2071, - 0x6d00, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x6bf2, 0x2100, - 0xac06, 0x0040, 0x6be4, 0x6000, 0xa086, 0x0000, 0x0040, 0x6be4, - 0x6008, 0xa206, 0x0040, 0x6bee, 0xace0, 0x0008, 0x2001, 0x6d15, - 0x2004, 0xac02, 0x00c8, 0x6bf2, 0x0078, 0x6bcf, 0xa085, 0x0001, - 0x0078, 0x6bf3, 0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e, - 0x007e, 0x1078, 0x130f, 0x007f, 0x1040, 0x12b7, 0x6837, 0x010d, - 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, 0x685e, 0x6956, - 0x6c46, 0x684f, 0x0000, 0x1078, 0x36a1, 0x0d7f, 0x007c, 0x6700, - 0xa786, 0x0000, 0x0040, 0x6c22, 0xa786, 0x0001, 0x0040, 0x6c22, - 0xa786, 0x000a, 0x0040, 0x6c22, 0xa786, 0x0009, 0x0040, 0x6c22, - 0xa085, 0x0001, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, - 0x2071, 0x6d00, 0xd5a4, 0x0040, 0x6c30, 0x7034, 0x8000, 0x7036, - 0xd5b4, 0x0040, 0x6c36, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, - 0x6c3d, 0x2071, 0x6d0a, 0x1078, 0x6c6c, 0x0e7f, 0x007f, 0x127f, - 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6d00, - 0xd5a4, 0x0040, 0x6c4e, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, - 0x6c54, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x6c5b, 0x2071, - 0x6d0a, 0x1078, 0x6c6c, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, - 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6d02, 0x1078, 0x6c6c, - 0x0e7f, 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000, 0x2072, 0x00c8, - 0x6c75, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c, 0x0e7e, 0x2071, - 0x6d00, 0x1078, 0x6c6c, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6d04, - 0x1078, 0x6c6c, 0x0e7f, 0x007c, 0x0001, 0x0002, 0x0004, 0x0008, - 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, - 0x1000, 0x2000, 0x4000, 0x8000, 0x614c + 0x0c7e, 0x037e, 0x157e, 0x2079, 0x7b80, 0x7838, 0xa08c, 0x00ff, + 0x783c, 0x1078, 0x2085, 0x00c0, 0x724e, 0x017e, 0x0c7e, 0x1078, + 0x3825, 0x00c0, 0x724e, 0x2011, 0x7b90, 0xac98, 0x000a, 0x20a9, + 0x0004, 0x1078, 0x616a, 0x00c0, 0x724e, 0x017f, 0x027f, 0x027e, + 0x017e, 0x2019, 0x0029, 0x1078, 0x5a8a, 0x1078, 0x4962, 0x1078, + 0x48a5, 0x017f, 0x1078, 0x737b, 0x1078, 0x39a6, 0x017f, 0x1078, + 0x3621, 0x6612, 0x6516, 0xa006, 0x0078, 0x7250, 0x0c7f, 0x017f, + 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, + 0x2009, 0x761e, 0x2104, 0xa086, 0x0074, 0x00c0, 0x72ac, 0x2069, + 0x7b8e, 0x690c, 0xa182, 0x0100, 0x0048, 0x729c, 0x6908, 0xa184, + 0x8000, 0x0040, 0x72a8, 0xa184, 0x0800, 0x0040, 0x72a8, 0x6910, + 0xa18a, 0x0001, 0x0048, 0x72a0, 0x6914, 0x2069, 0x7bae, 0x6904, + 0x81ff, 0x00c0, 0x7294, 0x690c, 0xa182, 0x0100, 0x0048, 0x729c, + 0x6908, 0x81ff, 0x00c0, 0x7298, 0x6910, 0xa18a, 0x0001, 0x0048, + 0x72a0, 0x6918, 0xa18a, 0x0001, 0x0048, 0x72a8, 0x0078, 0x72b2, + 0x6013, 0x0100, 0x0078, 0x72ae, 0x6013, 0x0300, 0x0078, 0x72ae, + 0x6013, 0x0500, 0x0078, 0x72ae, 0x6013, 0x0700, 0x0078, 0x72ae, + 0x6013, 0x0900, 0x0078, 0x72ae, 0x6013, 0x0b00, 0x0078, 0x72ae, + 0x6013, 0x0f00, 0x0078, 0x72ae, 0x6013, 0x2d00, 0xa085, 0x0001, + 0x0078, 0x72b3, 0xa006, 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, + 0x0d7e, 0x027e, 0x037e, 0x157e, 0x6218, 0x2268, 0x6b04, 0xa394, + 0x00ff, 0xa286, 0x0006, 0x0040, 0x72db, 0xa286, 0x0004, 0x0040, + 0x72db, 0xa394, 0xff00, 0x8217, 0xa286, 0x0006, 0x0040, 0x72db, + 0xa286, 0x0004, 0x0040, 0x72db, 0x0c7e, 0x2d60, 0x1078, 0x3837, + 0x0c7f, 0x0078, 0x730e, 0x2011, 0x7b96, 0xad98, 0x000a, 0x20a9, + 0x0004, 0x1078, 0x616a, 0x00c0, 0x730f, 0x2011, 0x7b9a, 0xad98, + 0x0006, 0x20a9, 0x0004, 0x1078, 0x616a, 0x00c0, 0x730f, 0x047e, + 0x017e, 0x6aa0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x7652, + 0x210c, 0xd1a4, 0x0040, 0x7303, 0x2009, 0x0029, 0x1078, 0x7541, + 0x6800, 0xc0e5, 0x6802, 0x2019, 0x0029, 0x1078, 0x4962, 0x1078, + 0x48a5, 0x2c08, 0x1078, 0x737b, 0x017f, 0x047f, 0xa006, 0x157f, + 0x037f, 0x027f, 0x0d7f, 0x0c7f, 0x007c, 0x0d7e, 0x2069, 0x7b8e, + 0x6800, 0xa086, 0x0800, 0x0040, 0x7321, 0x6013, 0x0000, 0x0078, + 0x7322, 0xa006, 0x0d7f, 0x007c, 0x0c7e, 0x0f7e, 0x017e, 0x027e, + 0x037e, 0x157e, 0x2079, 0x7b8c, 0x7930, 0x7834, 0x1078, 0x2085, + 0x00c0, 0x7348, 0x1078, 0x3825, 0x00c0, 0x7348, 0x2011, 0x7b90, + 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x616a, 0x00c0, 0x7348, + 0x2011, 0x7b94, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x616a, + 0x157f, 0x037f, 0x027f, 0x017f, 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, + 0x007e, 0x017e, 0x027e, 0x037e, 0x157e, 0x2011, 0x7b83, 0x2204, + 0x8211, 0x220c, 0x1078, 0x2085, 0x00c0, 0x7374, 0x1078, 0x3825, + 0x00c0, 0x7374, 0x2011, 0x7b96, 0xac98, 0x000a, 0x20a9, 0x0004, + 0x1078, 0x616a, 0x00c0, 0x7374, 0x2011, 0x7b9a, 0xac98, 0x0006, + 0x20a9, 0x0004, 0x1078, 0x616a, 0x157f, 0x037f, 0x027f, 0x017f, + 0x007f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x057e, + 0x047e, 0x027e, 0x127e, 0x2091, 0x8000, 0x2029, 0x783f, 0x252c, + 0x2021, 0x7845, 0x2424, 0x2061, 0x7d00, 0x2071, 0x7600, 0x7644, + 0x7060, 0x8001, 0xa602, 0x00c8, 0x73e0, 0x2100, 0xac06, 0x0040, + 0x73d6, 0x1078, 0x7559, 0x0040, 0x73d6, 0x671c, 0xa786, 0x0001, + 0x0040, 0x73f5, 0xa786, 0x0007, 0x0040, 0x73d6, 0x2500, 0xac06, + 0x0040, 0x73d6, 0x2400, 0xac06, 0x0040, 0x73d6, 0x1078, 0x756d, + 0x00c0, 0x73d6, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x73bc, + 0x017e, 0x1078, 0x1676, 0x017f, 0x6010, 0x2068, 0x1078, 0x693e, + 0x0040, 0x73d3, 0xa786, 0x0003, 0x00c0, 0x73e9, 0x6837, 0x0103, + 0x6b4a, 0x6847, 0x0000, 0x017e, 0x1078, 0x6b3f, 0x1078, 0x3a7a, + 0x017f, 0x1078, 0x6a94, 0x0d7f, 0x1078, 0x6aa1, 0xace0, 0x0008, + 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8, 0x73e0, 0x0078, 0x738d, + 0x127f, 0x027f, 0x047f, 0x057f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, + 0x007c, 0xa786, 0x0006, 0x00c0, 0x73c6, 0xa386, 0x0005, 0x0040, + 0x73d6, 0x1078, 0x74fd, 0x0078, 0x73d3, 0x1078, 0x756d, 0x00c0, + 0x73d6, 0xa180, 0x0001, 0x2004, 0xa086, 0x0018, 0x00c0, 0x73d6, + 0x6000, 0xa086, 0x0002, 0x00c0, 0x73d6, 0x1078, 0x6aba, 0x0040, + 0x7411, 0x1078, 0x6ace, 0x00c0, 0x73d6, 0x1078, 0x5e57, 0x0078, + 0x7413, 0x1078, 0x22dd, 0x1078, 0x6aa1, 0x0078, 0x73d6, 0x0c7e, + 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078, 0x7514, 0x017f, 0x0040, + 0x7426, 0x601c, 0xa084, 0x000f, 0x1079, 0x7429, 0x0e7f, 0x0c7f, + 0x007c, 0x7431, 0x7431, 0x7431, 0x7431, 0x7431, 0x7431, 0x7433, + 0x7431, 0xa006, 0x007c, 0x047e, 0x017e, 0x7018, 0xa080, 0x0028, + 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020, 0x1078, + 0x7541, 0x017f, 0x047f, 0x037e, 0x2019, 0x0002, 0x1078, 0x71e6, + 0x037f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0001, 0x1078, 0x37bd, + 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, 0x7605, + 0x2011, 0x7b96, 0x1078, 0x616a, 0x037f, 0x027f, 0x017f, 0x157f, + 0xa005, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x027e, + 0x127e, 0x2091, 0x8000, 0x2061, 0x7d00, 0x2079, 0x0001, 0x8fff, + 0x0040, 0x74bd, 0x2071, 0x7600, 0x7644, 0x7060, 0x8001, 0xa602, + 0x00c8, 0x74bd, 0x88ff, 0x0040, 0x7483, 0x2800, 0xac06, 0x00c0, + 0x74b3, 0x2079, 0x0000, 0x1078, 0x7559, 0x0040, 0x74b3, 0x2400, + 0xac06, 0x0040, 0x74b3, 0x671c, 0xa786, 0x0006, 0x00c0, 0x74b3, + 0xa786, 0x0007, 0x0040, 0x74b3, 0x88ff, 0x00c0, 0x749b, 0x6018, + 0xa206, 0x00c0, 0x74b3, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, + 0x74a3, 0x1078, 0x1676, 0x6010, 0x2068, 0x1078, 0x693e, 0x0040, + 0x74ad, 0x047e, 0x1078, 0x74fd, 0x047f, 0x0d7f, 0x1078, 0x6aa1, + 0x88ff, 0x00c0, 0x74c6, 0xace0, 0x0008, 0x2001, 0x7615, 0x2004, + 0xac02, 0x00c8, 0x74bd, 0x0078, 0x746f, 0xa006, 0x127f, 0x027f, + 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, + 0x0078, 0x74be, 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019, 0x0002, + 0x6218, 0x1078, 0x5915, 0x1078, 0x59b6, 0x1078, 0x7462, 0x087f, + 0x007c, 0x027e, 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20, 0x20a9, + 0x007f, 0x2009, 0x0000, 0x017e, 0x037e, 0x1078, 0x3825, 0x00c0, + 0x74f2, 0x2c10, 0x2041, 0x0000, 0x1078, 0x5915, 0x1078, 0x59b6, + 0x1078, 0x7462, 0x037f, 0x017f, 0x8108, 0x00f0, 0x74e3, 0x157f, + 0x0c7f, 0x087f, 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e, 0x8dff, + 0x0040, 0x7511, 0x6800, 0xa07d, 0x0040, 0x750e, 0x6803, 0x0000, + 0x6b52, 0x1078, 0x3a7a, 0x2f68, 0x0078, 0x7502, 0x6b52, 0x1078, + 0x3a7a, 0x0f7f, 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061, + 0x7d00, 0x2071, 0x7600, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, + 0x753c, 0x2100, 0xac06, 0x0040, 0x752e, 0x6000, 0xa086, 0x0000, + 0x0040, 0x752e, 0x6008, 0xa206, 0x0040, 0x7538, 0xace0, 0x0008, + 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8, 0x753c, 0x0078, 0x7519, + 0xa085, 0x0001, 0x0078, 0x753d, 0xa006, 0x037f, 0x047f, 0x0e7f, + 0x007c, 0x0d7e, 0x007e, 0x1078, 0x132f, 0x007f, 0x1040, 0x12d5, + 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, + 0x685e, 0x6956, 0x6c46, 0x684f, 0x0000, 0x1078, 0x3a7a, 0x0d7f, + 0x007c, 0x6700, 0xa786, 0x0000, 0x0040, 0x756c, 0xa786, 0x0001, + 0x0040, 0x756c, 0xa786, 0x000a, 0x0040, 0x756c, 0xa786, 0x0009, + 0x0040, 0x756c, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x6018, 0x2070, + 0x70a0, 0xa206, 0x0e7f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, + 0x8000, 0x2071, 0x7640, 0xd5a4, 0x0040, 0x7581, 0x7034, 0x8000, + 0x7036, 0xd5b4, 0x0040, 0x7587, 0x7030, 0x8000, 0x7032, 0xd5ac, + 0x0040, 0x758e, 0x2071, 0x764a, 0x1078, 0x75bd, 0x0e7f, 0x007f, + 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, + 0x7640, 0xd5a4, 0x0040, 0x759f, 0x7034, 0x8000, 0x7036, 0xd5b4, + 0x0040, 0x75a5, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x75ac, + 0x2071, 0x764a, 0x1078, 0x75bd, 0x0e7f, 0x007f, 0x127f, 0x007c, + 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x7642, 0x1078, + 0x75bd, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000, 0x2072, + 0x00c8, 0x75c6, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c, 0x0e7e, + 0x2071, 0x7640, 0x1078, 0x75bd, 0x0e7f, 0x007c, 0x0e7e, 0x2071, + 0x7644, 0x1078, 0x75bd, 0x0e7f, 0x007c, 0x0001, 0x0002, 0x0004, + 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, + 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0xaaff }; -unsigned short risc_code_length01 = 0x5c95; +unsigned short risc_code_length01 = 0x65e6; diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/sg.c linux/drivers/scsi/sg.c --- v2.2.5/linux/drivers/scsi/sg.c Wed Aug 26 11:37:38 1998 +++ linux/drivers/scsi/sg.c Fri Apr 16 11:59:28 1999 @@ -4,7 +4,45 @@ * to allow user process control of SCSI devices. * Development Sponsored by Killy Corp. NY NY * - * Borrows code from st driver. + * Original driver (sg.c): + * Copyright (C) 1992 Lawrence Foard + * 2.x extensions to driver: + * Copyright (C) 1998, 1999 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * Borrows code from st driver. Thanks to Alessandro Rubini's "dd" book. + */ + static char * sg_version_str = "Version: 2.1.31 (990327)"; +/* + * D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au) + * - scatter list logic replaces previous large atomic SG_BIG_BUFF + * sized allocation. See notes in include file. + * + * - scsi logging is available via SCSI_LOG_TIMEOUT macros. First + * the kernel/module needs to be built with CONFIG_SCSI_LOGGING + * (otherwise the macros compile to empty statements), then do + * something like: 'echo "scsi log all" > /proc/scsi/scsi' to log + * everything or 'echo "scsi log {token} #N" > /proc/scsi/scsi' + * where {token} is one of [error,timeout,scan,mlqueue,mlcomplete, + * llqueue,llcomplete,hlqueue,hlcomplete,ioctl] and #N is 0...7 + * (with 0 meaning off). For example: 'scsi log timeout 7 > + * /proc/scsi/scsi' to get all logging messages from this driver. + * Should use hlcomplete but it is too "noisy" (sd uses it). + * + * - This driver obtains memory (heap) for the low-level driver to + * transfer/dma to and from. It is obtained from up to 4 sources: + * - 1 SG_SCATTER_SZ sized buffer on open() (per fd) + * [could be less if SG_SCATTER_SZ bytes not available] + * - obtain heap as required on write()s (get_free_pages) + * - obtain heap from the shared scsi dma pool + * - obtain heap from kernel directly (kmalloc) [last choice] + * the 'alt_address' field in the scatter_list structure and the + * related 'mem_src' indicate the source of the heap allocation. + * */ #include @@ -28,541 +66,849 @@ #include #include -int sg_big_buff = SG_BIG_BUFF; /* for now, sg_big_buff is read-only through sysctl */ + +int sg_big_buff = SG_SCATTER_SZ; /* sg_big_buff is ro through sysctl */ +/* N.B. This global is here to keep existing software happy. It now holds + the size of the "first buffer" of the most recent sucessful sg_open(). */ +/* Only available when 'sg' compiled into kernel (rather than a module). */ + +#define SG_SECTOR_SZ 512 +#define SG_SECTOR_MSK (SG_SECTOR_SZ - 1) + +#define SG_LOW_POOL_THRESHHOLD 30 +#define SG_MAX_POOL_SECTORS 320 /* Max. number of pool sectors to take */ + +static int sg_pool_secs_avail = SG_MAX_POOL_SECTORS; + +/* #define SG_DEBUG */ /* for counting varieties of allocations */ + +#ifdef SG_DEBUG +static int sg_num_kmal = 0; +static int sg_num_pool = 0; +static int sg_num_page = 0; +#endif + +#define SG_HEAP_FB 0 /* heap obtained at open() (one buffer per fd) */ +#define SG_HEAP_PAGE 1 /* heap from kernel via get_free_pages() */ +#define SG_HEAP_KMAL 2 /* heap from kernel via kmalloc() */ +#define SG_HEAP_POOL 3 /* heap from scsi dma pool (mid-level) */ + static int sg_init(void); static int sg_attach(Scsi_Device *); +static void sg_finish(void); static int sg_detect(Scsi_Device *); static void sg_detach(Scsi_Device *); struct Scsi_Device_Template sg_template = {NULL, NULL, "sg", NULL, 0xff, - SCSI_GENERIC_MAJOR, 0, 0, 0, 0, - sg_detect, sg_init, - NULL, sg_attach, sg_detach}; - -#ifdef SG_BIG_BUFF -static char *big_buff = NULL; -static struct wait_queue *big_wait; /* wait for buffer available */ -static int big_inuse=0; -#endif + SCSI_GENERIC_MAJOR, 0, 0, 0, 0, + sg_detect, sg_init, + sg_finish, sg_attach, sg_detach}; + -struct scsi_generic +typedef struct sg_scatter_hold /* holding area for scsi scatter gather info */ { - Scsi_Device *device; - int users; /* how many people have it open? */ - struct wait_queue *generic_wait; /* wait for device to be available */ - struct wait_queue *read_wait; /* wait for response */ - struct wait_queue *write_wait; /* wait for free buffer */ - int timeout; /* current default value for device */ - int buff_len; /* length of current buffer */ - char *buff; /* the buffer */ - struct sg_header header; /* header of pending command */ - char exclude; /* opened for exclusive access */ - char pending; /* don't accept writes now */ - char complete; /* command complete allow a read */ -}; + unsigned short use_sg; /* Number of pieces of scatter-gather */ + unsigned short sglist_len; /* size of malloc'd scatter-gather list */ + unsigned bufflen; /* Size of data buffer */ + unsigned b_malloc_len; /* actual len malloc'ed in buffer */ + void * buffer; /* Data buffer or scatter list (12 bytes) */ + char mem_src; /* heap whereabouts of 'buffer' */ +} Sg_scatter_hold; /* 20 bytes long on i386 */ -static struct scsi_generic *scsi_generics=NULL; -static void sg_free(char *buff,int size); +struct sg_device; /* forward declarations */ +struct sg_fd; -static int sg_ioctl(struct inode * inode,struct file * file, - unsigned int cmd_in, unsigned long arg) +typedef struct sg_request /* SG_MAX_QUEUE requests outstanding per file */ { - int dev = MINOR(inode->i_rdev); - int result; + Scsi_Cmnd * my_cmdp; /* NULL -> ready to read, else id */ + struct sg_request * nextrp; /* NULL -> tail request (slist) */ + struct sg_fd * parentfp; /* NULL -> not in use */ + Sg_scatter_hold data; /* hold buffers, perhaps scatter list */ + struct sg_header header; /* scsi command+info */ + char fb_used; /* 1 -> using fst_buf, normally 0 (used) */ +} Sg_request; /* around 72 bytes long on i386 */ - if ((dev<0) || (dev>=sg_template.dev_max)) - return -ENXIO; - - /* - * If we are in the middle of error recovery, then don't allow any - * access to this device. Also, error recovery *may* have taken the - * device offline, in which case all further access is prohibited. - */ - if( !scsi_block_when_processing_errors(scsi_generics[dev].device) ) - { - return -ENXIO; - } +typedef struct sg_fd /* holds the state of a file descriptor */ +{ + struct sg_fd * nextfp; /* NULL when last opened fd on this device */ + struct sg_device * parentdp; /* owning device */ + struct wait_queue * read_wait; /* queue read until command done */ + int timeout; /* defaults to SG_DEFAULT_TIMEOUT */ + char * fst_buf; /* try to grab SG_SCATTER_SZ sized buffer on open */ + int fb_size; /* actual size of allocated fst_buf */ + Sg_request * headrp; /* head of request slist, NULL->empty */ + struct fasync_struct * async_qp; /* used by asynchronous notification */ + Sg_request req_arr[SG_MAX_QUEUE]; /* used as singly-linked list */ + char low_dma; /* as in parent but possible overridden to 1 */ + char force_packid; /* 1 -> pack_id input to read(), 0 -> ignored */ + char closed; /* 1 -> fd closed but request(s) outstanding */ + char my_mem_src; /* heap whereabouts of this sg_fb object */ + char cmd_q; /* 1 -> allow command queuing, 0 -> don't */ +} Sg_fd; /* around 1192 bytes long on i386 */ + +typedef struct sg_device /* holds the state of each scsi generic device */ +{ + Scsi_Device * device; + struct wait_queue * generic_wait;/* queue open if O_EXCL on prev. open */ + int sg_tablesize; /* adapter's max scatter-gather table size */ + Sg_fd * headfp; /* first open fd belonging to this device */ + kdev_t i_rdev; /* holds device major+minor number */ + char exclude; /* opened for exclusive access */ + char sgdebug; /* 0->off, 1->sense, 9->dump dev, 10-> all devs */ + unsigned char merge_fd; /* 0->sequencing per fd (def) else fd count */ +} Sg_device; /* around 24 bytes long on i386 */ + + +static int sg_fasync(int fd, struct file * filp, int mode); +static void sg_command_done(Scsi_Cmnd * SCpnt); +static int sg_sc_build(Sg_request * srp, int max_buff_size, + const char * inp, int num_write_xfer); +static int sg_sc_undo_rem(Sg_request * srp, char * outp, + int num_read_xfer); +static char * sg_malloc(Sg_request * srp, int size, int * retSzp, + int * mem_srcp); +static void sg_free(Sg_request * srp, char * buff, int size, int mem_src); +static char * sg_low_malloc(int rqSz, int lowDma, int mem_src, + int * retSzp); +static void sg_low_free(char * buff, int size, int mem_src); +static Sg_fd * sg_add_sfp(Sg_device * sdp, int dev); +static int sg_remove_sfp(Sg_device * sdp, Sg_fd * sfp); +static Sg_request * sg_get_request(const Sg_fd * sfp, int pack_id); +static Sg_request * sg_add_request(Sg_fd * sfp); +static int sg_remove_request(Sg_fd * sfp, const Sg_request * srp); +static int sg_fb_in_use(const Sg_fd * sfp); +static void sg_clr_scpnt(Scsi_Cmnd * SCpnt); +static void sg_shorten_timeout(Scsi_Cmnd * scpnt); +static void sg_debug(const Sg_device * sdp, const Sg_fd * sfp, int part_of); +static void sg_debug_all(const Sg_fd * sfp); + +static Sg_device * sg_dev_arr = NULL; +static const int size_sg_header = sizeof(struct sg_header); - switch(cmd_in) - { - case SG_SET_TIMEOUT: - result = verify_area(VERIFY_READ, (const void *)arg, sizeof(int)); - if (result) return result; - get_user(scsi_generics[dev].timeout, (int *) arg); - return 0; - case SG_GET_TIMEOUT: - return scsi_generics[dev].timeout; - case SG_EMULATED_HOST: - return put_user(scsi_generics[dev].device->host->hostt->emulated, (int *) arg); - case SCSI_IOCTL_SEND_COMMAND: - /* - Allow SCSI_IOCTL_SEND_COMMAND without checking suser() since the - user already has read/write access to the generic device and so - can execute arbitrary SCSI commands. - */ - return scsi_ioctl_send_command(scsi_generics[dev].device, (void *) arg); - default: - return scsi_ioctl(scsi_generics[dev].device, cmd_in, (void *) arg); - } -} static int sg_open(struct inode * inode, struct file * filp) { - int dev=MINOR(inode->i_rdev); - int flags=filp->f_flags; - if (dev>=sg_template.dev_max || !scsi_generics[dev].device) - return -ENXIO; - - if( !scsi_block_when_processing_errors(scsi_generics[dev].device) ) - { - return -ENXIO; - } - - if (O_RDWR!=(flags & O_ACCMODE)) - return -EACCES; - - /* - * If we want exclusive access, then wait until the device is not - * busy, and then set the flag to prevent anyone else from using it. - */ - if (flags & O_EXCL) - { - while(scsi_generics[dev].users) - { - if (flags & O_NONBLOCK) - return -EBUSY; - interruptible_sleep_on(&scsi_generics[dev].generic_wait); - if (signal_pending(current)) - return -ERESTARTSYS; - } - scsi_generics[dev].exclude=1; - } - else - /* - * Wait until nobody has an exclusive open on - * this device. - */ - while(scsi_generics[dev].exclude) - { - if (flags & O_NONBLOCK) - return -EBUSY; - interruptible_sleep_on(&scsi_generics[dev].generic_wait); - if (signal_pending(current)) - return -ERESTARTSYS; - } + int dev = MINOR(inode->i_rdev); + int flags = filp->f_flags; + Sg_device * sdp; + Sg_fd * sfp; - /* - * OK, we should have grabbed the device. Mark the thing so + if ((NULL == sg_dev_arr) || (dev < 0) || (dev >= sg_template.dev_max)) + return -ENXIO; + sdp = &sg_dev_arr[dev]; + if ((! sdp->device) || (! sdp->device->host)) + return -ENXIO; + if (sdp->i_rdev != inode->i_rdev) + printk("sg_open: inode maj=%d, min=%d sdp maj=%d, min=%d\n", + MAJOR(inode->i_rdev), MINOR(inode->i_rdev), + MAJOR(sdp->i_rdev), MINOR(sdp->i_rdev)); + if(! scsi_block_when_processing_errors(sdp->device)) + return -ENXIO; +/* if (O_RDWR != (flags & O_ACCMODE)) */ +/* return -EACCES; May just want to get to a ioctl, so remove */ + + SCSI_LOG_TIMEOUT(3, printk("sg_open: dev=%d, flags=0x%x\n", dev, flags)); + /* If we want exclusive access, then wait until the device is not + * busy, and then set the flag to prevent anyone else from using it. */ + if (flags & O_EXCL) { + if (O_RDONLY == (flags & O_ACCMODE)) + return -EACCES; /* Can't lock it with read only access */ + while (sdp->headfp) { + if (flags & O_NONBLOCK) + return -EBUSY; + interruptible_sleep_on(&sdp->generic_wait); + if (signal_pending(current)) + return -ERESTARTSYS; + } + sdp->exclude = 1; + } + else { /* Wait until nobody has an exclusive open on this device. */ + while (sdp->exclude) { + if (flags & O_NONBLOCK) + return -EBUSY; + interruptible_sleep_on(&sdp->generic_wait); + if (signal_pending(current)) + return -ERESTARTSYS; + } + } + /* OK, we should have grabbed the device. Mark the thing so * that other processes know that we have it, and initialize the - * state variables to known values. - */ - if (!scsi_generics[dev].users - && scsi_generics[dev].pending - && scsi_generics[dev].complete) - { - if (scsi_generics[dev].buff != NULL) - sg_free(scsi_generics[dev].buff,scsi_generics[dev].buff_len); - scsi_generics[dev].buff=NULL; - scsi_generics[dev].pending=0; - } - if (!scsi_generics[dev].users) - scsi_generics[dev].timeout=SG_DEFAULT_TIMEOUT; - if (scsi_generics[dev].device->host->hostt->module) - __MOD_INC_USE_COUNT(scsi_generics[dev].device->host->hostt->module); + * state variables to known values. */ + if (! sdp->headfp) { /* no existing opens on this device */ + sdp->sgdebug = 0; + sdp->sg_tablesize = sdp->device->host->sg_tablesize; + sdp->merge_fd = SG_DEF_MERGE_FD; + } + if ((sfp = sg_add_sfp(sdp, dev))) { + if (0 == sdp->merge_fd) + filp->private_data = sfp; + } + else { + if (flags & O_EXCL) sdp->exclude = 0; /* undo if error */ + return -ENOMEM; + } + + if (sdp->device->host->hostt->module) + __MOD_INC_USE_COUNT(sdp->device->host->hostt->module); if (sg_template.module) __MOD_INC_USE_COUNT(sg_template.module); - scsi_generics[dev].users++; return 0; } -static int sg_close(struct inode * inode, struct file * filp) +/* Following function was formerly called 'sg_close' */ +static int sg_release(struct inode * inode, struct file * filp) { - int dev=MINOR(inode->i_rdev); - scsi_generics[dev].users--; - if (scsi_generics[dev].device->host->hostt->module) - __MOD_DEC_USE_COUNT(scsi_generics[dev].device->host->hostt->module); + Sg_device * sdp; + Sg_fd * sfp; + + if ((! (sfp = (Sg_fd *)filp->private_data)) || (! (sdp = sfp->parentdp))) + return -ENXIO; + SCSI_LOG_TIMEOUT(3, printk("sg_release: dev=%d\n", MINOR(sdp->i_rdev))); + sg_fasync(-1, filp, 0); /* remove filp from async notification list */ + sg_remove_sfp(sdp, sfp); + if (! sdp->headfp) { + filp->private_data = NULL; + sdp->merge_fd = 0; + } + + if (sdp->device->host->hostt->module) + __MOD_DEC_USE_COUNT(sdp->device->host->hostt->module); if(sg_template.module) __MOD_DEC_USE_COUNT(sg_template.module); - scsi_generics[dev].exclude=0; - wake_up(&scsi_generics[dev].generic_wait); + sdp->exclude = 0; + wake_up_interruptible(&sdp->generic_wait); return 0; } -static char *sg_malloc(int size) +/* Read back the results of a SCSI command which was sent in a prior + write(). */ +static ssize_t sg_read(struct file * filp, char * buf, + size_t count, loff_t *ppos) { - if (size<=4096) - return (char *) scsi_malloc(size); -#ifdef SG_BIG_BUFF - if (size<=SG_BIG_BUFF) - { - while(big_inuse) - { - interruptible_sleep_on(&big_wait); - if (signal_pending(current)) - return NULL; - } - big_inuse=1; - return big_buff; + int k; + Sg_device * sdp; + Sg_fd * sfp; + Sg_request * srp; + int req_pack_id = -1; + struct sg_header * shp = (struct sg_header *)buf; + + if ((! (sfp = (Sg_fd *)filp->private_data)) || (! (sdp = sfp->parentdp))) + return -ENXIO; + SCSI_LOG_TIMEOUT(3, printk("sg_read: dev=%d, count=%d\n", + MINOR(sdp->i_rdev), (int)count)); + + /* If we are in the middle of error recovery, don't let anyone + * else try and use this device. Also, if error recovery fails, it + * may try and take the device offline, in which case all further + * access to the device is prohibited. */ + if(! scsi_block_when_processing_errors(sdp->device)) + return -ENXIO; + + if (ppos != &filp->f_pos) + ; /* FIXME: Hmm. Seek to the right place, or fail? */ + if ((k = verify_area(VERIFY_WRITE, buf, count))) + return k; + if (sfp->force_packid && (count >= size_sg_header)) + req_pack_id = shp->pack_id; + srp = sg_get_request(sfp, req_pack_id); + while(! srp) { + if (filp->f_flags & O_NONBLOCK) + return -EAGAIN; + interruptible_sleep_on(&sfp->read_wait); + if (signal_pending(current)) + return -ERESTARTSYS; + srp = sg_get_request(sfp, req_pack_id); } -#endif - return NULL; -} + srp->header.pack_len = srp->header.reply_len; /* Why ????? */ -static void sg_free(char *buff,int size) -{ -#ifdef SG_BIG_BUFF - if (buff==big_buff) - { - big_inuse=0; - wake_up(&big_wait); - return; + /* Now copy the result back to the user buffer. */ + if (count >= size_sg_header) { + copy_to_user(buf, &srp->header, size_sg_header); + buf += size_sg_header; + if (count > srp->header.reply_len) + count = srp->header.reply_len; + if (count > size_sg_header) /* release does copy_to_user */ + sg_sc_undo_rem(srp, buf, count - size_sg_header); + else + sg_sc_undo_rem(srp, NULL, 0); } -#endif - scsi_free(buff,size); + else { + count = (srp->header.result == 0) ? 0 : -EIO; + sg_sc_undo_rem(srp, NULL, 0); + } + return count; } -/* - * Read back the results of a previous command. We use the pending and - * complete semaphores to tell us whether the buffer is available for us - * and whether the command is actually done. - */ -static ssize_t sg_read(struct file *filp, char *buf, - size_t count, loff_t *ppos) +static ssize_t sg_write(struct file * filp, const char * buf, + size_t count, loff_t *ppos) { - struct inode *inode = filp->f_dentry->d_inode; - int dev=MINOR(inode->i_rdev); - int i; - struct scsi_generic *device=&scsi_generics[dev]; + unsigned long flags; + int mxsize, cmd_size, k; + unsigned char cmnd[MAX_COMMAND_SIZE]; + int input_size; + unsigned char opcode; + Scsi_Cmnd * SCpnt; + Sg_device * sdp; + Sg_fd * sfp; + Sg_request * srp; - /* - * If we are in the middle of error recovery, don't let anyone - * else try and use this device. Also, if error recovery fails, it - * may try and take the device offline, in which case all further - * access to the device is prohibited. - */ - if( !scsi_block_when_processing_errors(scsi_generics[dev].device) ) - { + if ((! (sfp = (Sg_fd *)filp->private_data)) || (! (sdp = sfp->parentdp))) return -ENXIO; - } + SCSI_LOG_TIMEOUT(3, printk("sg_write: dev=%d, count=%d\n", + MINOR(sdp->i_rdev), (int)count)); - if (ppos != &filp->f_pos) { - /* FIXME: Hmm. Seek to the right place, or fail? */ +/* If we are in the middle of error recovery, don't let anyone + * else try and use this device. Also, if error recovery fails, it + * may try and take the device offline, in which case all further + * access to the device is prohibited. */ + if(! scsi_block_when_processing_errors(sdp->device) ) + return -ENXIO; + + if (ppos != &filp->f_pos) + ; /* FIXME: Hmm. Seek to the right place, or fail? */ + + if ((k = verify_area(VERIFY_READ, buf, count))) + return k; +/* The minimum scsi command length is 6 bytes. If we get anything + * less than this, it is clearly bogus. */ + if (count < (size_sg_header + 6)) + return -EIO; + + srp = sg_add_request(sfp); + if (! srp) { + SCSI_LOG_TIMEOUT(1, printk("sg_write: queue full, domain error\n")); + return -EDOM; + } + copy_from_user(&srp->header, buf, size_sg_header); + buf += size_sg_header; + srp->header.pack_len = count; + get_user(opcode, buf); + cmd_size = COMMAND_SIZE(opcode); + if ((opcode >= 0xc0) && srp->header.twelve_byte) + cmd_size = 12; + SCSI_LOG_TIMEOUT(4, printk("sg_write: scsi opcode=0x%02x, cmd_size=%d\n", + (int)opcode, cmd_size)); +/* Determine buffer size. */ + input_size = count - cmd_size; + mxsize = (input_size > srp->header.reply_len) ? input_size : + srp->header.reply_len; +/* Don't include the command header itself in the size. */ + mxsize -= size_sg_header; + input_size -= size_sg_header; +/* Verify user has actually passed enough bytes for this command. */ + if (input_size < 0) { + sg_sc_undo_rem(srp, NULL, 0); + return -EIO; } - if ((i=verify_area(VERIFY_WRITE,buf,count))) - return i; +/* If we cannot allocate the buffer, report an error. */ + if ((k = sg_sc_build(srp, mxsize, buf + cmd_size, input_size))) { + SCSI_LOG_TIMEOUT(1, printk("sg_write: build err=%d\n", k)); + sg_sc_undo_rem(srp, NULL, 0); + return k; + } - /* - * Wait until the command is actually done. - */ - while(!device->pending || !device->complete) - { - if (filp->f_flags & O_NONBLOCK) - { - return -EAGAIN; - } - interruptible_sleep_on(&device->read_wait); - if (signal_pending(current)) - { - return -ERESTARTSYS; - } - } - - /* - * Now copy the result back to the user buffer. - */ - device->header.pack_len=device->header.reply_len; +/* SCSI_LOG_TIMEOUT(7, printk("sg_write: allocating device\n")); */ +/* Grab a command pointer for the device we want to talk to. If we + * don't want to block, just return with the appropriate message. */ + if (! (SCpnt = scsi_allocate_device(NULL, sdp->device, + !(filp->f_flags & O_NONBLOCK)))) { + sg_sc_undo_rem(srp, NULL, 0); + return -EAGAIN; + } +/* SCSI_LOG_TIMEOUT(7, printk("sg_write: device allocated\n")); */ + + srp->my_cmdp = SCpnt; + SCpnt->request.rq_dev = sdp->i_rdev; + SCpnt->request.rq_status = RQ_ACTIVE; + SCpnt->sense_buffer[0] = 0; + SCpnt->cmd_len = cmd_size; + /* Now copy the SCSI command from the user's address space. */ + copy_from_user(cmnd, buf, cmd_size); + +/* Set the LUN field in the command structure. */ + cmnd[1]= (cmnd[1] & 0x1f) | (sdp->device->lun << 5); +/* SCSI_LOG_TIMEOUT(7, printk("sg_write: do cmd\n")); */ +/* Now pass the actual command down to the low-level driver. We + * do not do any more here - when the interrupt arrives, we will + * then do the post-processing. */ + spin_lock_irqsave(&io_request_lock, flags); + SCpnt->use_sg = srp->data.use_sg; + SCpnt->sglist_len = srp->data.sglist_len; + SCpnt->bufflen = srp->data.bufflen; + SCpnt->underflow = srp->data.bufflen; +/* Not many drivers look at this: + aic7xxx driver gives DID_RETRY_COMMAND on underrun + seagate comments out its underrun checking code, and the rest ... +*/ + SCpnt->buffer = srp->data.buffer; + srp->data.use_sg = 0; + srp->data.sglist_len = 0; + srp->data.bufflen = 0; + srp->data.buffer = NULL; + scsi_do_cmd(SCpnt, (void *)cmnd, + (void *)SCpnt->buffer, mxsize, + sg_command_done, sfp->timeout, SG_DEFAULT_RETRIES); + /* 'mxsize' overwrites SCpnt->bufflen, hence need for b_malloc_len */ + spin_unlock_irqrestore(&io_request_lock, flags); +/* SCSI_LOG_TIMEOUT(6, printk("sg_write: sent scsi cmd to mid-level\n")); */ + return count; +} - if (count>=sizeof(struct sg_header)) +static int sg_ioctl(struct inode * inode, struct file * filp, + unsigned int cmd_in, unsigned long arg) +{ + int result, val; + Sg_device * sdp; + Sg_fd * sfp; + Sg_request * srp; + + if ((! (sfp = (Sg_fd *)filp->private_data)) || (! (sdp = sfp->parentdp))) + return -ENXIO; + SCSI_LOG_TIMEOUT(3, printk("sg_ioctl: dev=%d, cmd=0x%x\n", + MINOR(sdp->i_rdev), (int)cmd_in)); + /* If we are in the middle of error recovery, then don't allow any + * access to this device. Also, error recovery *may* have taken the + * device offline, in which case all further access is prohibited. */ + if(! scsi_block_when_processing_errors(sdp->device) ) + return -ENXIO; + + switch(cmd_in) { - copy_to_user(buf,&device->header,sizeof(struct sg_header)); - buf+=sizeof(struct sg_header); - if (count>device->header.pack_len) - count=device->header.pack_len; - if (count > sizeof(struct sg_header)) { - copy_to_user(buf,device->buff,count-sizeof(struct sg_header)); - } + case SG_SET_TIMEOUT: + result = verify_area(VERIFY_READ, (const void *)arg, sizeof(int)); + if (result) return result; + return get_user(sfp->timeout, (int *)arg); + case SG_GET_TIMEOUT: + return sfp->timeout; /* strange ..., for backward compatibility */ + case SG_SET_FORCE_LOW_DMA: + result = verify_area(VERIFY_READ, (const void *)arg, sizeof(int)); + if (result) return result; + result = get_user(val, (int *)arg); + if (result) return result; + if (val) { + if ((0 == sfp->low_dma) && (0 == sg_fb_in_use(sfp))) { + sg_low_free(sfp->fst_buf, sfp->fb_size, SG_HEAP_PAGE); + sfp->fst_buf = sg_low_malloc(SG_SCATTER_SZ, 1, + SG_HEAP_PAGE, &sfp->fb_size); + } + sfp->low_dma = 1; + if (! sfp->fst_buf) + return -ENOMEM; + } + else + sfp->low_dma = sdp->device->host->unchecked_isa_dma; + return 0; + case SG_GET_LOW_DMA: + result = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int)); + if (result) return result; + put_user((int)sfp->low_dma, (int *)arg); + return 0; + case SG_GET_SCSI_ID: + result = verify_area(VERIFY_WRITE, (void *)arg, sizeof(Sg_scsi_id)); + if (result) return result; + else { + Sg_scsi_id * sg_idp = (Sg_scsi_id *)arg; + put_user((int)sdp->device->host->host_no, &sg_idp->host_no); + put_user((int)sdp->device->channel, &sg_idp->channel); + put_user((int)sdp->device->id, &sg_idp->scsi_id); + put_user((int)sdp->device->lun, &sg_idp->lun); + put_user((int)sdp->device->type, &sg_idp->scsi_type); + put_user(0, &sg_idp->unused1); + put_user(0, &sg_idp->unused2); + put_user(0, &sg_idp->unused3); + return 0; + } + case SG_SET_FORCE_PACK_ID: + result = verify_area(VERIFY_READ, (const void *)arg, sizeof(int)); + if (result) return result; + result = get_user(val, (int *)arg); + if (result) return result; + sfp->force_packid = val ? 1 : 0; + return 0; + case SG_GET_PACK_ID: + result = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int)); + if (result) return result; + srp = sfp->headrp; + while (srp) { + if (! srp->my_cmdp) { + put_user(srp->header.pack_id, (int *)arg); + return 0; + } + srp = srp->nextrp; + } + put_user(-1, (int *)arg); + return 0; + case SG_GET_NUM_WAITING: + result = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int)); + if (result) return result; + srp = sfp->headrp; + val = 0; + while (srp) { + if (! srp->my_cmdp) + ++val; + srp = srp->nextrp; + } + put_user(val, (int *)arg); + return 0; + case SG_GET_SG_TABLESIZE: + result = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int)); + if (result) return result; + put_user(sdp->sg_tablesize, (int *)arg); + return 0; + case SG_SET_RESERVED_SIZE: + /* currently ignored, future extension */ + if (O_RDWR != (filp->f_flags & O_ACCMODE)) + return -EACCES; + result = verify_area(VERIFY_READ, (const void *)arg, sizeof(int)); + if (result) return result; + return 0; + case SG_GET_RESERVED_SIZE: + result = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int)); + if (result) return result; + put_user(sfp->fb_size, (int *)arg); + return 0; + case SG_GET_MERGE_FD: + result = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int)); + if (result) return result; + put_user((int)sdp->merge_fd, (int *)arg); + return 0; + case SG_SET_MERGE_FD: + if (O_RDWR != (filp->f_flags & O_ACCMODE)) + return -EACCES; /* require write access since effect wider + then just this fd */ + result = verify_area(VERIFY_READ, (const void *)arg, sizeof(int)); + if (result) return result; + result = get_user(val, (int *)arg); + if (result) return result; + val = val ? 1 : 0; + if ((val ^ (0 != sdp->merge_fd)) && + sdp->headfp && sdp->headfp->nextfp) + return -EBUSY; /* too much work if multiple fds already */ + sdp->merge_fd = val; + return 0; + case SG_SET_COMMAND_Q: + result = verify_area(VERIFY_READ, (const void *)arg, sizeof(int)); + if (result) return result; + result = get_user(val, (int *)arg); + if (result) return result; + sfp->cmd_q = val ? 1 : 0; + return 0; + case SG_GET_COMMAND_Q: + result = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int)); + if (result) return result; + put_user((int)sfp->cmd_q, (int *)arg); + return 0; + case SG_EMULATED_HOST: + return put_user(sdp->device->host->hostt->emulated, (int *)arg); + case SCSI_IOCTL_SEND_COMMAND: + /* Allow SCSI_IOCTL_SEND_COMMAND without checking suser() since the + user already has read/write access to the generic device and so + can execute arbitrary SCSI commands. */ + if (O_RDWR != (filp->f_flags & O_ACCMODE)) + return -EACCES; /* require write access since these could be + dangerous */ + return scsi_ioctl_send_command(sdp->device, (void *)arg); + case SG_SET_DEBUG: + result = verify_area(VERIFY_READ, (const void *)arg, sizeof(int)); + if (result) return result; + result = get_user(val, (int *)arg); + if (result) return result; + sdp->sgdebug = (char)val; + if (9 == sdp->sgdebug) + sg_debug(sdp, sfp, 0); + else if (sdp->sgdebug > 9) + sg_debug_all(sfp); + return 0; + case SCSI_IOCTL_GET_IDLUN: + case SCSI_IOCTL_GET_BUS_NUMBER: + return scsi_ioctl(sdp->device, cmd_in, (void *)arg); + default: + if (O_RDWR != (filp->f_flags & O_ACCMODE)) + return -EACCES; /* require write access since these could be + dangerous */ + return scsi_ioctl(sdp->device, cmd_in, (void *)arg); } - else - count= device->header.result==0 ? 0 : -EIO; +} - /* - * Clean up, and release the device so that we can send another - * command. - */ - sg_free(device->buff,device->buff_len); - device->buff = NULL; - device->pending=0; - wake_up(&device->write_wait); - return count; +static unsigned int sg_poll(struct file * filp, poll_table * wait) +{ + unsigned int res = 0; + Sg_device * sdp; + Sg_fd * sfp; + Sg_request * srp; + int count = 0; + + if ((! (sfp = (Sg_fd *)filp->private_data)) || (! (sdp = sfp->parentdp))) + return POLLERR; + poll_wait(filp, &sfp->read_wait, wait); + srp = sfp->headrp; + while (srp) { /* if any read waiting, flag it */ + if (! (res || srp->my_cmdp)) + res = POLLIN | POLLRDNORM; + ++count; + srp = srp->nextrp; + } + if (0 == sfp->cmd_q) { + if (0 == count) + res |= POLLOUT | POLLWRNORM; + } + else if (count < SG_MAX_QUEUE) + res |= POLLOUT | POLLWRNORM; + SCSI_LOG_TIMEOUT(3, printk("sg_poll: dev=%d, res=0x%x\n", + MINOR(sdp->i_rdev), (int)res)); + return res; } -/* - * This function is called by the interrupt handler when we +static int sg_fasync(int fd, struct file * filp, int mode) +{ + int retval; + Sg_device * sdp; + Sg_fd * sfp; + + if ((! (sfp = (Sg_fd *)filp->private_data)) || (! (sdp = sfp->parentdp))) + return -ENXIO; + SCSI_LOG_TIMEOUT(3, printk("sg_fasync: dev=%d, mode=%d\n", + MINOR(sdp->i_rdev), mode)); + + retval = fasync_helper(fd, filp, mode, &sfp->async_qp); + return (retval < 0) ? retval : 0; +} + +/* This function is called by the interrupt handler when we * actually have a command that is complete. Change the - * flags to indicate that we have a result. - */ + * flags to indicate that we have a result. */ static void sg_command_done(Scsi_Cmnd * SCpnt) { int dev = MINOR(SCpnt->request.rq_dev); - struct scsi_generic *device = &scsi_generics[dev]; - if (!device->pending) - { - printk("unexpected done for sg %d\n",dev); + Sg_device * sdp; + Sg_fd * sfp; + Sg_request * srp = NULL; + int closed = 0; + + if ((NULL == sg_dev_arr) || (dev < 0) || (dev >= sg_template.dev_max)) { + SCSI_LOG_TIMEOUT(1, printk("sg__done: bad args dev=%d\n", dev)); scsi_release_command(SCpnt); SCpnt = NULL; - return; + return; } - - /* - * See if the command completed normally, or whether something went - * wrong. - */ - memcpy(device->header.sense_buffer, SCpnt->sense_buffer, - sizeof(SCpnt->sense_buffer)); - switch (host_byte(SCpnt->result)) { + sdp = &sg_dev_arr[dev]; + if (NULL == sdp->device) + return; /* Get out of here quick ... */ + sfp = sdp->headfp; + while (sfp) { + srp = sfp->headrp; + while (srp) { + if (SCpnt == srp->my_cmdp) + break; + srp = srp->nextrp; + } + if (srp) + break; + sfp = sfp->nextfp; + } + if (! srp) { + SCSI_LOG_TIMEOUT(1, printk("sg__done: req missing, dev=%d\n", dev)); + scsi_release_command(SCpnt); + SCpnt = NULL; + return; + } +/* First transfer ownership of data buffers to sg_device object. */ + srp->data.use_sg = SCpnt->use_sg; + srp->data.sglist_len = SCpnt->sglist_len; + srp->data.bufflen = SCpnt->bufflen; + srp->data.buffer = SCpnt->buffer; + sg_clr_scpnt(SCpnt); + srp->my_cmdp = NULL; + + SCSI_LOG_TIMEOUT(4, + printk("sg__done: dev=%d, scsi_stat=%d, res=0x%x\n", + dev, (int)status_byte(SCpnt->result), (int)SCpnt->result)); +/* See if the command completed normally, or whether something went wrong. */ + memcpy(srp->header.sense_buffer, SCpnt->sense_buffer, + sizeof(SCpnt->sense_buffer)); + switch (host_byte(SCpnt->result)) + { case DID_OK: - device->header.result = 0; + case DID_PASSTHROUGH: /* just guessing */ + case DID_SOFT_ERROR: /* just guessing */ + srp->header.result = 0; break; case DID_NO_CONNECT: case DID_BUS_BUSY: case DID_TIME_OUT: - device->header.result = EBUSY; + srp->header.result = EBUSY; break; case DID_BAD_TARGET: case DID_ABORT: case DID_PARITY: case DID_RESET: case DID_BAD_INTR: - device->header.result = EIO; + srp->header.result = EIO; break; case DID_ERROR: - /* - * There really should be DID_UNDERRUN and DID_OVERRUN error values, + /* There really should be DID_UNDERRUN and DID_OVERRUN error values, * and a means for callers of scsi_do_cmd to indicate whether an * underrun or overrun should signal an error. Until that can be * implemented, this kludge allows for returning useful error values * except in cases that return DID_ERROR that might be due to an - * underrun. - */ + * underrun. [Underrun on advansys adapter yields DID_ABORT -dpg] */ if (SCpnt->sense_buffer[0] == 0 && - status_byte(SCpnt->result) == GOOD) - device->header.result = 0; - else device->header.result = EIO; + status_byte(SCpnt->result) == GOOD) + srp->header.result = 0; + else + srp->header.result = EIO; break; + default: + SCSI_LOG_TIMEOUT(1, printk( + "sg: unexpected host_byte=%d, dev=%d in 'done'\n", + host_byte(SCpnt->result), dev)); + srp->header.result = EIO; + break; + } + +/* Following if statement is a patch supplied by Eric Youngdale */ + if (driver_byte(SCpnt->result) != 0 + && (SCpnt->sense_buffer[0] & 0x7f) == 0x70 + && (SCpnt->sense_buffer[2] & 0xf) == UNIT_ATTENTION + && sdp->device->removable) { +/* Detected disc change. Set the bit - this may be used if there are */ +/* filesystems using this device. */ + sdp->device->changed = 1; } - /* - * Now wake up the process that is waiting for the - * result. - */ - device->complete=1; +/* Pick up error and status information */ + srp->header.target_status = status_byte(SCpnt->result); + if ((sdp->sgdebug > 0) && + ((CHECK_CONDITION == srp->header.target_status) || + (COMMAND_TERMINATED == srp->header.target_status))) + print_sense("sg_command_done", SCpnt); + srp->header.host_status = host_byte(SCpnt->result); + srp->header.driver_status = driver_byte(SCpnt->result); + scsi_release_command(SCpnt); SCpnt = NULL; - wake_up(&scsi_generics[dev].read_wait); + if (sfp->closed) { /* whoops this fd already released, cleanup */ + closed = 1; + SCSI_LOG_TIMEOUT(1, + printk("sg__done: already closed, freeing ...\n")); +/* should check if module is unloaded <<<<<<< */ + sg_sc_undo_rem(srp, NULL, 0); + if (NULL == sfp->headrp) { + SCSI_LOG_TIMEOUT(1, + printk("sg__done: already closed, final cleanup\n")); + sg_remove_sfp(sdp, sfp); + } + } +/* Now wake up the process that is waiting for the result. */ + /* A. Rubini says this is preferable+faster than wake_up() */ + wake_up_interruptible(&sfp->read_wait); + if ((sfp->async_qp) && (! closed)) + kill_fasync(sfp->async_qp, SIGPOLL); } -static ssize_t sg_write(struct file *filp, const char *buf, - size_t count, loff_t *ppos) +static void sg_debug_all(const Sg_fd * sfp) { - unsigned long flags; - struct inode *inode = filp->f_dentry->d_inode; - int bsize,size,amt,i; - unsigned char cmnd[MAX_COMMAND_SIZE]; - kdev_t devt = inode->i_rdev; - int dev = MINOR(devt); - struct scsi_generic * device=&scsi_generics[dev]; - int input_size; - unsigned char opcode; - Scsi_Cmnd * SCpnt; - - /* - * If we are in the middle of error recovery, don't let anyone - * else try and use this device. Also, if error recovery fails, it - * may try and take the device offline, in which case all further - * access to the device is prohibited. - */ - if( !scsi_block_when_processing_errors(scsi_generics[dev].device) ) - { - return -ENXIO; - } - - if (ppos != &filp->f_pos) { - /* FIXME: Hmm. Seek to the right place, or fail? */ - } - - if ((i=verify_area(VERIFY_READ,buf,count))) - return i; - /* - * The minimum scsi command length is 6 bytes. If we get anything - * less than this, it is clearly bogus. - */ - if (count<(sizeof(struct sg_header) + 6)) - return -EIO; - - /* - * If we still have a result pending from a previous command, - * wait until the result has been read by the user before sending - * another command. - */ - while(device->pending) - { - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; -#ifdef DEBUG - printk("sg_write: sleeping on pending request\n"); + const Sg_device * sdp = sg_dev_arr; + int k; + + if (NULL == sg_dev_arr) { + printk("sg_debug_all: sg_dev_arr NULL, death is imminent\n"); + return; + } + if (! sfp) + printk("sg_debug_all: sfp (file descriptor pointer) NULL\n"); + + printk("sg_debug_all: dev_max=%d, %s\n", + sg_template.dev_max, sg_version_str); + printk(" scsi_dma_free_sectors=%u, sg_pool_secs_aval=%d\n", + scsi_dma_free_sectors, sg_pool_secs_avail); + printk(" sg_big_buff=%d\n", sg_big_buff); +#ifdef SG_DEBUG + printk(" malloc counts, kmallocs=%d, dma_pool=%d, pages=%d\n", + sg_num_kmal, sg_num_pool, sg_num_page); #endif - interruptible_sleep_on(&device->write_wait); - if (signal_pending(current)) - return -ERESTARTSYS; - } - - /* - * Mark the device flags for the new state. - */ - device->pending=1; - device->complete=0; - copy_from_user(&device->header,buf,sizeof(struct sg_header)); - - device->header.pack_len=count; - buf+=sizeof(struct sg_header); - - /* - * Now we need to grab the command itself from the user's buffer. - */ - get_user(opcode, buf); - size=COMMAND_SIZE(opcode); - if (opcode >= 0xc0 && device->header.twelve_byte) size = 12; - - /* - * Determine buffer size. - */ - input_size = device->header.pack_len - size; - if( input_size > device->header.reply_len) - { - bsize = input_size; - } else { - bsize = device->header.reply_len; + for (k = 0; k < sg_template.dev_max; ++k, ++sdp) { + if (sdp->headfp) { + if (! sfp) + sfp = sdp->headfp; /* just to keep things going */ + else if (sdp == sfp->parentdp) + printk(" ***** Invoking device follows *****\n"); + sg_debug(sdp, sfp, 1); + } } +} - /* - * Don't include the command header itself in the size. - */ - bsize-=sizeof(struct sg_header); - input_size-=sizeof(struct sg_header); - - /* - * Verify that the user has actually passed enough bytes for this command. - */ - if( input_size < 0 ) - { - device->pending=0; - wake_up( &device->write_wait ); - return -EIO; - } - - /* - * Allocate a buffer that is large enough to hold the data - * that has been requested. Round up to an even number of sectors, - * since scsi_malloc allocates in chunks of 512 bytes. - */ - amt=bsize; - if (!bsize) - bsize++; - bsize=(bsize+511) & ~511; - - /* - * If we cannot allocate the buffer, report an error. - */ - if ((bsize<0) || !(device->buff=sg_malloc(device->buff_len=bsize))) - { - device->pending=0; - wake_up(&device->write_wait); - return -ENOMEM; +static void sg_debug(const Sg_device * sdp, const Sg_fd * sfp, int part_of) +{ + Sg_fd * fp; + Sg_request * srp; + int dev; + int k; + + if (! sfp) + printk("sg_debug: sfp (file descriptor pointer) NULL\n"); + if (! sdp) { + printk("sg_debug: sdp pointer (to device) NULL\n"); + return; } - -#ifdef DEBUG - printk("allocating device\n"); -#endif - - /* - * Grab a device pointer for the device we want to talk to. If we - * don't want to block, just return with the appropriate message. - */ - if (!(SCpnt=scsi_allocate_device(NULL,device->device, !(filp->f_flags & O_NONBLOCK)))) - { - device->pending=0; - wake_up(&device->write_wait); - sg_free(device->buff,device->buff_len); - device->buff = NULL; - return -EAGAIN; + else if (! sdp->device) { + printk("sg_debug: device detached ??\n"); + return; } -#ifdef DEBUG - printk("device allocated\n"); -#endif - - SCpnt->request.rq_dev = devt; - SCpnt->request.rq_status = RQ_ACTIVE; - SCpnt->sense_buffer[0]=0; - SCpnt->cmd_len = size; - - /* - * Now copy the SCSI command from the user's address space. - */ - copy_from_user(cmnd,buf,size); - buf+=size; - - /* - * If we are writing data, copy the data we are writing. The pack_len - * field also includes the length of the header and the command, - * so we need to subtract these off. - */ - if (input_size > 0) copy_from_user(device->buff, buf, input_size); - - /* - * Set the LUN field in the command structure. - */ - cmnd[1]= (cmnd[1] & 0x1f) | (device->device->lun<<5); - -#ifdef DEBUG - printk("do cmd\n"); -#endif - - /* - * Now pass the actual command down to the low-level driver. We - * do not do any more here - when the interrupt arrives, we will - * then do the post-processing. - */ - spin_lock_irqsave(&io_request_lock, flags); - scsi_do_cmd (SCpnt,(void *) cmnd, - (void *) device->buff,amt, - sg_command_done,device->timeout,SG_DEFAULT_RETRIES); - spin_unlock_irqrestore(&io_request_lock, flags); + dev = MINOR(sdp->i_rdev); -#ifdef DEBUG - printk("done cmd\n"); + if (part_of) + printk(" >>> device=%d(sg%c), ", dev, 'a' + dev); + else + printk("sg_debug: device=%d(sg%c), ", dev, 'a' + dev); + printk("scsi%d chan=%d id=%d lun=%d em=%d\n", sdp->device->host->host_no, + sdp->device->channel, sdp->device->id, sdp->device->lun, + sdp->device->host->hostt->emulated); + printk(" sg_tablesize=%d, excl=%d, sgdebug=%d, merge_fd=%d\n", + sdp->sg_tablesize, sdp->exclude, sdp->sgdebug, sdp->merge_fd); + if (! part_of) { + printk(" scsi_dma_free_sectors=%u, sg_pool_secs_aval=%d\n", + scsi_dma_free_sectors, sg_pool_secs_avail); +#ifdef SG_DEBUG + printk(" mallocs: kmallocs=%d, dma_pool=%d, pages=%d\n", + sg_num_kmal, sg_num_pool, sg_num_page); #endif + } - return count; -} - -static unsigned int sg_poll(struct file *file, poll_table * wait) -{ - int dev = MINOR(file->f_dentry->d_inode->i_rdev); - struct scsi_generic *device = &scsi_generics[dev]; - unsigned int mask = 0; - - poll_wait(file, &scsi_generics[dev].read_wait, wait); - poll_wait(file, &scsi_generics[dev].write_wait, wait); - if(device->pending && device->complete) - mask |= POLLIN | POLLRDNORM; - if(!device->pending) - mask |= POLLOUT | POLLWRNORM; - - return mask; + fp = sdp->headfp; + for (k = 1; fp; fp = fp->nextfp, ++k) { + if (sfp == fp) + printk(" *** Following data belongs to invoking FD ***\n"); + else if (! fp->parentdp) + printk(">> Following FD has NULL parent pointer ???\n"); + printk(" FD(%d): timeout=%d, fb_size=%d, cmd_q=%d\n", + k, fp->timeout, fp->fb_size, (int)fp->cmd_q); + printk(" low_dma=%d, force_packid=%d, closed=%d\n", + (int)fp->low_dma, (int)fp->force_packid, (int)fp->closed); + srp = fp->headrp; + if (NULL == srp) + printk(" No requests active\n"); + while (srp) { + if (srp->fb_used) + printk("using 1st buff >> "); + else + printk(" "); + if (srp->my_cmdp) + printk("written: pack_id=%d, bufflen=%d, use_sg=%d\n", + srp->header.pack_id, srp->my_cmdp->bufflen, + srp->my_cmdp->use_sg); + else + printk("to_read: pack_id=%d, bufflen=%d, use_sg=%d\n", + srp->header.pack_id, srp->data.bufflen, srp->data.use_sg); + if (! srp->parentfp) + printk(">> request has NULL parent pointer ???\n"); + srp = srp->nextrp; + } + } } static struct file_operations sg_fops = { @@ -574,24 +920,30 @@ sg_ioctl, /* ioctl */ NULL, /* mmap */ sg_open, /* open */ - NULL, /* flush */ - sg_close, /* release */ - NULL /* fsync */ + NULL, /* flush */ + sg_release, /* release, was formerly sg_close */ + NULL, /* fsync */ + sg_fasync, /* fasync */ + NULL, /* check_media_change */ + NULL, /* revalidate */ + NULL, /* lock */ }; -static int sg_detect(Scsi_Device * SDp){ - - switch (SDp->type) { - case TYPE_DISK: - case TYPE_MOD: - case TYPE_ROM: - case TYPE_WORM: - case TYPE_TAPE: break; - default: - printk("Detected scsi generic sg%c at scsi%d, channel %d, id %d, lun %d\n", - 'a'+sg_template.dev_noticed, - SDp->host->host_no, SDp->channel, SDp->id, SDp->lun); +static int sg_detect(Scsi_Device * scsidp) +{ + switch (scsidp->type) { + case TYPE_DISK: + case TYPE_MOD: + case TYPE_ROM: + case TYPE_WORM: + case TYPE_TAPE: break; + default: + printk("Detected scsi generic sg%c at scsi%d," + " channel %d, id %d, lun %d\n", + 'a'+sg_template.dev_noticed, + scsidp->host->host_no, scsidp->channel, + scsidp->id, scsidp->lun); } sg_template.dev_noticed++; return 1; @@ -605,84 +957,108 @@ if (sg_template.dev_noticed == 0) return 0; if(!sg_registered) { - if (register_chrdev(SCSI_GENERIC_MAJOR,"sg",&sg_fops)) - { - printk("Unable to get major %d for generic SCSI device\n", - SCSI_GENERIC_MAJOR); - return 1; - } - sg_registered++; + if (register_chrdev(SCSI_GENERIC_MAJOR,"sg",&sg_fops)) + { + printk("Unable to get major %d for generic SCSI device\n", + SCSI_GENERIC_MAJOR); + return 1; + } + sg_registered++; } /* If we have already been through here, return */ - if(scsi_generics) return 0; - -#ifdef DEBUG - printk("sg: Init generic device.\n"); -#endif - -#ifdef SG_BIG_BUFF - big_buff= (char *) scsi_init_malloc(SG_BIG_BUFF, GFP_ATOMIC | GFP_DMA); -#endif - - scsi_generics = (struct scsi_generic *) - scsi_init_malloc((sg_template.dev_noticed + SG_EXTRA_DEVS) - * sizeof(struct scsi_generic), GFP_ATOMIC); - memset(scsi_generics, 0, (sg_template.dev_noticed + SG_EXTRA_DEVS) - * sizeof(struct scsi_generic)); + if(sg_dev_arr) return 0; + SCSI_LOG_TIMEOUT(3, printk("sg_init\n")); + sg_dev_arr = (Sg_device *) + scsi_init_malloc((sg_template.dev_noticed + SG_EXTRA_DEVS) + * sizeof(Sg_device), GFP_ATOMIC); + if (NULL == sg_dev_arr) { + printk("sg_init: no space for sg_dev_arr\n"); + return 1; + } sg_template.dev_max = sg_template.dev_noticed + SG_EXTRA_DEVS; return 0; } -static int sg_attach(Scsi_Device * SDp) +static int sg_attach(Scsi_Device * scsidp) { - struct scsi_generic * gpnt; - int i; + Sg_device * sdp = sg_dev_arr; + int k; - if(sg_template.nr_dev >= sg_template.dev_max) + if ((sg_template.nr_dev >= sg_template.dev_max) || (! sdp)) { - SDp->attached--; - return 1; + scsidp->attached--; + return 1; } - for(gpnt = scsi_generics, i=0; idevice) break; + for(k = 0; k < sg_template.dev_max; k++, sdp++) + if(! sdp->device) break; - if(i >= sg_template.dev_max) panic ("scsi_devices corrupt (sg)"); + if(k >= sg_template.dev_max) panic ("scsi_devices corrupt (sg)"); - scsi_generics[i].device=SDp; - scsi_generics[i].users=0; - scsi_generics[i].generic_wait=NULL; - scsi_generics[i].read_wait=NULL; - scsi_generics[i].write_wait=NULL; - scsi_generics[i].buff=NULL; - scsi_generics[i].exclude=0; - scsi_generics[i].pending=0; - scsi_generics[i].timeout=SG_DEFAULT_TIMEOUT; + SCSI_LOG_TIMEOUT(3, printk("sg_attach: dev=%d \n", k)); + sdp->device = scsidp; + sdp->generic_wait = NULL; + sdp->headfp= NULL; + sdp->exclude = 0; + sdp->merge_fd = 0; + sdp->sgdebug = 0; + sdp->sg_tablesize = scsidp->host ? scsidp->host->sg_tablesize : 0; + sdp->i_rdev = MKDEV(SCSI_GENERIC_MAJOR, k); sg_template.nr_dev++; return 0; -}; - - +} -static void sg_detach(Scsi_Device * SDp) +/* Called at 'finish' of init process, after all attaches */ +static void sg_finish(void) { - struct scsi_generic * gpnt; - int i; + SCSI_LOG_TIMEOUT(3, printk("sg_finish: dma_free_sectors=%u\n", + scsi_dma_free_sectors)); +} - for(gpnt = scsi_generics, i=0; idevice == SDp) { - gpnt->device = NULL; - SDp->attached--; - sg_template.nr_dev--; - /* - * avoid associated device /dev/sg? bying incremented - * each time module is inserted/removed , - */ - sg_template.dev_noticed--; - return; - } +static void sg_detach(Scsi_Device * scsidp) +{ + Sg_device * sdp = sg_dev_arr; + unsigned long flags = 0; + Sg_fd * sfp; + Sg_request * srp; + int k; + + if (NULL == sdp) return; /* all is not well ... */ + for (k = 0; k < sg_template.dev_max; k++, sdp++) { + if(sdp->device != scsidp) + continue; /* dirty but lowers nesting */ + if (sdp->headfp) { +/* Need to stop sg_command_done() playing with this list during this loop */ + spin_lock_irqsave(&io_request_lock, flags); + sfp = sdp->headfp; + while (sfp) { + srp = sfp->headrp; + while (srp) { + if (srp->my_cmdp) + sg_shorten_timeout(srp->my_cmdp); + srp = srp->nextrp; + } + sfp = sfp->nextfp; + } + spin_unlock_irqrestore(&io_request_lock, flags); + SCSI_LOG_TIMEOUT(3, printk("sg_detach: dev=%d, dirty, sleep(3)\n", k)); + scsi_sleep(3); /* sleep 3 jiffies, hoping for timeout to go off */ + } + else { + SCSI_LOG_TIMEOUT(3, printk("sg_detach: dev=%d\n", k)); + sdp->device = NULL; + } + scsidp->attached--; + sg_template.nr_dev--; + /* + * avoid associated device /dev/sg? bying incremented + * each time module is inserted/removed , + */ + sg_template.dev_noticed--; + return; + } return; } @@ -698,34 +1074,555 @@ scsi_unregister_module(MODULE_SCSI_DEV, &sg_template); unregister_chrdev(SCSI_GENERIC_MAJOR, "sg"); - if(scsi_generics != NULL) { - scsi_init_free((char *) scsi_generics, - (sg_template.dev_noticed + SG_EXTRA_DEVS) - * sizeof(struct scsi_generic)); + if(sg_dev_arr != NULL) { +/* Really worrying situation of writes still pending and get here */ +/* Strategy: shorten timeout on release + wait on detach ... */ + scsi_init_free((char *) sg_dev_arr, + (sg_template.dev_noticed + SG_EXTRA_DEVS) + * sizeof(Sg_device)); + sg_dev_arr = NULL; } sg_template.dev_max = 0; -#ifdef SG_BIG_BUFF - if(big_buff != NULL) - scsi_init_free(big_buff, SG_BIG_BUFF); -#endif } #endif /* MODULE */ -/* - * Overrides for Emacs so that we almost 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: - */ + +#if 0 +extern void scsi_times_out (Scsi_Cmnd * SCpnt); +extern void scsi_old_times_out (Scsi_Cmnd * SCpnt); +#endif + +/* Can't see clean way to abort a command so shorten timeout to 1 jiffy */ +static void sg_shorten_timeout(Scsi_Cmnd * scpnt) +{ +#if 0 /* scsi_syms.c is very miserly about exported functions */ + scsi_delete_timer(scpnt); + if (! scpnt) + return; + scpnt->timeout_per_command = 1; /* try 1 jiffy (perhaps 0 jiffies) */ + if (scpnt->host->hostt->use_new_eh_code) + scsi_add_timer(scpnt, scpnt->timeout_per_command, scsi_times_out); + else + scsi_add_timer(scpnt, scpnt->timeout_per_command, + scsi_old_times_out); +#else + scsi_sleep(HZ); /* just sleep 1 second and hope ... */ +#endif +} + +static int sg_sc_build(Sg_request * srp, int max_buff_size, + const char * inp, int num_write_xfer) +{ + int ret_sz, mem_src; + int blk_size = max_buff_size; + char * p = NULL; + + if ((blk_size < 0) || (! srp)) + return -EFAULT; + + SCSI_LOG_TIMEOUT(4, printk("sg build: m_b_s=%d, num_write_xfer=%d\n", + max_buff_size, num_write_xfer)); + if (0 == blk_size) + ++blk_size; /* don't know why */ +/* round request up to next highest SG_SECTOR_SZ byte boundary */ + blk_size = (blk_size + SG_SECTOR_MSK) & (~SG_SECTOR_MSK); + SCSI_LOG_TIMEOUT(5, printk("sg_sc_build: blk_size=%d\n", blk_size)); + + if (blk_size <= SG_SCATTER_SZ) { + mem_src = SG_HEAP_FB; + p = sg_malloc(srp, blk_size, &ret_sz, &mem_src); + if (! p) + return -ENOMEM; + if (blk_size == ret_sz) { /* got it on the first attempt */ + srp->data.buffer = p; + srp->data.bufflen = blk_size; + srp->data.mem_src = mem_src; + srp->data.b_malloc_len = blk_size; + if (inp && (num_write_xfer > 0)) + copy_from_user(srp->data.buffer, inp, num_write_xfer); + return 0; + } + } + else { + mem_src = SG_HEAP_PAGE; + p = sg_malloc(srp, SG_SCATTER_SZ, &ret_sz, &mem_src); + if (! p) + return -ENOMEM; + } +/* Want some local declarations, so start new block ... */ + { /* lets try and build a scatter gather list */ + struct scatterlist * sclp; + int k, rem_sz, num, nxt; + int sc_bufflen = PAGE_SIZE; + int mx_sc_elems = (sc_bufflen / sizeof(struct scatterlist)) - 1; + int sg_tablesize = srp->parentfp->parentdp->sg_tablesize; + int first = 1; + + k = SG_HEAP_KMAL; /* want to protect mem_src, use k as scratch */ + srp->data.buffer = (struct scatterlist *)sg_malloc(srp, + sc_bufflen, &num, &k); + srp->data.mem_src = (char)k; + /* N.B. ret_sz and mem_src carried into this block ... */ + if (! srp->data.buffer) + return -ENOMEM; + else if (num != sc_bufflen) { + sc_bufflen = num; + mx_sc_elems = (sc_bufflen / sizeof(struct scatterlist)) - 1; + } + srp->data.sglist_len = sc_bufflen; + memset(srp->data.buffer, 0, sc_bufflen); + for (k = 0, sclp = srp->data.buffer, rem_sz = blk_size, nxt =0; + (k < sg_tablesize) && (rem_sz > 0) && (k < mx_sc_elems); + ++k, rem_sz -= ret_sz, ++sclp) { + if (first) + first = 0; + else { + num = (rem_sz > SG_SCATTER_SZ) ? SG_SCATTER_SZ : rem_sz; + mem_src = SG_HEAP_PAGE; + p = sg_malloc(srp, num, &ret_sz, &mem_src); + if (! p) + break; + } + sclp->address = p; + sclp->length = ret_sz; + sclp->alt_address = (char *)mem_src; + + if(inp && (num_write_xfer > 0)) { + num = (ret_sz > num_write_xfer) ? num_write_xfer : ret_sz; + copy_from_user(sclp->address, inp, num); + num_write_xfer -= num; + inp += num; + } + SCSI_LOG_TIMEOUT(5, + printk("sg_sc_build: k=%d, a=0x%x, len=%d, ms=%d\n", + k, (int)sclp->address, ret_sz, (int)sclp->alt_address)); + } /* end of for loop */ + srp->data.use_sg = k; + SCSI_LOG_TIMEOUT(5, + printk("sg_sc_build: use_sg=%d, rem_sz=%d\n", k, rem_sz)); + srp->data.bufflen = blk_size; + if (rem_sz > 0) /* must have failed */ + return -ENOMEM; + } + return 0; +} + +static int sg_sc_undo_rem(Sg_request * srp, char * outp, + int num_read_xfer) +{ + if (! srp) + return -EFAULT; + SCSI_LOG_TIMEOUT(4, printk("sg_sc_undo_rem: num_read_xfer=%d\n", + num_read_xfer)); + if (! outp) + num_read_xfer = 0; + if(srp->data.use_sg) { + int k, num, mem_src; + struct scatterlist * sclp = (struct scatterlist *)srp->data.buffer; + + for (k = 0; (k < srp->data.use_sg) && sclp->address; ++k, ++sclp) { + if (num_read_xfer > 0) { + num = (int)sclp->length; + if (num > num_read_xfer) { + copy_to_user(outp, sclp->address, num_read_xfer); + outp += num_read_xfer; + num_read_xfer = 0; + } + else { + copy_to_user(outp, sclp->address, num); + outp += num; + num_read_xfer -= num; + } + } + mem_src = (int)sclp->alt_address; + SCSI_LOG_TIMEOUT(5, + printk("sg_sc_undo_rem: k=%d, a=0x%x, len=%d, ms=%d\n", + k, (int)sclp->address, sclp->length, mem_src)); + sg_free(srp, sclp->address, sclp->length, mem_src); + } + sg_free(srp, srp->data.buffer, srp->data.sglist_len, + srp->data.mem_src); + } + else { + if (num_read_xfer > 0) + copy_to_user(outp, srp->data.buffer, num_read_xfer); + sg_free(srp, srp->data.buffer, srp->data.b_malloc_len, + srp->data.mem_src); + } + if (0 == sg_remove_request(srp->parentfp, srp)) { + SCSI_LOG_TIMEOUT(1, printk("sg_sc_undo_rem: srp=%d not found\n", + (int)srp)); + } + return 0; +} + +static Sg_request * sg_get_request(const Sg_fd * sfp, int pack_id) +{ + Sg_request * resp = NULL; + + resp = sfp->headrp; + while (resp) { + if ((! resp->my_cmdp) && + ((-1 == pack_id) || (resp->header.pack_id == pack_id))) + return resp; + resp = resp->nextrp; + } + return resp; +} + +/* always adds to end of list */ +static Sg_request * sg_add_request(Sg_fd * sfp) +{ + int k; + Sg_request * resp = NULL; + Sg_request * rp; + + resp = sfp->headrp; + rp = sfp->req_arr; + if (! resp) { + resp = rp; + sfp->headrp = resp; + } + else { + if (0 == sfp->cmd_q) + resp = NULL; /* command queuing disallowed */ + else { + for (k = 0, rp; k < SG_MAX_QUEUE; ++k, ++rp) { + if (! rp->parentfp) + break; + } + if (k < SG_MAX_QUEUE) { + while (resp->nextrp) resp = resp->nextrp; + resp->nextrp = rp; + resp = rp; + } + else + resp = NULL; + } + } + if (resp) { + resp->parentfp = sfp; + resp->nextrp = NULL; + resp->fb_used = 0; + memset(&resp->data, 0, sizeof(Sg_scatter_hold)); + memset(&resp->header, 0, sizeof(struct sg_header)); + resp->my_cmdp = NULL; + } + return resp; +} + +/* Return of 1 for found; 0 for not found */ +static int sg_remove_request(Sg_fd * sfp, const Sg_request * srp) +{ + Sg_request * prev_rp; + Sg_request * rp; + + if ((! sfp) || (! srp) || (! sfp->headrp)) + return 0; + prev_rp = sfp->headrp; + if (srp == prev_rp) { + prev_rp->parentfp = NULL; + sfp->headrp = prev_rp->nextrp; + return 1; + } + while ((rp = prev_rp->nextrp)) { + if (srp == rp) { + rp->parentfp = NULL; + prev_rp->nextrp = rp->nextrp; + return 1; + } + prev_rp = rp; + } + return 0; +} + +static Sg_fd * sg_add_sfp(Sg_device * sdp, int dev) +{ + Sg_fd * sfp; + + if (sdp->merge_fd) { + ++sdp->merge_fd; + return sdp->headfp; + } + sfp = (Sg_fd *)sg_low_malloc(sizeof(Sg_fd), 0, SG_HEAP_KMAL, 0); + if (sfp) { + memset(sfp, 0, sizeof(Sg_fd)); + sfp->my_mem_src = SG_HEAP_KMAL; + } + else + return NULL; + + sfp->timeout = SG_DEFAULT_TIMEOUT; + sfp->force_packid = SG_DEF_FORCE_PACK_ID; + sfp->low_dma = (SG_DEF_FORCE_LOW_DMA == 0) ? + sdp->device->host->unchecked_isa_dma : 1; + sfp->cmd_q = SG_DEF_COMMAND_Q; + sfp->fst_buf = sg_low_malloc(SG_SCATTER_SZ, sfp->low_dma, + SG_HEAP_PAGE, &sfp->fb_size); + if (! sfp->fst_buf) + sfp->fb_size = 0; + sfp->parentdp = sdp; + if (! sdp->headfp) + sdp->headfp = sfp; + else { /* add to tail of existing list */ + Sg_fd * pfp = sdp->headfp; + while (pfp->nextfp) + pfp = pfp->nextfp; + pfp->nextfp = sfp; + } + sg_big_buff = sfp->fb_size; /* show sysctl most recent "fb" size */ + SCSI_LOG_TIMEOUT(3, printk("sg_add_sfp: sfp=0x%x, m_s=%d\n", + (int)sfp, (int)sfp->my_mem_src)); + SCSI_LOG_TIMEOUT(3, printk("sg_add_sfp: fb_sz=%d, fst_buf=0x%x\n", + sfp->fb_size, (int)sfp->fst_buf)); + return sfp; +} + +static int sg_remove_sfp(Sg_device * sdp, Sg_fd * sfp) +{ + Sg_request * srp; + Sg_request * tsrp; + int dirty = 0; + int res = 0; + + if (sdp->merge_fd) { + if (--sdp->merge_fd) + return 0; /* if merge_fd then dec merge_fd counter */ + } + srp = sfp->headrp; + if (srp) { +/* Need to stop sg_command_done() playing with this list during this loop */ + while (srp) { + tsrp = srp->nextrp; + if (! srp->my_cmdp) + sg_sc_undo_rem(srp, NULL, 0); + else + ++dirty; + srp = tsrp; + } + } + if (0 == dirty) { + Sg_fd * fp; + Sg_fd * prev_fp = sdp->headfp; + + if (sfp == prev_fp) + sdp->headfp = prev_fp->nextfp; + else { + while ((fp = prev_fp->nextfp)) { + if (sfp == fp) { + prev_fp->nextfp = fp->nextfp; + break; + } + prev_fp = fp; + } + } +SCSI_LOG_TIMEOUT(6, printk("sg_remove_sfp: fb_sz=%d, fst_buf=0x%x\n", + sfp->fb_size, (int)sfp->fst_buf)); + sg_low_free(sfp->fst_buf, sfp->fb_size, SG_HEAP_PAGE); + sfp->parentdp = NULL; + sfp->fst_buf = NULL; + sfp->fb_size = 0; + SCSI_LOG_TIMEOUT(6, printk("sg_remove_sfp: sfp=0x%x\n", (int)sfp)); + sg_low_free((char *)sfp, sizeof(Sg_fd), sfp->my_mem_src); + res = 1; + } + else { + sfp->closed = 1; /* flag dirty state on this fd */ + SCSI_LOG_TIMEOUT(1, printk( + "sg_remove_sfp: worrisome, %d writes pending\n", dirty)); + } + return res; +} + +static int sg_fb_in_use(const Sg_fd * sfp) +{ + const Sg_request * srp = sfp->headrp; + + while (srp) { + if (srp->fb_used) + return 1; + srp = srp->nextrp; + } + return 0; +} + +/* 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; + + 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 + if (resp) ++sg_num_kmal; +#endif + return resp; + } + if (SG_HEAP_POOL == mem_src) { + int num_sect = rqSz / SG_SECTOR_SZ; + + if (0 != (rqSz & SG_SECTOR_MSK)) { + if (! retSzp) + return resp; + ++num_sect; + rqSz = num_sect * SG_SECTOR_SZ; + } + while (num_sect > 0) { + if ((num_sect <= sg_pool_secs_avail) && + (scsi_dma_free_sectors > (SG_LOW_POOL_THRESHHOLD + num_sect))) { + resp = scsi_malloc(rqSz); + if (resp) { + if (retSzp) *retSzp = rqSz; + sg_pool_secs_avail -= num_sect; +#ifdef SG_DEBUG + ++sg_num_pool; +#endif + return resp; + } + } + if (! retSzp) + return resp; + num_sect /= 2; /* try half as many */ + rqSz = num_sect * SG_SECTOR_SZ; + } + } + else if (SG_HEAP_PAGE == mem_src) { + int order, a_size; + int resSz = rqSz; + + for (order = 0, a_size = PAGE_SIZE; + a_size < rqSz; order++, a_size <<= 1) + ; + resp = (char *)__get_free_pages(page_mask, order); + while ((! resp) && order && retSzp) { + --order; + a_size >>= 1; /* divide by 2, until PAGE_SIZE */ + resp = (char *)__get_free_pages(page_mask, order); /* try half */ + resSz = a_size; + } + if (retSzp) *retSzp = resSz; +#ifdef SG_DEBUG + if (resp) ++sg_num_page; +#endif + } + else + printk("sg_low_malloc: bad mem_src=%d, rqSz=%df\n", mem_src, rqSz); + return resp; +} + +static char * sg_malloc(Sg_request * srp, int size, int * retSzp, + int * mem_srcp) +{ + char * resp = NULL; + + if (retSzp) *retSzp = size; + if (size <= 0) + ; + else { + Sg_fd * sfp = srp->parentfp; + int low_dma = sfp->low_dma; + int l_ms = -1; /* invalid value */ + + switch (*mem_srcp) + { + case SG_HEAP_PAGE: + case SG_HEAP_FB: + l_ms = (size < PAGE_SIZE) ? SG_HEAP_POOL : SG_HEAP_PAGE; + resp = sg_low_malloc(size, low_dma, l_ms, 0); + if (resp) + break; + if ((size <= sfp->fb_size) && (0 == sg_fb_in_use(sfp))) { + SCSI_LOG_TIMEOUT(6, + printk("sg_malloc: scsi_malloc failed, get fst_buf\n")); + resp = sfp->fst_buf; + srp->fb_used = 1; + l_ms = SG_HEAP_FB; + break; + } + resp = sg_low_malloc(size, low_dma, l_ms, &size); + if (! resp) { + l_ms = (SG_HEAP_POOL == l_ms) ? SG_HEAP_PAGE : SG_HEAP_POOL; + resp = sg_low_malloc(size, low_dma, l_ms, &size); + if (! resp) { + l_ms = SG_HEAP_KMAL; + resp = sg_low_malloc(size, low_dma, l_ms, &size); + } + } + if (resp && retSzp) *retSzp = size; + break; + case SG_HEAP_KMAL: + l_ms = SG_HEAP_PAGE; + resp = sg_low_malloc(size, low_dma, l_ms, 0); + if (resp) + break; + l_ms = SG_HEAP_POOL; + resp = sg_low_malloc(size, low_dma, l_ms, &size); + if (resp && retSzp) *retSzp = size; + break; + default: + SCSI_LOG_TIMEOUT(1, printk("sg_malloc: bad ms=%d\n", *mem_srcp)); + break; + } + if (resp) *mem_srcp = l_ms; + } + SCSI_LOG_TIMEOUT(6, printk("sg_malloc: size=%d, ms=%d, ret=0x%x\n", + size, *mem_srcp, (int)resp)); + return resp; +} + +static void sg_low_free(char * buff, int size, int mem_src) +{ + if (! buff) + return; + if (SG_HEAP_POOL == mem_src) { + int num_sect = size / SG_SECTOR_SZ; + scsi_free(buff, size); + sg_pool_secs_avail += num_sect; + } + else if (SG_HEAP_KMAL == mem_src) + kfree(buff); /* size not used */ + else if (SG_HEAP_PAGE == mem_src) { + int order, a_size; + + for (order = 0, a_size = PAGE_SIZE; + a_size < size; order++, a_size <<= 1) + ; + free_pages((unsigned long)buff, order); + } + else + printk("sg_low_free: bad mem_src=%d, buff=0x%x, rqSz=%df\n", + mem_src, (int)buff, size); +} + +static void sg_free(Sg_request * srp, char * buff, int size, int mem_src) +{ + Sg_fd * sfp = srp->parentfp; + + SCSI_LOG_TIMEOUT(6, + printk("sg_free: buff=0x%x, size=%d\n", (int)buff, size)); + if ((! sfp) || (! buff) || (size <= 0)) + ; + else if (sfp->fst_buf == buff) { + srp->fb_used = 0; + SCSI_LOG_TIMEOUT(6, printk("sg_free: left cause fst_buf\n")); + } + else + sg_low_free(buff, size, mem_src); +} + +static void sg_clr_scpnt(Scsi_Cmnd * SCpnt) +{ + SCpnt->use_sg = 0; + SCpnt->sglist_len = 0; + SCpnt->bufflen = 0; + SCpnt->buffer = NULL; +} + diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/sym53c8xx.c linux/drivers/scsi/sym53c8xx.c --- v2.2.5/linux/drivers/scsi/sym53c8xx.c Wed Dec 31 16:00:00 1969 +++ linux/drivers/scsi/sym53c8xx.c Mon Apr 12 09:51:04 1999 @@ -0,0 +1,11768 @@ +/****************************************************************************** +** High Performance device driver for the Symbios 53C896 controller. +** +** Copyright (C) 1998 Gerard Roudier +** +** This driver also supports all the Symbios 53C8XX controller family, +** except 53C810 revisions < 16, 53C825 revisions < 16 and all +** revisions of 53C815 controllers. +** +** This driver is based on the Linux port of the FreeBSD ncr driver. +** +** Copyright (C) 1994 Wolfgang Stanglmeier +** +**----------------------------------------------------------------------------- +** +** 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., 675 Mass Ave, Cambridge, MA 02139, USA. +** +**----------------------------------------------------------------------------- +** +** The Linux port of the FreeBSD ncr driver has been achieved in +** november 1995 by: +** +** Gerard Roudier +** +** Being given that this driver originates from the FreeBSD version, and +** in order to keep synergy on both, any suggested enhancements and corrections +** received on Linux are automatically a potential candidate for the FreeBSD +** version. +** +** The original driver has been written for 386bsd and FreeBSD by +** Wolfgang Stanglmeier +** Stefan Esser +** +**----------------------------------------------------------------------------- +** +** Major contributions: +** -------------------- +** +** NVRAM detection and reading. +** Copyright (C) 1997 Richard Waltham +** +******************************************************************************* +*/ + +/* +** April 2 1999, sym53c8xx version 1.3c +** +** Supported SCSI features: +** Synchronous data transfers +** Wide16 SCSI BUS +** Disconnection/Reselection +** Tagged command queuing +** SCSI Parity checking +** +** Supported NCR chips: +** 53C810A (8 bits, Fast 10, no rom BIOS) +** 53C825A (Wide, Fast 10, on-board rom BIOS) +** 53C860 (8 bits, Fast 20, no rom BIOS) +** 53C875 (Wide, Fast 20, on-board rom BIOS) +** 53C876 (Wide, Fast 20 Dual, on-board rom BIOS) +** 53C895 (Wide, Fast 40, on-board rom BIOS) +** 53C896 (Wide, Fast 40 Dual, on-board rom BIOS) +** +** Other features: +** Memory mapped IO +** Module +** Shared IRQ +*/ + +/* +** Name and version of the driver +*/ +#define SCSI_NCR_DRIVER_NAME "sym53c8xx - version 1.3c" + +/* #define DEBUG_896R1 */ +#define SCSI_NCR_OPTIMIZE_896 +/* #define SCSI_NCR_OPTIMIZE_896_1 */ + +#define SCSI_NCR_DEBUG_FLAGS (0) + +#define NAME53C "sym53c" +#define NAME53C8XX "sym53c8xx" + +/*========================================================== +** +** Include files +** +**========================================================== +*/ + +#define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s)) + +#ifdef MODULE +#include +#endif + +#include +#include +#include +#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,93) +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,35) +#include +#else +#ifndef __initdata +#define __initdata +#endif +#ifndef __initfunc +#define __initfunc(__arginit) __arginit +#endif +#endif + +#if LINUX_VERSION_CODE <= LinuxVersionCode(2,1,92) +#include +#endif + +#include "scsi.h" +#include "hosts.h" +#include "constants.h" +#include "sd.h" + +#include + +/* +** Define BITS_PER_LONG for earlier linux versions. +*/ +#ifndef BITS_PER_LONG +#if (~0UL) == 0xffffffffUL +#define BITS_PER_LONG 32 +#else +#define BITS_PER_LONG 64 +#endif +#endif + +/* +** Define the BSD style u_int32 and u_int64 type. +** Are in fact u_int32_t and u_int64_t :-) +*/ +typedef u32 u_int32; +typedef u64 u_int64; + +#include "sym53c8xx.h" + +/*========================================================== +** +** A la VMS/CAM-3 queue management. +** Implemented from linux list management. +** +**========================================================== +*/ + +typedef struct xpt_quehead { + struct xpt_quehead *flink; /* Forward pointer */ + struct xpt_quehead *blink; /* Backward pointer */ +} XPT_QUEHEAD; + +#define xpt_que_init(ptr) do { \ + (ptr)->flink = (ptr); (ptr)->blink = (ptr); \ +} while (0) + +static inline void __xpt_que_add(struct xpt_quehead * new, + struct xpt_quehead * blink, + struct xpt_quehead * flink) +{ + flink->blink = new; + new->flink = flink; + new->blink = blink; + blink->flink = new; +} + +static inline void __xpt_que_del(struct xpt_quehead * blink, + struct xpt_quehead * flink) +{ + flink->blink = blink; + blink->flink = flink; +} + +static inline int xpt_que_empty(struct xpt_quehead *head) +{ + return head->flink == head; +} + +static inline void xpt_que_splice(struct xpt_quehead *list, + struct xpt_quehead *head) +{ + struct xpt_quehead *first = list->flink; + + if (first != list) { + struct xpt_quehead *last = list->blink; + struct xpt_quehead *at = head->flink; + + first->blink = head; + head->flink = first; + + last->flink = at; + at->blink = last; + } +} + +#define xpt_que_entry(ptr, type, member) \ + ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) + + +#define xpt_insque(new, pos) __xpt_que_add(new, pos, (pos)->flink) + +#define xpt_remque(el) __xpt_que_del((el)->blink, (el)->flink) + +#define xpt_insque_head(new, head) __xpt_que_add(new, head, (head)->flink) + +static inline struct xpt_quehead *xpt_remque_head(struct xpt_quehead *head) +{ + struct xpt_quehead *elem = head->flink; + + if (elem != head) + __xpt_que_del(head, elem->flink); + else + elem = 0; + return elem; +} + +#define xpt_insque_tail(new, head) __xpt_que_add(new, (head)->blink, head) + +static inline struct xpt_quehead *xpt_remque_tail(struct xpt_quehead *head) +{ + struct xpt_quehead *elem = head->blink; + + if (elem != head) + __xpt_que_del(elem->blink, head); + else + elem = 0; + return elem; +} + +/*========================================================== +** +** On x86 architecture, write buffers management does +** not reorder writes to memory. So, using compiler +** optimization barriers is enough to guarantee some +** ordering when the CPU is writing data accessed by +** the NCR. +** On Alpha architecture, explicit memory barriers have +** to be used. +** Other architectures are defaulted to mb() macro if +** defined, otherwise use compiler barrier. +** +**========================================================== +*/ + +#if defined(__i386__) +#define MEMORY_BARRIER() barrier() +#elif defined(__alpha__) +#define MEMORY_BARRIER() mb() +#else +# ifdef mb +# define MEMORY_BARRIER() mb() +# else +# define MEMORY_BARRIER() barrier() +# endif +#endif + +/*========================================================== +** +** Configuration and Debugging +** +**========================================================== +*/ + +/* +** SCSI address of this device. +** The boot routines should have set it. +** If not, use this. +*/ + +#ifndef SCSI_NCR_MYADDR +#define SCSI_NCR_MYADDR (7) +#endif + +/* +** The maximum number of tags per logic unit. +** Used only for devices that support tags. +*/ + +#ifndef SCSI_NCR_MAX_TAGS +#define SCSI_NCR_MAX_TAGS (8) +#endif + +/* +** TAGS are actually limited to 64 tags/lun. +** We need to deal with power of 2, for alignment constraints. +*/ +#if SCSI_NCR_MAX_TAGS > 64 +#undef SCSI_NCR_MAX_TAGS +#define SCSI_NCR_MAX_TAGS (64) +#endif + +#define NO_TAG (255) + +/* +** Choose appropriate type for tag bitmap. +*/ +#if SCSI_NCR_MAX_TAGS > 32 +typedef u_int64 tagmap_t; +#else +typedef u_int32 tagmap_t; +#endif + +/* +** Number of targets supported by the driver. +** n permits target numbers 0..n-1. +** Default is 16, meaning targets #0..#15. +** #7 .. is myself. +*/ + +#ifdef SCSI_NCR_MAX_TARGET +#define MAX_TARGET (SCSI_NCR_MAX_TARGET) +#else +#define MAX_TARGET (16) +#endif + +/* +** Number of logic units supported by the driver. +** n enables logic unit numbers 0..n-1. +** The common SCSI devices require only +** one lun, so take 1 as the default. +*/ + +#ifdef SCSI_NCR_MAX_LUN +#define MAX_LUN SCSI_NCR_MAX_LUN +#else +#define MAX_LUN (1) +#endif + +/* +** Asynchronous pre-scaler (ns). Shall be 40 for +** the SCSI timings to be compliant. +*/ + +#ifndef SCSI_NCR_MIN_ASYNC +#define SCSI_NCR_MIN_ASYNC (40) +#endif + +/* +** The maximum number of jobs scheduled for starting. +** We allocate 4 entries more than the value we announce +** to the SCSI upper layer. Guess why ! :-) +*/ + +#ifdef SCSI_NCR_CAN_QUEUE +#define MAX_START (SCSI_NCR_CAN_QUEUE + 4) +#else +#define MAX_START (MAX_TARGET + 7 * SCSI_NCR_MAX_TAGS) +#endif + +/* +** The maximum number of segments a transfer is split into. +** We support up to 127 segments for both read and write. +** Since we try to avoid phase mismatches by testing the PHASE +** before each MOV, the both DATA_IN and DATA_OUT scripts do +** not fit in the 4K on-chip RAM. For this reason, the data +** scripts are broken into 2 sub-scripts. +** 80 (MAX_SCATTERL) segments are moved from a sub-script +** in on-chip RAM. This makes data transfers shorter than +** 80k (assuming 1k fs) as fast as possible. +** The 896 allows to handle phase mismatches from SCRIPTS. +** So, for this chip, we use a simple array of MOV's. +** Perhaps, using a simple array of MOV's and going with +** the phase mismatch interrupt is also the best solution +** for the 895 in Ultra2-mode, since the PHASE test + MOV +** latency may be enough to fill the SCSI offset for very +** fast disks like the Cheatah Wide LVD and so, may waste +** SCSI BUS bandwitch. +*/ + +#define MAX_SCATTER (SCSI_NCR_MAX_SCATTER) + +#ifdef SCSI_NCR_OPTIMIZE_896 +#define SCR_SG_SIZE (2) +#define MAX_SCATTERL MAX_SCATTER +#define MAX_SCATTERH 0 +#else +#if (MAX_SCATTER > 80) +#define SCR_SG_SIZE (4) +#define MAX_SCATTERL 80 +#define MAX_SCATTERH (MAX_SCATTER - MAX_SCATTERL) +#else +#define MAX_SCATTERL MAX_SCATTER +#define MAX_SCATTERH 0 +#endif +#endif /* SCSI_NCR_OPTIMIZE_896 */ + +/* +** Io mapped or memory mapped. +*/ + +#if defined(SCSI_NCR_IOMAPPED) +#define NCR_IOMAPPED +#endif + +/* +** other +*/ + +#define NCR_SNOOP_TIMEOUT (1000000) + +/*========================================================== +** +** Miscallaneous BSDish defines. +** +**========================================================== +*/ + +#define u_char unsigned char +#define u_short unsigned short +#define u_int unsigned int +#define u_long unsigned long + +#ifndef bcopy +#define bcopy(s, d, n) memcpy((d), (s), (n)) +#endif + +#ifndef bzero +#define bzero(d, n) memset((d), 0, (n)) +#endif + +#ifndef offsetof +#define offsetof(t, m) ((size_t) (&((t *)0)->m)) +#endif + +/*========================================================== +** +** Debugging tags +** +**========================================================== +*/ + +#define DEBUG_ALLOC (0x0001) +#define DEBUG_PHASE (0x0002) +#define DEBUG_POLL (0x0004) +#define DEBUG_QUEUE (0x0008) +#define DEBUG_RESULT (0x0010) +#define DEBUG_SCATTER (0x0020) +#define DEBUG_SCRIPT (0x0040) +#define DEBUG_TINY (0x0080) +#define DEBUG_TIMING (0x0100) +#define DEBUG_NEGO (0x0200) +#define DEBUG_TAGS (0x0400) +#define DEBUG_FREEZE (0x0800) +#define DEBUG_RESTART (0x1000) + +/* +** Enable/Disable debug messages. +** Can be changed at runtime too. +*/ + +#ifdef SCSI_NCR_DEBUG_INFO_SUPPORT +static int ncr_debug = SCSI_NCR_DEBUG_FLAGS; + #define DEBUG_FLAGS ncr_debug +#else + #define DEBUG_FLAGS SCSI_NCR_DEBUG_FLAGS +#endif + +/* +** SMP threading. +** +** Assuming that SMP systems are generally high end systems and may +** use several SCSI adapters, we are using one lock per controller +** instead of some global one. For the moment (linux-2.1.95), driver's +** entry points are called with the 'io_request_lock' lock held, so: +** - We are uselessly loosing a couple of micro-seconds to lock the +** controller data structure. +** - But the driver is not broken by design for SMP and so can be +** more resistant to bugs or bad changes in the IO sub-system code. +** - A small advantage could be that the interrupt code is grained as +** wished (e.g.: threaded by controller). +*/ + +#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,93) + +spinlock_t sym53c8xx_lock; +#define NCR_LOCK_DRIVER(flags) spin_lock_irqsave(&sym53c8xx_lock, flags) +#define NCR_UNLOCK_DRIVER(flags) spin_unlock_irqrestore(&sym53c8xx_lock,flags) + +#define NCR_INIT_LOCK_NCB(np) spin_lock_init(&np->smp_lock); +#define NCR_LOCK_NCB(np, flags) spin_lock_irqsave(&np->smp_lock, flags) +#define NCR_UNLOCK_NCB(np, flags) spin_unlock_irqrestore(&np->smp_lock, flags) + +# if LINUX_VERSION_CODE < LinuxVersionCode(2,3,99) + +# define NCR_LOCK_SCSI_DONE(np, flags) \ + spin_lock_irqsave(&io_request_lock, flags) +# define NCR_UNLOCK_SCSI_DONE(np, flags) \ + spin_unlock_irqrestore(&io_request_lock, flags) + +# else + +# define NCR_LOCK_SCSI_DONE(np, flags) do {;} while (0) +# define NCR_UNLOCK_SCSI_DONE(np, flags) do {;} while (0) + +# endif + +#else + +#define NCR_LOCK_DRIVER(flags) do { save_flags(flags); cli(); } while (0) +#define NCR_UNLOCK_DRIVER(flags) do { restore_flags(flags); } while (0) + +#define NCR_INIT_LOCK_NCB(np) do { } while (0) +#define NCR_LOCK_NCB(np, flags) do { save_flags(flags); cli(); } while (0) +#define NCR_UNLOCK_NCB(np, flags) do { restore_flags(flags); } while (0) + +#define NCR_LOCK_SCSI_DONE(np, flags) do {;} while (0) +#define NCR_UNLOCK_SCSI_DONE(np, flags) do {;} while (0) + +#endif + +/* +** Address translation +** +** The driver has to provide bus memory addresses to +** the script processor. Because some architectures use +** different physical addressing scheme from the PCI BUS, +** we use virt_to_bus() instead of virt_to_phys(). +*/ + +#define vtobus(p) virt_to_bus(p) + +/* +** Memory mapped IO +** +** Since linux-2.1, we must use ioremap() to map the io memory space. +** iounmap() to unmap it. That allows portability. +** Linux 1.3.X and 2.0.X allow to remap physical pages addresses greater +** than the highest physical memory address to kernel virtual pages with +** vremap() / vfree(). That was not portable but worked with i386 +** architecture. +*/ + +#if LINUX_VERSION_CODE < LinuxVersionCode(2,1,0) +#define ioremap vremap +#define iounmap vfree +#endif + +#ifdef __sparc__ +#define remap_pci_mem(base, size) ((u_long) __va(base)) +#define unmap_pci_mem(vaddr, size) +#define pcivtobus(p) ((p) & pci_dvma_mask) +#else /* __sparc__ */ +#define pcivtobus(p) (p) + +#if !defined(NCR_IOMAPPED) || defined(__i386__) +__initfunc( +static u_long remap_pci_mem(u_long base, u_long size) +) +{ + u_long page_base = ((u_long) base) & PAGE_MASK; + u_long page_offs = ((u_long) base) - page_base; + u_long page_remapped = (u_long) ioremap(page_base, page_offs+size); + + return page_remapped? (page_remapped + page_offs) : 0UL; +} + +__initfunc( +static void unmap_pci_mem(u_long vaddr, u_long size) +) +{ + if (vaddr) + iounmap((void *) (vaddr & PAGE_MASK)); +} +#endif /* !NCR_IOMAPPED || __i386__ */ +#endif /* __sparc__ */ + +/* +** Insert a delay in micro-seconds and milli-seconds. +** ------------------------------------------------- +** Under Linux, udelay() is restricted to delay < 1 milli-second. +** In fact, it generally works for up to 1 second delay. +** Since 2.1.105, the mdelay() function is provided for delays +** in milli-seconds. +** Under 2.0 kernels, udelay() is an inline function that is very +** inaccurate on Pentium processors. +*/ + +#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,105) +#define UDELAY udelay +#define MDELAY mdelay +#else +static void UDELAY(long us) { udelay(us); } +static void MDELAY(long ms) { while (ms--) UDELAY(1000); } +#endif + +/* +** Simple power of two buddy-like allocator +** ---------------------------------------- +** This simple code is not intended to be fast, but to provide +** power of 2 aligned memory allocations. +** Since the SCRIPTS processor only supplies 8 bit arithmetic, +** this allocator allows simple and fast address calculations +** from the SCRIPTS code. In addition, cache line alignment +** is guaranteed for power of 2 cache line size. +*/ + +#define MEMO_SHIFT 4 /* 16 bytes minimum memory chunk */ +#define MEMO_PAGE_ORDER 0 /* 1 PAGE maximum (for now (ever?) */ +typedef unsigned long addr; /* Enough bits to bit-hack addresses */ + +#define MEMO_FREE_UNUSED /* Free unused pages immediately */ + +struct m_link { + struct m_link *next; /* Simple links are enough */ +}; + +#ifndef GFP_DMA_32BIT +#define GFP_DMA_32BIT 0 /* Will this flag ever exist */ +#endif + +#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,0) +#define get_pages(order) __get_free_pages(GFP_ATOMIC | GFP_DMA_32BIT, order) +#else +#define get_pages(order) __get_free_pages(GFP_ATOMIC | GFP_DMA_32BIT, order, 0) +#endif + +/* +** Lists of available memory chunks. +** Starts with 16 bytes chunks until 1 PAGE chunks. +*/ +static struct m_link h[PAGE_SHIFT-MEMO_SHIFT+MEMO_PAGE_ORDER+1]; + +/* +** Allocate a memory area aligned on the lowest power of 2 +** greater than the requested size. +*/ +static void *__m_alloc(int size) +{ + int i = 0; + int s = (1 << MEMO_SHIFT); + int j; + addr a ; + + if (size > (PAGE_SIZE << MEMO_PAGE_ORDER)) + return 0; + + while (size > s) { + s <<= 1; + ++i; + } + + j = i; + while (!h[j].next) { + if (s == (PAGE_SIZE << MEMO_PAGE_ORDER)) { + h[j].next = (struct m_link *)get_pages(MEMO_PAGE_ORDER); + if (h[j].next) + h[j].next->next = 0; + break; + } + ++j; + s <<= 1; + } + a = (addr) h[j].next; + if (a) { + h[j].next = h[j].next->next; + while (j > i) { + j -= 1; + s >>= 1; + h[j].next = (struct m_link *) (a+s); + h[j].next->next = 0; + } + } +#ifdef DEBUG + printk("m_alloc(%d) = %p\n", size, (void *) a); +#endif + return (void *) a; +} + +/* +** Free a memory area allocated using m_alloc(). +** Coalesce buddies. +** Free pages that become unused if MEMO_FREE_UNUSED is defined. +*/ +static void __m_free(void *ptr, int size) +{ + int i = 0; + int s = (1 << MEMO_SHIFT); + struct m_link *q; + addr a, b; + +#ifdef DEBUG + printk("m_free(%p, %d)\n", ptr, size); +#endif + + if (size > (PAGE_SIZE << MEMO_PAGE_ORDER)) + return; + + while (size > s) { + s <<= 1; + ++i; + } + + a = (addr) ptr; + + while (1) { +#ifdef MEMO_FREE_UNUSED + if (s == (PAGE_SIZE << MEMO_PAGE_ORDER)) { + free_pages(a, MEMO_PAGE_ORDER); + break; + } +#endif + b = a ^ s; + q = &h[i]; + while (q->next && q->next != (struct m_link *) b) { + q = q->next; + } + if (!q->next) { + ((struct m_link *) a)->next = h[i].next; + h[i].next = (struct m_link *) a; + break; + } + q->next = q->next->next; + a = a & b; + s <<= 1; + ++i; + } +} + +#define MEMO_WARN 1 + +/* +** The memory pool is shared by all instances. +** We use a global SMP LOCK to be SMP safe. +*/ + +static void *m_calloc(int size, char *name, int uflags) +{ + u_long flags; + void *p; + + NCR_LOCK_DRIVER(flags); + p = __m_alloc(size); + NCR_UNLOCK_DRIVER(flags); + + if (DEBUG_FLAGS & DEBUG_ALLOC) + printk ("new %s[%d] @%p.\n", name, size, p); + + if (p) + memset(p, 0, size); + else if (uflags & MEMO_WARN) + printk (NAME53C8XX ": failed to allocate %s[%d]\n", name, size); + + return p; +} + +static void m_free(void *ptr, int size, char *name) +{ + u_long flags; + + if (DEBUG_FLAGS & DEBUG_ALLOC) + printk ("freeing %s[%d] @%p.\n", name, size, ptr); + + NCR_LOCK_DRIVER(flags); + __m_free(ptr, size); + NCR_UNLOCK_DRIVER(flags); +} + +/* +** Transfer direction +** +** Low-level scsi drivers under Linux do not receive the expected +** data transfer direction from upper scsi drivers. +** The driver will only check actual data direction for common +** scsi opcodes. Other ones may cause problem, since they may +** depend on device type or be vendor specific. +** I would prefer to never trust the device for data direction, +** but that is not possible. +** +** The original driver requires the expected direction to be known. +** The Linux version of the driver has been enhanced in order to +** be able to transfer data in the direction choosen by the target. +*/ + +#define XFER_IN (1) +#define XFER_OUT (2) + +/* +** Head of list of NCR boards +** +** For kernel version < 1.3.70, host is retrieved by its irq level. +** For later kernels, the internal host control block address +** (struct ncb) is used as device id parameter of the irq stuff. +*/ + +static struct Scsi_Host *first_host = NULL; + + +/* +** /proc directory entry and proc_info function +*/ + +static struct proc_dir_entry proc_scsi_sym53c8xx = { + PROC_SCSI_SYM53C8XX, 9, NAME53C8XX, + S_IFDIR | S_IRUGO | S_IXUGO, 2 +}; +#ifdef SCSI_NCR_PROC_INFO_SUPPORT +static int sym53c8xx_proc_info(char *buffer, char **start, off_t offset, + int length, int hostno, int func); +#endif + +/* +** Driver setup. +** +** This structure is initialized from linux config options. +** It can be overridden at boot-up by the boot command line. +*/ +#define SCSI_NCR_MAX_EXCLUDES 8 +struct ncr_driver_setup { + u_char master_parity; + u_char scsi_parity; + u_char disconnection; + u_char special_features; + u_char ultra_scsi; + u_char force_sync_nego; + u_char reverse_probe; + u_char pci_fix_up; + u_char use_nvram; + u_char verbose; + u_char default_tags; + u_short default_sync; + u_short debug; + u_char burst_max; + u_char led_pin; + u_char max_wide; + u_char settle_delay; + u_char diff_support; + u_char irqm; + u_char bus_check; + u_char optimize; + u_char recovery; + u_int excludes[SCSI_NCR_MAX_EXCLUDES]; + char tag_ctrl[100]; +}; + +static struct ncr_driver_setup + driver_setup = SCSI_NCR_DRIVER_SETUP; + +#ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT +static struct ncr_driver_setup + driver_safe_setup __initdata = SCSI_NCR_DRIVER_SAFE_SETUP; +# ifdef MODULE +char *sym53c8xx = 0; /* command line passed by insmod */ +# if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,30) +MODULE_PARM(sym53c8xx, "s"); +# endif +# endif +#endif + +/* +** Other Linux definitions +*/ +#define SetScsiResult(cmd, h_sts, s_sts) \ + cmd->result = (((h_sts) << 16) + ((s_sts) & 0x7f)) + +static void sym53c8xx_select_queue_depths( + struct Scsi_Host *host, struct scsi_device *devlist); +static void sym53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs); +static void sym53c8xx_timeout(unsigned long np); + +#define initverbose (driver_setup.verbose) +#define bootverbose (np->verbose) + +#ifdef SCSI_NCR_NVRAM_SUPPORT +/* +** Symbios NvRAM data format +*/ +#define SYMBIOS_NVRAM_SIZE 368 +#define SYMBIOS_NVRAM_ADDRESS 0x100 + +struct Symbios_nvram { +/* Header 6 bytes */ + u_short type; /* 0x0000 */ + u_short byte_count; /* excluding header/trailer */ + u_short checksum; + +/* Controller set up 20 bytes */ + u_char v_major; /* 0x00 */ + u_char v_minor; /* 0x30 */ + u_int32 boot_crc; + u_short flags; +#define SYMBIOS_SCAM_ENABLE (1) +#define SYMBIOS_PARITY_ENABLE (1<<1) +#define SYMBIOS_VERBOSE_MSGS (1<<2) +#define SYMBIOS_CHS_MAPPING (1<<3) +#define SYMBIOS_NO_NVRAM (1<<3) /* ??? */ + u_short flags1; +#define SYMBIOS_SCAN_HI_LO (1) + u_short term_state; +#define SYMBIOS_TERM_CANT_PROGRAM (0) +#define SYMBIOS_TERM_ENABLED (1) +#define SYMBIOS_TERM_DISABLED (2) + u_short rmvbl_flags; +#define SYMBIOS_RMVBL_NO_SUPPORT (0) +#define SYMBIOS_RMVBL_BOOT_DEVICE (1) +#define SYMBIOS_RMVBL_MEDIA_INSTALLED (2) + u_char host_id; + u_char num_hba; /* 0x04 */ + u_char num_devices; /* 0x10 */ + u_char max_scam_devices; /* 0x04 */ + u_char num_valid_scam_devives; /* 0x00 */ + u_char rsvd; + +/* Boot order 14 bytes * 4 */ + struct Symbios_host{ + u_short type; /* 4:8xx / 0:nok */ + u_short device_id; /* PCI device id */ + u_short vendor_id; /* PCI vendor id */ + u_char bus_nr; /* PCI bus number */ + u_char device_fn; /* PCI device/function number << 3*/ + u_short word8; + u_short flags; +#define SYMBIOS_INIT_SCAN_AT_BOOT (1) + u_short io_port; /* PCI io_port address */ + } host[4]; + +/* Targets 8 bytes * 16 */ + struct Symbios_target { + u_char flags; +#define SYMBIOS_DISCONNECT_ENABLE (1) +#define SYMBIOS_SCAN_AT_BOOT_TIME (1<<1) +#define SYMBIOS_SCAN_LUNS (1<<2) +#define SYMBIOS_QUEUE_TAGS_ENABLED (1<<3) + u_char rsvd; + u_char bus_width; /* 0x08/0x10 */ + u_char sync_offset; + u_short sync_period; /* 4*period factor */ + u_short timeout; + } target[16]; +/* Scam table 8 bytes * 4 */ + struct Symbios_scam { + u_short id; + u_short method; +#define SYMBIOS_SCAM_DEFAULT_METHOD (0) +#define SYMBIOS_SCAM_DONT_ASSIGN (1) +#define SYMBIOS_SCAM_SET_SPECIFIC_ID (2) +#define SYMBIOS_SCAM_USE_ORDER_GIVEN (3) + u_short status; +#define SYMBIOS_SCAM_UNKNOWN (0) +#define SYMBIOS_SCAM_DEVICE_NOT_FOUND (1) +#define SYMBIOS_SCAM_ID_NOT_SET (2) +#define SYMBIOS_SCAM_ID_VALID (3) + u_char target_id; + u_char rsvd; + } scam[4]; + + u_char spare_devices[15*8]; + u_char trailer[6]; /* 0xfe 0xfe 0x00 0x00 0x00 0x00 */ +}; +typedef struct Symbios_nvram Symbios_nvram; +typedef struct Symbios_host Symbios_host; +typedef struct Symbios_target Symbios_target; +typedef struct Symbios_scam Symbios_scam; + +/* +** Tekram NvRAM data format. +*/ +#define TEKRAM_NVRAM_SIZE 64 +#define TEKRAM_NVRAM_ADDRESS 0 + +struct Tekram_nvram { + struct Tekram_target { + u_char flags; +#define TEKRAM_PARITY_CHECK (1) +#define TEKRAM_SYNC_NEGO (1<<1) +#define TEKRAM_DISCONNECT_ENABLE (1<<2) +#define TEKRAM_START_CMD (1<<3) +#define TEKRAM_TAGGED_COMMANDS (1<<4) +#define TEKRAM_WIDE_NEGO (1<<5) + u_char sync_index; + u_short word2; + } target[16]; + u_char host_id; + u_char flags; +#define TEKRAM_MORE_THAN_2_DRIVES (1) +#define TEKRAM_DRIVES_SUP_1GB (1<<1) +#define TEKRAM_RESET_ON_POWER_ON (1<<2) +#define TEKRAM_ACTIVE_NEGATION (1<<3) +#define TEKRAM_IMMEDIATE_SEEK (1<<4) +#define TEKRAM_SCAN_LUNS (1<<5) +#define TEKRAM_REMOVABLE_FLAGS (3<<6) /* 0: disable; 1: boot device; 2:all */ + u_char boot_delay_index; + u_char max_tags_index; + u_short flags1; +#define TEKRAM_F2_F6_ENABLED (1) + u_short spare[29]; +}; +typedef struct Tekram_nvram Tekram_nvram; +typedef struct Tekram_target Tekram_target; + +static u_char Tekram_sync[12] __initdata = {25,31,37,43,50,62,75,125,12,15,18,21}; + +#endif /* SCSI_NCR_NVRAM_SUPPORT */ + +/* +** Structures used by sym53c8xx_detect/sym53c8xx_pci_init to +** transmit device configuration to the ncr_attach() function. +*/ +typedef struct { + int bus; + u_char device_fn; + u_long base; + u_long base_2; + u_long io_port; + int irq; +/* port and reg fields to use INB, OUTB macros */ + u_long base_io; + volatile struct ncr_reg *reg; +} ncr_slot; + +typedef struct { + int type; +#define SCSI_NCR_SYMBIOS_NVRAM (1) +#define SCSI_NCR_TEKRAM_NVRAM (2) +#ifdef SCSI_NCR_NVRAM_SUPPORT + union { + Symbios_nvram Symbios; + Tekram_nvram Tekram; + } data; +#endif +} ncr_nvram; + +/* +** Structure used by sym53c8xx_detect/sym53c8xx_pci_init +** to save data on each detected board for ncr_attach(). +*/ +typedef struct { + ncr_slot slot; + ncr_chip chip; + ncr_nvram *nvram; + u_char host_id; +#ifdef SCSI_NCR_PQS_PDS_SUPPORT + u_char pqs_pds; +#endif + int attach_done; +} ncr_device; + +/*========================================================== +** +** assert () +** +**========================================================== +** +** modified copy from 386bsd:/usr/include/sys/assert.h +** +**---------------------------------------------------------- +*/ + +#define assert(expression) { \ + if (!(expression)) { \ + (void)panic( \ + "assertion \"%s\" failed: file \"%s\", line %d\n", \ + #expression, \ + __FILE__, __LINE__); \ + } \ +} + +/*========================================================== +** +** Big/Little endian support. +** +**========================================================== +*/ + +/* +** If the NCR uses big endian addressing mode over the +** PCI, actual io register addresses for byte and word +** accesses must be changed according to lane routing. +** Btw, ncr_offb() and ncr_offw() macros only apply to +** constants and so donnot generate bloated code. +*/ + +#if defined(SCSI_NCR_BIG_ENDIAN) + +#define ncr_offb(o) (((o)&~3)+((~((o)&3))&3)) +#define ncr_offw(o) (((o)&~3)+((~((o)&3))&2)) + +#else + +#define ncr_offb(o) (o) +#define ncr_offw(o) (o) + +#endif + +/* +** If the CPU and the NCR use same endian-ness adressing, +** 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 +** from the script. +*/ + +#if defined(__BIG_ENDIAN) && !defined(SCSI_NCR_BIG_ENDIAN) + +#define cpu_to_scr(dw) cpu_to_le32(dw) +#define scr_to_cpu(dw) le32_to_cpu(dw) + +#elif defined(__LITTLE_ENDIAN) && defined(SCSI_NCR_BIG_ENDIAN) + +#define cpu_to_scr(dw) cpu_to_be32(dw) +#define scr_to_cpu(dw) be32_to_cpu(dw) + +#else + +#define cpu_to_scr(dw) (dw) +#define scr_to_cpu(dw) (dw) + +#endif + +/*========================================================== +** +** Access to the controller chip. +** +** If NCR_IOMAPPED is defined, the driver will use +** normal IOs instead of the MEMORY MAPPED IO method +** recommended by PCI specifications. +** If all PCI bridges, host brigdes and architectures +** would have been correctly designed for PCI, this +** option would be useless. +** +**========================================================== +*/ + +/* +** If the CPU and the NCR use same endian-ness adressing, +** 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 +** reordering. Functions suffixed by '_l2b' are +** assumed to perform little-endian to big-endian byte +** reordering, those suffixed by '_b2l' blah, blah, +** blah, ... +*/ + +#if defined(NCR_IOMAPPED) + +/* +** IO mapped only input / ouput +*/ + +#define INB_OFF(o) inb (np->base_io + ncr_offb(o)) +#define OUTB_OFF(o, val) outb ((val), np->base_io + ncr_offb(o)) + +#if defined(__BIG_ENDIAN) && !defined(SCSI_NCR_BIG_ENDIAN) + +#define INW_OFF(o) inw_l2b (np->base_io + ncr_offw(o)) +#define INL_OFF(o) inl_l2b (np->base_io + (o)) + +#define OUTW_OFF(o, val) outw_b2l ((val), np->base_io + ncr_offw(o)) +#define OUTL_OFF(o, val) outl_b2l ((val), np->base_io + (o)) + +#elif defined(__LITTLE_ENDIAN) && defined(SCSI_NCR_BIG_ENDIAN) + +#define INW_OFF(o) inw_b2l (np->base_io + ncr_offw(o)) +#define INL_OFF(o) inl_b2l (np->base_io + (o)) + +#define OUTW_OFF(o, val) outw_l2b ((val), np->base_io + ncr_offw(o)) +#define OUTL_OFF(o, val) outl_l2b ((val), np->base_io + (o)) + +#else + +#define INW_OFF(o) inw_raw (np->base_io + ncr_offw(o)) +#define INL_OFF(o) inl_raw (np->base_io + (o)) + +#define OUTW_OFF(o, val) outw_raw ((val), np->base_io + ncr_offw(o)) +#define OUTL_OFF(o, val) outl_raw ((val), np->base_io + (o)) + +#endif /* ENDIANs */ + +#else /* defined NCR_IOMAPPED */ + +/* +** MEMORY mapped IO input / output +*/ + +#define INB_OFF(o) readb((char *)np->reg + ncr_offb(o)) +#define OUTB_OFF(o, val) writeb((val), (char *)np->reg + ncr_offb(o)) + +#if defined(__BIG_ENDIAN) && !defined(SCSI_NCR_BIG_ENDIAN) + +#define INW_OFF(o) readw_l2b((char *)np->reg + ncr_offw(o)) +#define INL_OFF(o) readl_l2b((char *)np->reg + (o)) + +#define OUTW_OFF(o, val) writew_b2l((val), (char *)np->reg + ncr_offw(o)) +#define OUTL_OFF(o, val) writel_b2l((val), (char *)np->reg + (o)) + +#elif defined(__LITTLE_ENDIAN) && defined(SCSI_NCR_BIG_ENDIAN) + +#define INW_OFF(o) readw_b2l((char *)np->reg + ncr_offw(o)) +#define INL_OFF(o) readl_b2l((char *)np->reg + (o)) + +#define OUTW_OFF(o, val) writew_l2b((val), (char *)np->reg + ncr_offw(o)) +#define OUTL_OFF(o, val) writel_l2b((val), (char *)np->reg + (o)) + +#else + +#define INW_OFF(o) readw_raw((char *)np->reg + ncr_offw(o)) +#define INL_OFF(o) readl_raw((char *)np->reg + (o)) + +#define OUTW_OFF(o, val) writew_raw((val), (char *)np->reg + ncr_offw(o)) +#define OUTL_OFF(o, val) writel_raw((val), (char *)np->reg + (o)) + +#endif + +#endif /* defined NCR_IOMAPPED */ + +#define INB(r) INB_OFF (offsetof(struct ncr_reg,r)) +#define INW(r) INW_OFF (offsetof(struct ncr_reg,r)) +#define INL(r) INL_OFF (offsetof(struct ncr_reg,r)) + +#define OUTB(r, val) OUTB_OFF (offsetof(struct ncr_reg,r), (val)) +#define OUTW(r, val) OUTW_OFF (offsetof(struct ncr_reg,r), (val)) +#define OUTL(r, val) OUTL_OFF (offsetof(struct ncr_reg,r), (val)) + +/* +** Set bit field ON, OFF +*/ + +#define OUTONB(r, m) OUTB(r, INB(r) | (m)) +#define OUTOFFB(r, m) OUTB(r, INB(r) & ~(m)) +#define OUTONW(r, m) OUTW(r, INW(r) | (m)) +#define OUTOFFW(r, m) OUTW(r, INW(r) & ~(m)) +#define OUTONL(r, m) OUTL(r, INL(r) | (m)) +#define OUTOFFL(r, m) OUTL(r, INL(r) & ~(m)) + + +/*========================================================== +** +** Command control block states. +** +**========================================================== +*/ + +#define HS_IDLE (0) +#define HS_BUSY (1) +#define HS_NEGOTIATE (2) /* sync/wide data transfer*/ +#define HS_DISCONNECT (3) /* Disconnected by target */ + +#define HS_DONEMASK (0x80) +#define HS_COMPLETE (4|HS_DONEMASK) +#define HS_SEL_TIMEOUT (5|HS_DONEMASK) /* Selection timeout */ +#define HS_RESET (6|HS_DONEMASK) /* SCSI reset */ +#define HS_ABORTED (7|HS_DONEMASK) /* Transfer aborted */ +#define HS_TIMEOUT (8|HS_DONEMASK) /* Software timeout */ +#define HS_FAIL (9|HS_DONEMASK) /* SCSI or PCI bus errors */ +#define HS_UNEXPECTED (10|HS_DONEMASK)/* Unexpected disconnect */ + +#define DSA_INVALID 0xffffffff + +/*========================================================== +** +** Software Interrupt Codes +** +**========================================================== +*/ + +#define SIR_BAD_STATUS (1) +#define SIR_SEL_ATN_NO_MSG_OUT (2) +#define SIR_NEGO_SYNC (3) +#define SIR_NEGO_WIDE (4) +#define SIR_NEGO_FAILED (5) +#define SIR_NEGO_PROTO (6) +#define SIR_REJECT_RECEIVED (7) +#define SIR_REJECT_TO_SEND (8) +#define SIR_IGN_RESIDUE (9) +#define SIR_MISSING_SAVE (10) +#define SIR_RESEL_NO_MSG_IN (11) +#define SIR_RESEL_NO_IDENTIFY (12) +#define SIR_RESEL_BAD_LUN (13) +#define SIR_UNUSED_14 (14) +#define SIR_RESEL_BAD_I_T_L (15) +#define SIR_RESEL_BAD_I_T_L_Q (16) +#define SIR_UNUSED_17 (17) +#define SIR_RESEL_ABORTED (18) +#define SIR_MSG_OUT_DONE (19) +#define SIR_MAX (19) + +/*========================================================== +** +** Extended error codes. +** xerr_status field of struct ccb. +** +**========================================================== +*/ + +#define XE_OK (0) +#define XE_EXTRA_DATA (1) /* unexpected data phase */ +#define XE_BAD_PHASE (2) /* illegal phase (4/5) */ + +/*========================================================== +** +** Negotiation status. +** nego_status field of struct ccb. +** +**========================================================== +*/ + +#define NS_SYNC (1) +#define NS_WIDE (2) + +/*========================================================== +** +** "Special features" of targets. +** quirks field of struct tcb. +** actualquirks field of struct ccb. +** +**========================================================== +*/ + +#define QUIRK_AUTOSAVE (0x01) +#define QUIRK_NOMSG (0x02) +#define QUIRK_NOSYNC (0x10) +#define QUIRK_NOWIDE16 (0x20) + +/*========================================================== +** +** Capability bits in Inquire response byte 7. +** +**========================================================== +*/ + +#define INQ7_QUEUE (0x02) +#define INQ7_SYNC (0x10) +#define INQ7_WIDE16 (0x20) + +/*========================================================== +** +** A CCB hashed table is used to retrieve CCB address +** from DSA value. +** +**========================================================== +*/ + +#define CCB_HASH_SHIFT 8 +#define CCB_HASH_SIZE (1UL << CCB_HASH_SHIFT) +#define CCB_HASH_MASK (CCB_HASH_SIZE-1) +#define CCB_HASH_CODE(dsa) (((dsa) >> 11) & CCB_HASH_MASK) + +/*========================================================== +** +** Declaration of structs. +** +**========================================================== +*/ + +struct tcb; +struct lcb; +struct ccb; +struct ncb; +struct script; + +typedef struct ncb * ncb_p; +typedef struct tcb * tcb_p; +typedef struct lcb * lcb_p; +typedef struct ccb * ccb_p; + +struct link { + ncrcmd l_cmd; + ncrcmd l_paddr; +}; + +struct usrcmd { + u_long target; + u_long lun; + u_long data; + u_long cmd; +}; + +#define UC_SETSYNC 10 +#define UC_SETTAGS 11 +#define UC_SETDEBUG 12 +#define UC_SETORDER 13 +#define UC_SETWIDE 14 +#define UC_SETFLAG 15 +#define UC_CLEARPROF 16 +#define UC_SETVERBOSE 17 + +#define UF_TRACE (0x01) +#define UF_NODISC (0x02) +#define UF_NOSCAN (0x04) + +#ifdef SCSI_NCR_PROFILE_SUPPORT +/* +** profiling data (per host) +*/ + +struct profile { + u_long num_trans; + u_long num_disc; + u_long num_disc0; + u_long num_break; + u_long num_int; + u_long num_fly; + u_long num_kbytes; +#if 000 + u_long num_br1k; + u_long num_br2k; + u_long num_br4k; + u_long num_br8k; + u_long num_brnk; +#endif +}; +#endif + +/*======================================================================== +** +** Declaration of structs: target control block +** +**======================================================================== +*/ +struct tcb { + /*---------------------------------------------------------------- + ** LUN tables. + ** An array of bus addresses is used on reselection by + ** the SCRIPT. + **---------------------------------------------------------------- + */ + u_int32 *luntbl; /* lcbs bus address table */ + u_int32 b_luntbl; /* bus address of this table */ + lcb_p lp[MAX_LUN]; /* The lcb's of this tcb */ + + /*---------------------------------------------------------------- + ** Target capabilities. + **---------------------------------------------------------------- + */ + u_char inq_done; /* Target capabilities received */ + u_char inq_byte7; /* Contains these capabilities */ + + /*---------------------------------------------------------------- + ** Pointer to the ccb used for negotiation. + ** Prevent from starting a negotiation for all queued commands + ** when tagged command queuing is enabled. + **---------------------------------------------------------------- + */ + ccb_p nego_cp; + + /*---------------------------------------------------------------- + ** statistical data + **---------------------------------------------------------------- + */ + u_long transfers; + u_long bytes; + + /*---------------------------------------------------------------- + ** negotiation of wide and synch transfer and device quirks. + ** sval and wval are read from SCRIPTS and so have alignment + ** constraints. + **---------------------------------------------------------------- + */ +/*0*/ u_char minsync; +/*1*/ u_char sval; +/*2*/ u_short period; +/*0*/ u_char maxoffs; +/*1*/ u_char quirks; +/*2*/ u_char widedone; +/*3*/ u_char wval; + + /*---------------------------------------------------------------- + ** User settable limits and options. + ** These limits are read from the NVRAM if present. + **---------------------------------------------------------------- + */ + u_char usrsync; + u_char usrwide; + u_char usrtags; + u_char usrflag; +}; + +/*======================================================================== +** +** Declaration of structs: lun control block +** +**======================================================================== +*/ +struct lcb { + /*---------------------------------------------------------------- + ** On reselection, SCRIPTS use this value as a JUMP address + ** after the IDENTIFY has been successfully received. + ** This field is set to 'resel_tag' if TCQ is enabled and + ** to 'resel_notag' if TCQ is disabled. + ** (Must be at zero due to bad lun handling on reselection) + **---------------------------------------------------------------- + */ +/*0*/ u_int32 resel_task; + + /*---------------------------------------------------------------- + ** Task table used by the script processor to retrieve the + ** task corresponding to a reselected nexus. The TAG is used + ** as offset to determine the corresponding entry. + ** Each entry contains the associated CCB bus address. + **---------------------------------------------------------------- + */ + u_int32 tasktbl_0; /* Used if TCQ not enabled */ + u_int32 *tasktbl; + u_int32 b_tasktbl; + + /*---------------------------------------------------------------- + ** CCB queue management. + **---------------------------------------------------------------- + */ + XPT_QUEHEAD busy_ccbq; /* Queue of busy CCBs */ + XPT_QUEHEAD wait_ccbq; /* Queue of waiting for IO CCBs */ + u_char busyccbs; /* CCBs busy for this lun */ + u_char queuedccbs; /* CCBs queued to the controller*/ + u_char queuedepth; /* Queue depth for this lun */ + u_char scdev_depth; /* SCSI device queue depth */ + u_char maxnxs; /* Max possible nexuses */ + + /*---------------------------------------------------------------- + ** Control of tagged command queuing. + ** Tags allocation is performed using a circular buffer. + ** This avoids using a loop for tag allocation. + **---------------------------------------------------------------- + */ + u_char ia_tag; /* Tag allocation index */ + u_char if_tag; /* Tag release index */ + u_char cb_tags[SCSI_NCR_MAX_TAGS]; /* Circular tags buffer */ + u_char usetags; /* Command queuing is active */ + u_char maxtags; /* Max NR of tags asked by user */ + u_char numtags; /* Current number of tags */ + u_char inq_byte7; /* Store unit CmdQ capabitility */ + + /*---------------------------------------------------------------- + ** QUEUE FULL and ORDERED tag control. + **---------------------------------------------------------------- + */ + u_short num_good; /* Nr of GOOD since QUEUE FULL */ + tagmap_t tags_umap; /* Used tags bitmap */ + tagmap_t tags_smap; /* Tags in use at 'tag_stime' */ + u_long tags_stime; /* Last time we set smap=umap */ +}; + +/*======================================================================== +** +** Declaration of structs: actions for a task. +** +**======================================================================== +** +** It is part of the CCB and is called by the scripts processor to +** start or restart the data structure (nexus). +** +**------------------------------------------------------------------------ +*/ +struct action { + u_int32 start; + u_int32 restart; +}; + +/*======================================================================== +** +** Declaration of structs: Phase mismatch context. +** +**======================================================================== +** +** It is part of the CCB and is used as parameters for the DATA +** pointer. We need two contexts to handle correctly the SAVED +** DATA POINTER. +** +**------------------------------------------------------------------------ +*/ +struct pm_ctx { + struct scr_tblmove sg; /* Updated interrupted SG block */ + u_int32 ret; /* SCRIPT return address */ +}; + +/*======================================================================== +** +** Declaration of structs: global HEADER. +** +**======================================================================== +** +** In earlier driver versions, this substructure was copied from the +** ccb to a global address after selection (or reselection) and copied +** back before disconnect. Since we are now using LOAD/STORE DSA +** RELATIVE instructions, the script is able to access directly these +** fields, and so, this header is no more copied. +** +**------------------------------------------------------------------------ +*/ + +struct head { + /*---------------------------------------------------------------- + ** Start and restart SCRIPTS addresses (must be at 0). + **---------------------------------------------------------------- + */ + struct action go; + + /*---------------------------------------------------------------- + ** Saved data pointer. + ** Points to the position in the script responsible for the + ** actual transfer of data. + ** It's written after reception of a SAVE_DATA_POINTER message. + ** The goalpointer points after the last transfer command. + **---------------------------------------------------------------- + */ + u_int32 savep; + u_int32 lastp; + u_int32 goalp; + + /*---------------------------------------------------------------- + ** Alternate data pointer. + ** They are copied back to savep/lastp/goalp by the SCRIPTS + ** when the direction is unknown and the device claims data out. + **---------------------------------------------------------------- + */ + u_int32 wlastp; + u_int32 wgoalp; + + /*---------------------------------------------------------------- + ** Status fields. + **---------------------------------------------------------------- + */ + u_char scr_st[4]; /* script status */ + u_char status[4]; /* host status */ +}; + +/* +** The status bytes are used by the host and the script processor. +** +** The last four bytes (status[4]) are copied to the scratchb register +** (declared as scr0..scr3 in ncr_reg.h) just after the select/reselect, +** and copied back just after disconnecting. +** Inside the script the XX_REG are used. +** +** The first four bytes (scr_st[4]) are used inside the script by +** "LOAD/STORE" commands. +** Because source and destination must have the same alignment +** in a DWORD, the fields HAVE to be at the choosen offsets. +** xerr_st 0 (0x34) scratcha +** sync_st 1 (0x05) sxfer +** wide_st 3 (0x03) scntl3 +*/ + +/* +** Last four bytes (script) +*/ +#define QU_REG scr0 +#define HS_REG scr1 +#define HS_PRT nc_scr1 +#define SS_REG scr2 +#define SS_PRT nc_scr2 +#define HF_REG scr3 +#define HF_PRT nc_scr3 + +/* +** Last four bytes (host) +*/ +#define actualquirks phys.header.status[0] +#define host_status phys.header.status[1] +#define scsi_status phys.header.status[2] +#define host_flags phys.header.status[3] + +/* +** Host flags +*/ +#define HF_IN_PM0 1u +#define HF_IN_PM1 (1u<<1) +#define HF_ACT_PM (1u<<2) +#define HF_DP_SAVED (1u<<3) +#define HF_PAR_ERR (1u<<4) +#define HF_DATA_ST (1u<<5) +#define HF_PM_TO_C (1u<<6) + +/* +** First four bytes (script) +*/ +#define xerr_st header.scr_st[0] +#define sync_st header.scr_st[1] +#define nego_st header.scr_st[2] +#define wide_st header.scr_st[3] + +/* +** First four bytes (host) +*/ +#define xerr_status phys.xerr_st +#define nego_status phys.nego_st + +/*========================================================== +** +** Declaration of structs: Data structure block +** +**========================================================== +** +** During execution of a ccb by the script processor, +** the DSA (data structure address) register points +** to this substructure of the ccb. +** This substructure contains the header with +** the script-processor-changable data and +** data blocks for the indirect move commands. +** +**---------------------------------------------------------- +*/ + +struct dsb { + + /* + ** Header. + */ + + struct head header; + + /* + ** Table data for Script + */ + + struct scr_tblsel select; + struct scr_tblmove smsg ; + struct scr_tblmove cmd ; + struct scr_tblmove sense ; + struct scr_tblmove data [MAX_SCATTER]; + + /* + ** Phase mismatch contexts. + ** We need two to handle correctly the + ** SAVED DATA POINTER. + */ + + struct pm_ctx pm0; + struct pm_ctx pm1; + +#ifdef SCSI_NCR_PROFILE_SUPPORT + /* + ** Disconnection counter + */ + u_int32 num_disc; +#endif +}; + + +/*======================================================================== +** +** Declaration of structs: Command control block. +** +**======================================================================== +*/ +struct ccb { + /*---------------------------------------------------------------- + ** This is the data structure which is pointed by the DSA + ** register when it is executed by the script processor. + ** It must be the first entry. + **---------------------------------------------------------------- + */ + struct dsb phys; + + /*---------------------------------------------------------------- + ** The general SCSI driver provides a + ** pointer to a control block. + **---------------------------------------------------------------- + */ + Scsi_Cmnd *cmd; /* SCSI command */ + u_long tlimit; /* Deadline for this job */ + int data_len; /* Total data length */ + + /*---------------------------------------------------------------- + ** Message areas. + ** We prepare a message to be sent after selection. + ** We may use a second one if the command is rescheduled + ** due to CHECK_CONDITION or QUEUE FULL status. + ** Contents are IDENTIFY and SIMPLE_TAG. + ** While negotiating sync or wide transfer, + ** a SDTR or WDTR message is appended. + **---------------------------------------------------------------- + */ + u_char scsi_smsg [8]; + u_char scsi_smsg2[8]; + + /*---------------------------------------------------------------- + ** Other fields. + **---------------------------------------------------------------- + */ + u_long p_ccb; /* BUS address of this CCB */ + u_char sensecmd[6]; /* Sense command */ + u_char tag; /* Tag for this transfer */ + /* 255 means no tag */ + u_char target; + u_char lun; + u_char queued; + u_char auto_sense; + ccb_p link_ccb; /* Host adapter CCB chain */ + ccb_p link_ccbh; /* Host adapter CCB hash chain */ + XPT_QUEHEAD link_ccbq; /* Link to unit CCB queue */ + u_int32 startp; /* Initial data pointer */ +}; + +#define CCB_PHYS(cp,lbl) (cp->p_ccb + offsetof(struct ccb, lbl)) + + +/*======================================================================== +** +** Declaration of structs: NCR device descriptor +** +**======================================================================== +*/ +struct ncb { + /*---------------------------------------------------------------- + ** Idle task and invalid task actions and their bus + ** addresses. + **---------------------------------------------------------------- + */ + struct action idletask; + struct action notask; + struct action bad_i_t_l; + struct action bad_i_t_l_q; + u_long p_idletask; + u_long p_notask; + u_long p_bad_i_t_l; + u_long p_bad_i_t_l_q; + + /*---------------------------------------------------------------- + ** Dummy lun table to protect us against target returning bad + ** lun number on reselection. + **---------------------------------------------------------------- + */ + u_int32 *badluntbl; /* Table physical address */ + u_int32 resel_badlun; /* SCRIPT handler BUS address */ + + /*---------------------------------------------------------------- + ** Bit 32-63 of the on-chip RAM bus address in LE format. + ** The START_RAM64 script loads the MMRS and MMWS from this + ** field. + **---------------------------------------------------------------- + */ + u_int32 scr_ram_seg; + + /*---------------------------------------------------------------- + ** CCBs management queues. + **---------------------------------------------------------------- + */ + Scsi_Cmnd *waiting_list; /* Commands waiting for a CCB */ + /* when lcb is not allocated. */ + Scsi_Cmnd *done_list; /* Commands waiting for done() */ + /* callback to be invoked. */ +#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,93) + spinlock_t smp_lock; /* Lock for SMP threading */ +#endif + + /*---------------------------------------------------------------- + ** Chip and controller indentification. + **---------------------------------------------------------------- + */ + int unit; /* Unit number */ + char chip_name[8]; /* Chip name */ + char inst_name[16]; /* ncb instance name */ + + /*---------------------------------------------------------------- + ** Initial value of some IO register bits. + ** These values are assumed to have been set by BIOS, and may + ** be used for probing adapter implementation differences. + **---------------------------------------------------------------- + */ + u_char sv_scntl0, sv_scntl3, sv_dmode, sv_dcntl, sv_ctest3, sv_ctest4, + sv_ctest5, sv_gpcntl, sv_stest2, sv_stest4; + + /*---------------------------------------------------------------- + ** Actual initial value of IO register bits used by the + ** driver. They are loaded at initialisation according to + ** features that are to be enabled. + **---------------------------------------------------------------- + */ + u_char rv_scntl0, rv_scntl3, rv_dmode, rv_dcntl, rv_ctest3, rv_ctest4, + rv_ctest5, rv_stest2, rv_ccntl0, rv_ccntl1; + + /*---------------------------------------------------------------- + ** Target data. + ** Target control block bus address array used by the SCRIPT + ** on reselection. + **---------------------------------------------------------------- + */ + struct tcb target[MAX_TARGET]; + u_int32 *targtbl; + + /*---------------------------------------------------------------- + ** Virtual and physical bus addresses of the chip. + **---------------------------------------------------------------- + */ + u_long base_va; /* MMIO base virtual address */ + u_long base_ba; /* MMIO base bus address */ + u_long base_io; /* IO space base address */ + u_long base_ws; /* (MM)IO window size */ + u_long base2_ba; /* On-chip RAM bus address. */ + u_int irq; /* IRQ number */ + volatile /* Pointer to volatile for */ + struct ncr_reg *reg; /* memory mapped IO. */ + + /*---------------------------------------------------------------- + ** SCRIPTS virtual and physical bus addresses. + ** 'script' is loaded in the on-chip RAM if present. + ** 'scripth' stays in main memory for all chips except the + ** 53C896 that provides 8K on-chip RAM. + **---------------------------------------------------------------- + */ + struct script *script0; /* Copies of script and scripth */ + struct scripth *scripth0; /* relocated for this ncb. */ + u_long p_script; /* Actual script and scripth */ + u_long p_scripth; /* bus addresses. */ + u_long p_scripth0; + + /*---------------------------------------------------------------- + ** General controller parameters and configuration. + **---------------------------------------------------------------- + */ + u_short device_id; /* PCI device id */ + u_char revision_id; /* PCI device revision id */ + u_int features; /* Chip features map */ + u_char myaddr; /* SCSI id of the adapter */ + u_char maxburst; /* log base 2 of dwords burst */ + u_char maxwide; /* Maximum transfer width */ + u_char minsync; /* Minimum sync period factor */ + u_char maxsync; /* Maximum sync period factor */ + u_char maxoffs; /* Max scsi offset */ + u_char multiplier; /* Clock multiplier (1,2,4) */ + u_char clock_divn; /* Number of clock divisors */ + u_long clock_khz; /* SCSI clock frequency in KHz */ + + /*---------------------------------------------------------------- + ** Start queue management. + ** It is filled up by the host processor and accessed by the + ** SCRIPTS processor in order to start SCSI commands. + **---------------------------------------------------------------- + */ + u_int32 *squeue; /* Start queue */ + u_short squeueput; /* Next free slot of the queue */ + u_short actccbs; /* Number of allocated CCBs */ + u_short queuedepth; /* Start queue depth */ + + /*---------------------------------------------------------------- + ** Command completion queue. + ** It is the same size as the start queue to avoid overflow. + **---------------------------------------------------------------- + */ + u_short dqueueget; /* Next position to scan */ + u_int32 *dqueue; /* Completion (done) queue */ + + /*---------------------------------------------------------------- + ** Timeout handler. + **---------------------------------------------------------------- + */ + struct timer_list timer; /* Timer handler link header */ + u_long lasttime; + u_long settle_time; /* Resetting the SCSI BUS */ + + /*---------------------------------------------------------------- + ** Debugging and profiling. + **---------------------------------------------------------------- + */ + struct ncr_reg regdump; /* Register dump */ + u_long regtime; /* Time it has been done */ +#ifdef SCSI_NCR_PROFILE_SUPPORT + struct profile profile; /* Profiling data */ +#endif + + /*---------------------------------------------------------------- + ** Miscellaneous buffers accessed by the scripts-processor. + ** They shall be DWORD aligned, because they may be read or + ** written with a script command. + **---------------------------------------------------------------- + */ + u_char msgout[8]; /* Buffer for MESSAGE OUT */ + u_char msgin [8]; /* Buffer for MESSAGE IN */ + u_int32 lastmsg; /* Last SCSI message sent */ + u_char scratch; /* Scratch for SCSI receive */ + + /*---------------------------------------------------------------- + ** Miscellaneous configuration and status parameters. + **---------------------------------------------------------------- + */ + u_char scsi_mode; /* Current SCSI BUS mode */ + u_char order; /* Tag order to use */ + u_char verbose; /* Verbosity for this controller*/ + u_int32 ncr_cache; /* Used for cache test at init. */ + + /*---------------------------------------------------------------- + ** CCB lists and queue. + **---------------------------------------------------------------- + */ + ccb_p ccbh[CCB_HASH_SIZE]; /* CCB hashed by DSA value */ + struct ccb *ccbc; /* CCB chain */ + XPT_QUEHEAD free_ccbq; /* Queue of available CCBs */ + + /*---------------------------------------------------------------- + ** We need the LCB in order to handle disconnections and + ** to count active CCBs for task management. So, we use + ** a unique CCB for LUNs we donnot have the LCB yet. + ** This queue normally should have at most 1 element. + **---------------------------------------------------------------- + */ + XPT_QUEHEAD b0_ccbq; + + /*---------------------------------------------------------------- + ** We use a different scatter function for 896 rev 1. + **---------------------------------------------------------------- + */ + int (*scatter) (ccb_p, Scsi_Cmnd *); + + /*---------------------------------------------------------------- + ** Fields that should be removed or changed. + **---------------------------------------------------------------- + */ + struct usrcmd user; /* Command from user */ + u_char release_stage; /* Synchronisation stage on release */ +}; + +#define NCB_SCRIPT_PHYS(np,lbl) (np->p_script + offsetof (struct script, lbl)) +#define NCB_SCRIPTH_PHYS(np,lbl) (np->p_scripth + offsetof (struct scripth,lbl)) +#define NCB_SCRIPTH0_PHYS(np,lbl) (np->p_scripth0+offsetof (struct scripth,lbl)) + +/*========================================================== +** +** +** Script for NCR-Processor. +** +** Use ncr_script_fill() to create the variable parts. +** Use ncr_script_copy_and_bind() to make a copy and +** bind to physical addresses. +** +** +**========================================================== +** +** We have to know the offsets of all labels before +** we reach them (for forward jumps). +** Therefore we declare a struct here. +** If you make changes inside the script, +** DONT FORGET TO CHANGE THE LENGTHS HERE! +** +**---------------------------------------------------------- +*/ + +/* +** Script fragments which are loaded into the on-chip RAM +** of 825A, 875, 876, 895 and 896 chips. +*/ +struct script { + ncrcmd start [ 10]; + ncrcmd getjob_begin [ 4]; + ncrcmd getjob_end [ 4]; + ncrcmd select [ 4]; + ncrcmd wf_sel_done [ 2]; + ncrcmd send_ident [ 2]; + ncrcmd select2 [ 6]; + ncrcmd command [ 2]; + ncrcmd dispatch [ 26]; + ncrcmd sel_no_cmd [ 10]; + ncrcmd init [ 6]; + ncrcmd clrack [ 4]; + ncrcmd databreak [ 2]; +#ifdef SCSI_NCR_PROFILE_SUPPORT + ncrcmd dataphase [ 4]; +#else + ncrcmd dataphase [ 2]; +#endif + ncrcmd status [ 8]; + ncrcmd msg_in [ 2]; + ncrcmd msg_in2 [ 16]; + ncrcmd msg_bad [ 6]; + ncrcmd complete [ 8]; + ncrcmd complete2 [ 6]; + ncrcmd done [ 14]; + ncrcmd done_end [ 2]; + ncrcmd save_dp [ 8]; + ncrcmd restore_dp [ 4]; +#ifdef SCSI_NCR_PROFILE_SUPPORT + ncrcmd disconnect [ 32]; +#else + ncrcmd disconnect [ 20]; +#endif + ncrcmd idle [ 2]; + ncrcmd ungetjob [ 4]; + ncrcmd reselect [ 4]; + ncrcmd reselected [ 44]; + ncrcmd resel_tag [ 6]; + ncrcmd resel_go [ 6]; + ncrcmd resel_notag [ 4]; + ncrcmd resel_dsa [ 8]; + ncrcmd data_in [MAX_SCATTERL * SCR_SG_SIZE]; + ncrcmd data_in2 [ 4]; + ncrcmd data_out [MAX_SCATTERL * SCR_SG_SIZE]; + ncrcmd data_out2 [ 4]; + ncrcmd pm0_data [ 16]; + ncrcmd pm1_data [ 16]; + + /* Data area */ + ncrcmd saved_dsa [ 1]; + ncrcmd done_pos [ 1]; + ncrcmd startpos [ 1]; + ncrcmd targtbl [ 1]; +}; + +/* +** Script fragments which stay in main memory for all chips +** except for the 896 that support 8K on-chip RAM. +*/ +struct scripth { + ncrcmd start64 [ 2]; + ncrcmd select_no_atn [ 4]; + ncrcmd wf_sel_done_no_atn [ 4]; + ncrcmd cancel [ 4]; + ncrcmd msg_reject [ 8]; + ncrcmd msg_ign_residue [ 24]; + ncrcmd msg_extended [ 10]; + ncrcmd msg_ext_2 [ 10]; + ncrcmd msg_wdtr [ 14]; + ncrcmd send_wdtr [ 4]; + ncrcmd msg_ext_3 [ 10]; + ncrcmd msg_sdtr [ 14]; + ncrcmd send_sdtr [ 4]; + ncrcmd nego_bad_phase [ 4]; + ncrcmd msg_out_abort [ 12]; + ncrcmd msg_out [ 6]; + ncrcmd msg_out_done [ 4]; + ncrcmd no_data [ 16]; +#if MAX_SCATTERH != 0 + ncrcmd hdata_in [MAX_SCATTERH * SCR_SG_SIZE]; + ncrcmd hdata_in2 [ 2]; + ncrcmd hdata_out [MAX_SCATTERH * SCR_SG_SIZE]; + ncrcmd hdata_out2 [ 2]; +#endif + ncrcmd abort_resel [ 16]; + ncrcmd resend_ident [ 4]; + ncrcmd ident_break [ 4]; + ncrcmd ident_break_atn [ 4]; + ncrcmd sdata_in [ 6]; + ncrcmd data_io [ 2]; + ncrcmd data_io_com [ 8]; + ncrcmd data_io_out [ 10]; + ncrcmd bad_identify [ 12]; + ncrcmd bad_i_t_l [ 4]; + ncrcmd bad_i_t_l_q [ 4]; + ncrcmd bad_status [ 10]; + ncrcmd tweak_pmj [ 12]; + ncrcmd pm_handle [ 20]; + ncrcmd pm_handle1 [ 4]; + ncrcmd pm_save [ 4]; + ncrcmd pm0_save [ 10]; + ncrcmd pm1_save [ 10]; + + /* Data area */ + ncrcmd pm0_data_addr [ 1]; + ncrcmd pm1_data_addr [ 1]; + /* End of data area */ + + ncrcmd start_ram [ 1]; + ncrcmd script0_ba [ 4]; + + ncrcmd start_ram64 [ 3]; + ncrcmd script0_ba64 [ 3]; + ncrcmd scripth0_ba64 [ 6]; + ncrcmd ram_seg64 [ 1]; + + ncrcmd snooptest [ 6]; + ncrcmd snoopend [ 2]; +}; + +/*========================================================== +** +** +** Function headers. +** +** +**========================================================== +*/ + +static ccb_p ncr_alloc_ccb (ncb_p np); +static void ncr_complete (ncb_p np, ccb_p cp); +static void ncr_exception (ncb_p np); +static void ncr_free_ccb (ncb_p np, ccb_p cp); +static ccb_p ncr_ccb_from_dsa(ncb_p np, u_long dsa); +static void ncr_init_tcb (ncb_p np, u_char tn); +static lcb_p ncr_alloc_lcb (ncb_p np, u_char tn, u_char ln); +static lcb_p ncr_setup_lcb (ncb_p np, u_char tn, u_char ln, + u_char *inq_data); +static void ncr_getclock (ncb_p np, int mult); +static void ncr_selectclock (ncb_p np, u_char scntl3); +static ccb_p ncr_get_ccb (ncb_p np, u_char tn, u_char ln); +static void ncr_init (ncb_p np, int reset, char * msg, u_long code); +static void ncr_int_sbmc (ncb_p np); +static void ncr_int_par (ncb_p np, u_short sist); +static void ncr_int_ma (ncb_p np); +static void ncr_int_sir (ncb_p np); +static void ncr_int_sto (ncb_p np); +static void ncr_int_udc (ncb_p np); +static u_long ncr_lookup (char* id); +static void ncr_negotiate (struct ncb* np, struct tcb* tp); +#ifdef SCSI_NCR_PROFILE_SUPPORT +static void ncb_profile (ncb_p np, ccb_p cp); +#endif +static void ncr_script_copy_and_bind + (ncb_p np, ncrcmd *src, ncrcmd *dst, int len); +static void ncr_script_fill (struct script * scr, struct scripth * scripth); +static int ncr_scatter_896R1 (ccb_p cp, Scsi_Cmnd *cmd); +static int ncr_scatter (ccb_p cp, Scsi_Cmnd *cmd); +static void ncr_getsync (ncb_p np, u_char sfac, u_char *fakp, u_char *scntl3p); +static void ncr_setsync (ncb_p np, ccb_p cp, u_char scntl3, u_char sxfer); +static void ncr_setup_tags (ncb_p np, u_char tn, u_char ln); +static void ncr_setwide (ncb_p np, ccb_p cp, u_char wide, u_char ack); +static int ncr_show_msg (u_char * msg); +static int ncr_snooptest (ncb_p np); +static void ncr_timeout (ncb_p np); +static void ncr_wakeup (ncb_p np, u_long code); +static int ncr_wakeup_done (ncb_p np); +static void ncr_start_next_ccb (ncb_p np, lcb_p lp, int maxn); +static void ncr_put_start_queue(ncb_p np, ccb_p cp); +static void ncr_soft_reset (ncb_p np); +static void ncr_start_reset (ncb_p np); +static int ncr_reset_scsi_bus (ncb_p np, int enab_int, int settle_delay); + +#ifdef SCSI_NCR_USER_COMMAND_SUPPORT +static void ncr_usercmd (ncb_p np); +#endif + +static int ncr_attach (Scsi_Host_Template *tpnt, int unit, ncr_device *device); +static void ncr_free_resources(ncb_p np); + +static void insert_into_waiting_list(ncb_p np, Scsi_Cmnd *cmd); +static Scsi_Cmnd *retrieve_from_waiting_list(int to_remove, ncb_p np, Scsi_Cmnd *cmd); +static void process_waiting_list(ncb_p np, int sts); + +#define remove_from_waiting_list(np, cmd) \ + retrieve_from_waiting_list(1, (np), (cmd)) +#define requeue_waiting_list(np) process_waiting_list((np), DID_OK) +#define reset_waiting_list(np) process_waiting_list((np), DID_RESET) + +#ifdef SCSI_NCR_NVRAM_SUPPORT +static void ncr_get_nvram (ncr_device *devp, ncr_nvram *nvp); +static int ncr_get_Symbios_nvram (ncr_slot *np, Symbios_nvram *nvram); +static int ncr_get_Tekram_nvram (ncr_slot *np, Tekram_nvram *nvram); +#endif + +/*========================================================== +** +** +** Global static data. +** +** +**========================================================== +*/ + +static inline char *ncr_name (ncb_p np) +{ + return np->inst_name; +} + + +/*========================================================== +** +** +** Scripts for NCR-Processor. +** +** Use ncr_script_bind for binding to physical addresses. +** +** +**========================================================== +** +** NADDR generates a reference to a field of the controller data. +** PADDR generates a reference to another part of the script. +** RADDR generates a reference to a script processor register. +** FADDR generates a reference to a script processor register +** with offset. +** +**---------------------------------------------------------- +*/ + +#define RELOC_SOFTC 0x40000000 +#define RELOC_LABEL 0x50000000 +#define RELOC_REGISTER 0x60000000 +#if 0 +#define RELOC_KVAR 0x70000000 +#endif +#define RELOC_LABELH 0x80000000 +#define RELOC_MASK 0xf0000000 + +#define NADDR(label) (RELOC_SOFTC | offsetof(struct ncb, label)) +#define PADDR(label) (RELOC_LABEL | offsetof(struct script, label)) +#define PADDRH(label) (RELOC_LABELH | offsetof(struct scripth, label)) +#define RADDR(label) (RELOC_REGISTER | REG(label)) +#define FADDR(label,ofs)(RELOC_REGISTER | ((REG(label))+(ofs))) +#define KVAR(which) (RELOC_KVAR | (which)) + +#define SCR_DATA_ZERO 0xf00ff00f + +#ifdef RELOC_KVAR +#define SCRIPT_KVAR_JIFFIES (0) +#define SCRIPT_KVAR_FIRST SCRIPT_KVAR_JIFFIES +#define SCRIPT_KVAR_LAST SCRIPT_KVAR_JIFFIES +/* + * Kernel variables referenced in the scripts. + * THESE MUST ALL BE ALIGNED TO A 4-BYTE BOUNDARY. + */ +static void *script_kvars[] __initdata = + { (void *)&jiffies }; +#endif + +static struct script script0 __initdata = { +/*--------------------------< START >-----------------------*/ { + /* + ** This NOP will be patched with LED ON + ** SCR_REG_REG (gpreg, SCR_AND, 0xfe) + */ + SCR_NO_OP, + 0, + /* + ** Clear SIGP. + */ + SCR_FROM_REG (ctest2), + 0, + /* + ** Start the next job. + ** + ** @DSA = start point for this job. + ** SCRATCHA = address of this job in the start queue. + ** + ** We will restore startpos with SCRATCHA if we fails the + ** arbitration or if it is the idle job. + ** + ** The below GETJOB_BEGIN to GETJOB_END section of SCRIPTS + ** is a critical path. If it is partially executed, it then + ** may happen that the job address is not yet in the DSA + ** and the the next queue position points to the next JOB. + */ + SCR_LOAD_ABS (scratcha, 4), + PADDR (startpos), + SCR_LOAD_ABS (dsa, 4), + PADDR (startpos), + SCR_LOAD_REL (temp, 4), + 4, +}/*-------------------------< GETJOB_BEGIN >------------------*/,{ + SCR_STORE_ABS (temp, 4), + PADDR (startpos), + SCR_LOAD_REL (dsa, 4), + 0, +}/*-------------------------< GETJOB_END >--------------------*/,{ + SCR_LOAD_REL (temp, 4), + 0, + SCR_RETURN, + 0, + +}/*-------------------------< SELECT >----------------------*/,{ + /* + ** DSA contains the address of a scheduled + ** data structure. + ** + ** SCRATCHA contains the address of the start queue + ** entry which points to the next job. + ** + ** Set Initiator mode. + ** + ** (Target mode is left as an exercise for the reader) + */ + + SCR_CLR (SCR_TRG), + 0, + /* + ** And try to select this target. + */ + SCR_SEL_TBL_ATN ^ offsetof (struct dsb, select), + PADDR (ungetjob), + /* + ** Now there are 4 possibilities: + ** + ** (1) The ncr looses arbitration. + ** This is ok, because it will try again, + ** when the bus becomes idle. + ** (But beware of the timeout function!) + ** + ** (2) The ncr is reselected. + ** Then the script processor takes the jump + ** to the RESELECT label. + ** + ** (3) The ncr wins arbitration. + ** Then it will execute SCRIPTS instruction until + ** the next instruction that checks SCSI phase. + ** Then will stop and wait for selection to be + ** complete or selection time-out to occur. + ** + ** After having won arbitration, the ncr SCRIPTS + ** processor is able to execute instructions while + ** the SCSI core is performing SCSI selection. But + ** some script instruction that is not waiting for + ** a valid phase (or selection timeout) to occur + ** breaks the selection procedure, by probably + ** affecting timing requirements. + ** So we have to wait immediately for the next phase + ** or the selection to complete or time-out. + */ +}/*-------------------------< WF_SEL_DONE >----------------------*/,{ + SCR_INT ^ IFFALSE (WHEN (SCR_MSG_OUT)), + SIR_SEL_ATN_NO_MSG_OUT, +}/*-------------------------< SEND_IDENT >----------------------*/,{ + /* + ** Selection complete. + ** Send the IDENTIFY and SIMPLE_TAG messages + ** (and the M_X_SYNC_REQ / M_X_WIDE_REQ message) + */ + SCR_MOVE_TBL ^ SCR_MSG_OUT, + offsetof (struct dsb, smsg), +}/*-------------------------< SELECT2 >----------------------*/,{ + /* + ** load the savep (saved pointer) into + ** the actual data pointer. + */ + SCR_LOAD_REL (temp, 4), + offsetof (struct ccb, phys.header.savep), + /* + ** Initialize the status registers + */ + SCR_LOAD_REL (scr0, 4), + offsetof (struct ccb, phys.header.status), + /* + ** Anticipate the COMMAND phase. + ** This is the PHASE we expect at this point. + */ + SCR_JUMP ^ IFFALSE (WHEN (SCR_COMMAND)), + PADDR (sel_no_cmd), + +}/*-------------------------< COMMAND >--------------------*/,{ + /* + ** ... and send the command + */ + SCR_MOVE_TBL ^ SCR_COMMAND, + offsetof (struct dsb, cmd), + +}/*-----------------------< DISPATCH >----------------------*/,{ + /* + ** MSG_IN is the only phase that shall be + ** entered at least once for each (re)selection. + ** So we test it first. + */ + SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_IN)), + PADDR (msg_in), + SCR_JUMP ^ IFTRUE (IF (SCR_DATA_OUT)), + PADDR (dataphase), + SCR_JUMP ^ IFTRUE (IF (SCR_DATA_IN)), + PADDR (dataphase), + SCR_JUMP ^ IFTRUE (IF (SCR_STATUS)), + PADDR (status), + SCR_JUMP ^ IFTRUE (IF (SCR_COMMAND)), + PADDR (command), + SCR_JUMP ^ IFTRUE (IF (SCR_MSG_OUT)), + PADDRH (msg_out), + /* + ** Discard one illegal phase byte, if required. + */ + SCR_LOAD_REG (scratcha, XE_BAD_PHASE), + 0, + SCR_STORE_REL (scratcha, 1), + offsetof (struct ccb, xerr_status), + SCR_JUMPR ^ IFFALSE (IF (SCR_ILG_OUT)), + 8, + SCR_MOVE_ABS (1) ^ SCR_ILG_OUT, + NADDR (scratch), + SCR_JUMPR ^ IFFALSE (IF (SCR_ILG_IN)), + 8, + SCR_MOVE_ABS (1) ^ SCR_ILG_IN, + NADDR (scratch), + SCR_JUMP, + PADDR (dispatch), + +}/*---------------------< SEL_NO_CMD >----------------------*/,{ + /* + ** The target does not switch to command + ** phase after IDENTIFY has been sent. + ** + ** If it stays in MSG OUT phase send it + ** the IDENTIFY again. + */ + SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_OUT)), + PADDRH (resend_ident), + /* + ** If target does not switch to MSG IN phase + ** and we sent a negotiation, assert the + ** failure immediately. + */ + SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_IN)), + PADDR (dispatch), + SCR_FROM_REG (HS_REG), + 0, + SCR_INT ^ IFTRUE (DATA (HS_NEGOTIATE)), + SIR_NEGO_FAILED, + /* + ** Jump to dispatcher. + */ + SCR_JUMP, + PADDR (dispatch), + +}/*-------------------------< INIT >------------------------*/,{ + /* + ** Wait for the SCSI RESET signal to be + ** inactive before restarting operations, + ** since the chip may hang on SEL_ATN + ** if SCSI RESET is active. + */ + SCR_FROM_REG (sstat0), + 0, + SCR_JUMPR ^ IFTRUE (MASK (IRST, IRST)), + -8, + SCR_JUMP, + PADDR (start), +}/*-------------------------< CLRACK >----------------------*/,{ + /* + ** Terminate possible pending message phase. + */ + SCR_CLR (SCR_ACK), + 0, + SCR_JUMP, + PADDR (dispatch), + +}/*-------------------------< DATABREAK >-------------------*/,{ + /* + ** Jump to dispatcher. + */ + SCR_JUMP, + PADDR (dispatch), + +}/*-------------------------< DATAPHASE >------------------*/,{ +#ifdef SCSI_NCR_PROFILE_SUPPORT + SCR_REG_REG (HF_REG, SCR_OR, HF_DATA_ST), + 0, +#endif + SCR_RETURN, + 0, + +}/*-------------------------< STATUS >--------------------*/,{ + /* + ** get the status + */ + SCR_MOVE_ABS (1) ^ SCR_STATUS, + NADDR (scratch), + /* + ** save status to scsi_status. + ** mark as complete. + */ + SCR_TO_REG (SS_REG), + 0, + SCR_LOAD_REG (HS_REG, HS_COMPLETE), + 0, + SCR_JUMP, + PADDR (dispatch), +}/*-------------------------< MSG_IN >--------------------*/,{ + /* + ** Get the first byte of the message. + ** + ** The script processor doesn't negate the + ** ACK signal after this transfer. + */ + SCR_MOVE_ABS (1) ^ SCR_MSG_IN, + NADDR (msgin[0]), +}/*-------------------------< MSG_IN2 >--------------------*/,{ + /* + ** Handle this message. + */ + SCR_JUMP ^ IFTRUE (DATA (M_COMPLETE)), + PADDR (complete), + SCR_JUMP ^ IFTRUE (DATA (M_DISCONNECT)), + PADDR (disconnect), + SCR_JUMP ^ IFTRUE (DATA (M_SAVE_DP)), + PADDR (save_dp), + SCR_JUMP ^ IFTRUE (DATA (M_RESTORE_DP)), + PADDR (restore_dp), + SCR_JUMP ^ IFTRUE (DATA (M_EXTENDED)), + PADDRH (msg_extended), + SCR_JUMP ^ IFTRUE (DATA (M_NOOP)), + PADDR (clrack), + SCR_JUMP ^ IFTRUE (DATA (M_REJECT)), + PADDRH (msg_reject), + SCR_JUMP ^ IFTRUE (DATA (M_IGN_RESIDUE)), + PADDRH (msg_ign_residue), + /* + ** Rest of the messages left as + ** an exercise ... + ** + ** Unimplemented messages: + ** fall through to MSG_BAD. + */ +}/*-------------------------< MSG_BAD >------------------*/,{ + /* + ** unimplemented message - reject it. + */ + SCR_INT, + SIR_REJECT_TO_SEND, + SCR_SET (SCR_ATN), + 0, + SCR_JUMP, + PADDR (clrack), + +}/*-------------------------< COMPLETE >-----------------*/,{ + /* + ** Complete message. + ** + ** Copy the data pointer to LASTP in header. + */ + SCR_STORE_REL (temp, 4), + offsetof (struct ccb, phys.header.lastp), + /* + ** When we terminate the cycle by clearing ACK, + ** the target may disconnect immediately. + ** + ** We don't want to be told of an + ** "unexpected disconnect", + ** so we disable this feature. + */ + SCR_REG_REG (scntl2, SCR_AND, 0x7f), + 0, + /* + ** Terminate cycle ... + */ + SCR_CLR (SCR_ACK|SCR_ATN), + 0, + /* + ** ... and wait for the disconnect. + */ + SCR_WAIT_DISC, + 0, +}/*-------------------------< COMPLETE2 >-----------------*/,{ + /* + ** Save host status to header. + */ + SCR_STORE_REL (scr0, 4), + offsetof (struct ccb, phys.header.status), + + /* + ** If command resulted in not GOOD status, + ** call the C code if needed. + */ + SCR_FROM_REG (SS_REG), + 0, + SCR_CALL ^ IFFALSE (DATA (S_GOOD)), + PADDRH (bad_status), + +}/*------------------------< DONE >-----------------*/,{ + /* + ** Copy the DSA to the DONE QUEUE and + ** signal completion to the host. + ** If we are interrupted between DONE + ** and DONE_END, we must reset, otherwise + ** the completed CCB will be lost. + */ + SCR_STORE_ABS (dsa, 4), + PADDR (saved_dsa), + SCR_LOAD_ABS (dsa, 4), + PADDR (done_pos), + SCR_LOAD_ABS (scratcha, 4), + PADDR(saved_dsa), + SCR_STORE_REL (scratcha, 4), + 0, + /* + ** The instruction below reads the DONE QUEUE next + ** free position from memory. + ** In addition it ensures that all PCI posted writes + ** are flushed and so the DSA value of the done + ** CCB is visible by the CPU before INTFLY is raised. + */ + SCR_LOAD_REL (temp, 4), + 4, + SCR_INT_FLY, + 0, + SCR_STORE_ABS (temp, 4), + PADDR (done_pos), +}/*------------------------< DONE_END >-----------------*/,{ + SCR_JUMP, + PADDR (start), + +}/*-------------------------< SAVE_DP >------------------*/,{ + /* + ** Clear ACK immediately. + ** No need to delay it. + */ + SCR_CLR (SCR_ACK), + 0, + /* + ** Keep track we received a SAVE DP, so + ** we will switch to the other PM context + ** on the next PM since the DP may point + ** to the current PM context. + */ + SCR_REG_REG (HF_REG, SCR_OR, HF_DP_SAVED), + 0, + /* + ** SAVE_DP message: + ** Copy the data pointer to SAVEP in header. + */ + SCR_STORE_REL (temp, 4), + offsetof (struct ccb, phys.header.savep), + SCR_JUMP, + PADDR (dispatch), +}/*-------------------------< RESTORE_DP >---------------*/,{ + /* + ** RESTORE_DP message: + ** Copy SAVEP in header to actual data pointer. + */ + SCR_LOAD_REL (temp, 4), + offsetof (struct ccb, phys.header.savep), + SCR_JUMP, + PADDR (clrack), + +}/*-------------------------< DISCONNECT >---------------*/,{ + /* + ** DISCONNECTing ... + ** + ** disable the "unexpected disconnect" feature, + ** and remove the ACK signal. + */ + SCR_REG_REG (scntl2, SCR_AND, 0x7f), + 0, + SCR_CLR (SCR_ACK|SCR_ATN), + 0, + /* + ** Wait for the disconnect. + */ + SCR_WAIT_DISC, + 0, +#ifdef SCSI_NCR_PROFILE_SUPPORT + /* + ** Count the disconnects. + ** Disconnect without DATA PHASE having been + ** entered are counted in bits 8..15. + */ + SCR_LOAD_REL (scratcha, 4), + offsetof (struct ccb, phys.num_disc), + SCR_FROM_REG (HF_REG), + 0, + SCR_JUMPR ^ IFTRUE (MASK (HF_DATA_ST, HF_DATA_ST)), + 8, + SCR_REG_REG (scratcha1, SCR_ADD, 0x01), + 0, + SCR_REG_REG (scratcha, SCR_ADD, 0x01), + 0, + SCR_STORE_REL (scratcha, 4), + offsetof (struct ccb, phys.num_disc), +#endif + /* + ** Status is: DISCONNECTED. + */ + SCR_LOAD_REG (HS_REG, HS_DISCONNECT), + 0, + /* + ** Save host status to header. + */ + SCR_STORE_REL (scr0, 4), + offsetof (struct ccb, phys.header.status), + /* + ** If QUIRK_AUTOSAVE is set, + ** do an "save pointer" operation. + */ + SCR_FROM_REG (QU_REG), + 0, + SCR_JUMP ^ IFFALSE (MASK (QUIRK_AUTOSAVE, QUIRK_AUTOSAVE)), + PADDR (start), + /* + ** like SAVE_DP message: + ** Remember we saved the data pointer. + ** Copy data pointer to SAVEP in header. + */ + SCR_REG_REG (HF_REG, SCR_OR, HF_DP_SAVED), + 0, + SCR_STORE_REL (temp, 4), + offsetof (struct ccb, phys.header.savep), + SCR_JUMP, + PADDR (start), + +}/*-------------------------< IDLE >------------------------*/,{ + /* + ** Nothing to do? + ** Wait for reselect. + ** This NOP will be patched with LED OFF + ** SCR_REG_REG (gpreg, SCR_OR, 0x01) + */ + SCR_NO_OP, + 0, +}/*-------------------------< UNGETJOB >-----------------*/,{ + /* + ** We are not able to restart the SCRIPTS if we are + ** interrupted and these instruction haven't been + ** all executed. BTW, this is very unlikely to + ** happen, but we check that from the C code. + */ + SCR_LOAD_REG (dsa, 0xff), + 0, + SCR_STORE_ABS (scratcha, 4), + PADDR (startpos), +}/*-------------------------< RESELECT >--------------------*/,{ + /* + ** make the host status invalid. + */ + SCR_CLR (SCR_TRG), + 0, + /* + ** Sleep waiting for a reselection. + ** If SIGP is set, special treatment. + ** + ** Zu allem bereit .. + */ + SCR_WAIT_RESEL, + PADDR(start), +}/*-------------------------< RESELECTED >------------------*/,{ + /* + ** This NOP will be patched with LED ON + ** SCR_REG_REG (gpreg, SCR_AND, 0xfe) + */ + SCR_NO_OP, + 0, + /* + ** load the target id into the sdid + */ + SCR_REG_SFBR (ssid, SCR_AND, 0x8F), + 0, + SCR_TO_REG (sdid), + 0, + /* + ** load the target control block address + */ + SCR_LOAD_ABS (dsa, 4), + PADDR (targtbl), + SCR_SFBR_REG (dsa, SCR_SHL, 0), + 0, + SCR_REG_REG (dsa, SCR_SHL, 0), + 0, + SCR_REG_REG (dsa, SCR_AND, 0x3c), + 0, + SCR_LOAD_REL (dsa, 4), + 0, + /* + ** Load the synchronous transfer registers. + */ + SCR_LOAD_REL (scntl3, 1), + offsetof(struct tcb, wval), + SCR_LOAD_REL (sxfer, 1), + offsetof(struct tcb, sval), + /* + ** If MESSAGE IN phase as expected, + ** read the data directly from the BUS DATA lines. + ** This helps to support very old SCSI devices that + ** may reselect without sending an IDENTIFY. + */ + SCR_INT ^ IFFALSE (WHEN (SCR_MSG_IN)), + SIR_RESEL_NO_MSG_IN, + SCR_FROM_REG (sbdl), + 0, + /* + ** If message phase but not an IDENTIFY, + ** get some help from the C code. + ** Old SCSI device may behave so. + */ + SCR_INT ^ IFFALSE (MASK (0x80, 0x80)), + SIR_RESEL_NO_IDENTIFY, + /* + ** It is an IDENTIFY message, + ** Load the LUN control block address. + ** Avoid nasty address calculation if LUN #0. + */ + SCR_LOAD_REL (dsa, 4), + offsetof(struct tcb, b_luntbl), + SCR_JUMPR ^ IFTRUE (MASK (0x0, 0x3f)), + 24, + SCR_SFBR_REG (dsa, SCR_SHL, 0), + 0, + SCR_REG_REG (dsa, SCR_SHL, 0), + 0, + SCR_REG_REG (dsa, SCR_AND, 0xfc), + 0, + SCR_LOAD_REL (dsa, 4), + 0, + /* + ** Load the reselect task action for this LUN. + ** Load the tasks DSA array for this LUN. + ** Call the action. + */ + SCR_LOAD_REL (temp, 4), + offsetof(struct lcb, resel_task), + SCR_LOAD_REL (dsa, 4), + offsetof(struct lcb, b_tasktbl), + SCR_RETURN, + 0, + +}/*-------------------------< RESEL_TAG >-------------------*/,{ + /* + ** Read IDENTIFY + SIMPLE + TAG using a single MOVE. + ** Agressive optimization, is'nt it? + ** No need to test the SIMPLE TAG message, since the + ** driver only supports conformant devices for tags. ;-) + */ + SCR_MOVE_ABS (3) ^ SCR_MSG_IN, + NADDR (msgin), + /* + ** Read the TAG from the SIDL. + ** Still an aggressive optimization. ;-) + ** Compute the CCB indirect jump address which + ** is (#TAG*2 & 0xfc) due to tag numbering using + ** 1,3,5..MAXTAGS*2+1 actual values. + */ + SCR_REG_SFBR (sidl, SCR_SHL, 0), + 0, + /* + ** Retrieve the DSA of this task. + ** JUMP indirectly to the restart point of the CCB. + */ + SCR_SFBR_REG (dsa, SCR_AND, 0xfc), + 0, +}/*-------------------------< RESEL_GO >-------------------*/,{ + SCR_LOAD_REL (dsa, 4), + 0, + SCR_LOAD_REL (temp, 4), + offsetof(struct ccb, phys.header.go.restart), + SCR_RETURN, + 0, +}/*-------------------------< RESEL_NOTAG >-------------------*/,{ + /* + ** No tag expected. + ** Read an throw away the IDENTIFY. + */ + SCR_MOVE_ABS (1) ^ SCR_MSG_IN, + NADDR (msgin), + /* + ** JUMP indirectly to the restart point of the CCB. + */ + SCR_JUMP, + PADDR (resel_go), + +}/*-------------------------< RESEL_DSA >-------------------*/,{ + /* + ** Ack the IDENTIFY or TAG previously received. + */ + SCR_CLR (SCR_ACK), + 0, + /* + ** load the savep (saved pointer) into + ** the actual data pointer. + */ + SCR_LOAD_REL (temp, 4), + offsetof (struct ccb, phys.header.savep), + /* + ** Initialize the status registers + */ + SCR_LOAD_REL (scr0, 4), + offsetof (struct ccb, phys.header.status), + /* + ** Jump to dispatcher. + */ + SCR_JUMP, + PADDR (dispatch), + +}/*-------------------------< DATA_IN >--------------------*/,{ +/* +** Because the size depends on the +** #define MAX_SCATTERL parameter, +** it is filled in at runtime. +** +** ##===========< i=0; i========= +** || SCR_CALL ^ IFFALSE (WHEN (SCR_DATA_IN)), +** || PADDR (databreak), +** || SCR_MOVE_TBL ^ SCR_DATA_IN, +** || offsetof (struct dsb, data[ i]), +** ##========================================== +** +**--------------------------------------------------------- +*/ +0 +}/*-------------------------< DATA_IN2 >-------------------*/,{ + SCR_CALL, + PADDR (databreak), + SCR_JUMP, + PADDRH (no_data), +}/*-------------------------< DATA_OUT >--------------------*/,{ +/* +** Because the size depends on the +** #define MAX_SCATTERL parameter, +** it is filled in at runtime. +** +** ##===========< i=0; i========= +** || SCR_CALL ^ IFFALSE (WHEN (SCR_DATA_OUT)), +** || PADDR (databreak), +** || SCR_MOVE_TBL ^ SCR_DATA_OUT, +** || offsetof (struct dsb, data[ i]), +** ##========================================== +** +**--------------------------------------------------------- +*/ +0 +}/*-------------------------< DATA_OUT2 >-------------------*/,{ + SCR_CALL, + PADDR (databreak), + SCR_JUMP, + PADDRH (no_data), + +}/*-------------------------< PM0_DATA >--------------------*/,{ + /* + ** Keep track we are executing the PM0 DATA + ** mini-script. + */ + SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM0), + 0, + /* + ** MOVE the data according to the actual + ** DATA direction. + */ + SCR_JUMPR ^ IFFALSE (WHEN (SCR_DATA_IN)), + 16, + SCR_MOVE_TBL ^ SCR_DATA_IN, + offsetof (struct ccb, phys.pm0.sg), + SCR_JUMPR, + 8, + SCR_MOVE_TBL ^ SCR_DATA_OUT, + offsetof (struct ccb, phys.pm0.sg), + /* + ** Clear the flag that told we were in + ** the PM0 DATA mini-script. + */ + SCR_REG_REG (HF_REG, SCR_AND, (~HF_IN_PM0)), + 0, + /* + ** Return to the previous DATA script which + ** is guaranteed by design (if no bug) to be + ** the main DATA script for this transfer. + */ + SCR_LOAD_REL (temp, 4), + offsetof (struct ccb, phys.pm0.ret), + SCR_RETURN, + 0, +}/*-------------------------< PM1_DATA >--------------------*/,{ + /* + ** Keep track we are executing the PM1 DATA + ** mini-script. + */ + SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM1), + 0, + /* + ** MOVE the data according to the actual + ** DATA direction. + */ + SCR_JUMPR ^ IFFALSE (WHEN (SCR_DATA_IN)), + 16, + SCR_MOVE_TBL ^ SCR_DATA_IN, + offsetof (struct ccb, phys.pm1.sg), + SCR_JUMPR, + 8, + SCR_MOVE_TBL ^ SCR_DATA_OUT, + offsetof (struct ccb, phys.pm1.sg), + /* + ** Clear the flag that told we were in + ** the PM1 DATA mini-script. + */ + SCR_REG_REG (HF_REG, SCR_AND, (~HF_IN_PM1)), + 0, + /* + ** Return to the previous DATA script which + ** is guaranteed by design (if no bug) to be + ** the main DATA script for this transfer. + */ + SCR_LOAD_REL (temp, 4), + offsetof (struct ccb, phys.pm1.ret), + SCR_RETURN, + 0, + +}/*-------------------------< SAVED_DSA >-------------------*/,{ + SCR_DATA_ZERO, +}/*-------------------------< DONE_POS >--------------------*/,{ + SCR_DATA_ZERO, +}/*-------------------------< STARTPOS >--------------------*/,{ + SCR_DATA_ZERO, +}/*-------------------------< TARGTBL >---------------------*/,{ + SCR_DATA_ZERO, +}/*--------------------------------------------------------*/ +}; + +static struct scripth scripth0 __initdata = { +/*------------------------< START64 >-----------------------*/{ + /* + ** SCRIPT entry point for the 896. + ** For now, there is no specific stuff for that + ** chip at this point, but this may come. + */ + SCR_JUMP, + PADDR (init), +}/*------------------------< SELECT_NO_ATN >-----------------*/,{ + /* + ** Set Initiator mode. + ** And try to select this target without ATN. + */ + + SCR_CLR (SCR_TRG), + 0, + SCR_SEL_TBL ^ offsetof (struct dsb, select), + PADDR (ungetjob), +}/*------------------------< WF_SEL_DONE_NO_ATN >-----------------*/,{ + /* + ** Wait immediately for the next phase or + ** the selection to complete or time-out. + */ + SCR_JUMPR ^ IFFALSE (WHEN (SCR_MSG_OUT)), + 0, + SCR_JUMP, + PADDR (select2), + +}/*-------------------------< CANCEL >------------------------*/,{ + /* + ** Load the host status. + */ + SCR_LOAD_REG (HS_REG, HS_ABORTED), + 0, + SCR_JUMP, + PADDR (complete2), + +}/*-------------------------< MSG_REJECT >---------------*/,{ + /* + ** If a negotiation was in progress, + ** negotiation failed. + ** Otherwise just make host log this message + */ + SCR_FROM_REG (HS_REG), + 0, + SCR_INT ^ IFFALSE (DATA (HS_NEGOTIATE)), + SIR_REJECT_RECEIVED, + SCR_INT ^ IFTRUE (DATA (HS_NEGOTIATE)), + SIR_NEGO_FAILED, + SCR_JUMP, + PADDR (clrack), + +}/*-------------------------< MSG_IGN_RESIDUE >----------*/,{ + /* + ** Terminate cycle + */ + SCR_CLR (SCR_ACK), + 0, + SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_IN)), + PADDR (dispatch), + /* + ** get residue size. + */ + SCR_MOVE_ABS (1) ^ SCR_MSG_IN, + NADDR (msgin[1]), + /* + ** Size is 0 .. ignore message. + */ + SCR_JUMP ^ IFTRUE (DATA (0)), + PADDR (clrack), + /* + ** Size is not 1 .. have to interrupt. + */ + SCR_JUMPR ^ IFFALSE (DATA (1)), + 40, + /* + ** Check for residue byte in swide register + */ + SCR_FROM_REG (scntl2), + 0, + SCR_JUMPR ^ IFFALSE (MASK (WSR, WSR)), + 16, + /* + ** There IS data in the swide register. + ** Discard it. + */ + SCR_REG_REG (scntl2, SCR_OR, WSR), + 0, + SCR_JUMP, + PADDR (clrack), + /* + ** Load again the size to the sfbr register. + */ + SCR_FROM_REG (scratcha), + 0, + SCR_INT, + SIR_IGN_RESIDUE, + SCR_JUMP, + PADDR (clrack), + +}/*-------------------------< MSG_EXTENDED >-------------*/,{ + /* + ** Terminate cycle + */ + SCR_CLR (SCR_ACK), + 0, + SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_IN)), + PADDR (dispatch), + /* + ** get length. + */ + SCR_MOVE_ABS (1) ^ SCR_MSG_IN, + NADDR (msgin[1]), + /* + */ + SCR_JUMP ^ IFTRUE (DATA (3)), + PADDRH (msg_ext_3), + SCR_JUMP ^ IFFALSE (DATA (2)), + PADDR (msg_bad), +}/*-------------------------< MSG_EXT_2 >----------------*/,{ + SCR_CLR (SCR_ACK), + 0, + SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_IN)), + PADDR (dispatch), + /* + ** get extended message code. + */ + SCR_MOVE_ABS (1) ^ SCR_MSG_IN, + NADDR (msgin[2]), + SCR_JUMP ^ IFTRUE (DATA (M_X_WIDE_REQ)), + PADDRH (msg_wdtr), + /* + ** unknown extended message + */ + SCR_JUMP, + PADDR (msg_bad) +}/*-------------------------< MSG_WDTR >-----------------*/,{ + SCR_CLR (SCR_ACK), + 0, + SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_IN)), + PADDR (dispatch), + /* + ** get data bus width + */ + SCR_MOVE_ABS (1) ^ SCR_MSG_IN, + NADDR (msgin[3]), + /* + ** let the host do the real work. + */ + SCR_INT, + SIR_NEGO_WIDE, + /* + ** let the target fetch our answer. + */ + SCR_SET (SCR_ATN), + 0, + SCR_CLR (SCR_ACK), + 0, + SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_OUT)), + PADDRH (nego_bad_phase), + +}/*-------------------------< SEND_WDTR >----------------*/,{ + /* + ** Send the M_X_WIDE_REQ + */ + SCR_MOVE_ABS (4) ^ SCR_MSG_OUT, + NADDR (msgout), + SCR_JUMP, + PADDRH (msg_out_done), + +}/*-------------------------< MSG_EXT_3 >----------------*/,{ + SCR_CLR (SCR_ACK), + 0, + SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_IN)), + PADDR (dispatch), + /* + ** get extended message code. + */ + SCR_MOVE_ABS (1) ^ SCR_MSG_IN, + NADDR (msgin[2]), + SCR_JUMP ^ IFTRUE (DATA (M_X_SYNC_REQ)), + PADDRH (msg_sdtr), + /* + ** unknown extended message + */ + SCR_JUMP, + PADDR (msg_bad) + +}/*-------------------------< MSG_SDTR >-----------------*/,{ + SCR_CLR (SCR_ACK), + 0, + SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_IN)), + PADDR (dispatch), + /* + ** get period and offset + */ + SCR_MOVE_ABS (2) ^ SCR_MSG_IN, + NADDR (msgin[3]), + /* + ** let the host do the real work. + */ + SCR_INT, + SIR_NEGO_SYNC, + /* + ** let the target fetch our answer. + */ + SCR_SET (SCR_ATN), + 0, + SCR_CLR (SCR_ACK), + 0, + SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_OUT)), + PADDRH (nego_bad_phase), + +}/*-------------------------< SEND_SDTR >-------------*/,{ + /* + ** Send the M_X_SYNC_REQ + */ + SCR_MOVE_ABS (5) ^ SCR_MSG_OUT, + NADDR (msgout), + SCR_JUMP, + PADDRH (msg_out_done), + +}/*-------------------------< NEGO_BAD_PHASE >------------*/,{ + SCR_INT, + SIR_NEGO_PROTO, + SCR_JUMP, + PADDR (dispatch), + +}/*-------------------------< MSG_OUT_ABORT >-------------*/,{ + /* + ** After ABORT message, + ** + ** expect an immediate disconnect, ... + */ + SCR_REG_REG (scntl2, SCR_AND, 0x7f), + 0, + SCR_CLR (SCR_ACK|SCR_ATN), + 0, + SCR_WAIT_DISC, + 0, + SCR_INT, + SIR_MSG_OUT_DONE, + /* + ** ... and set the status to "ABORTED" + */ + SCR_LOAD_REG (HS_REG, HS_ABORTED), + 0, + SCR_JUMP, + PADDR (complete2), + +}/*-------------------------< MSG_OUT >-------------------*/,{ + /* + ** The target requests a message. + */ + SCR_MOVE_ABS (1) ^ SCR_MSG_OUT, + NADDR (msgout), + /* + ** If it was no ABORT message ... + */ + SCR_JUMP ^ IFTRUE (DATA (M_ABORT)), + PADDRH (msg_out_abort), + /* + ** ... wait for the next phase + ** if it's a message out, send it again, ... + */ + SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_OUT)), + PADDRH (msg_out), +}/*-------------------------< MSG_OUT_DONE >--------------*/,{ + /* + ** ... else clear the message ... + */ + SCR_INT, + SIR_MSG_OUT_DONE, + /* + ** ... and process the next phase + */ + SCR_JUMP, + PADDR (dispatch), + +}/*-------------------------< NO_DATA >--------------------*/,{ + /* + ** The target wants to tranfer too much data + ** or in the wrong direction. + ** Remember that in extended error. + */ + SCR_LOAD_REG (scratcha, XE_EXTRA_DATA), + 0, + SCR_STORE_REL (scratcha, 1), + offsetof (struct ccb, xerr_status), + /* + ** Discard one data byte, if required. + */ + SCR_JUMPR ^ IFFALSE (WHEN (SCR_DATA_OUT)), + 8, + SCR_MOVE_ABS (1) ^ SCR_DATA_OUT, + NADDR (scratch), + SCR_JUMPR ^ IFFALSE (IF (SCR_DATA_IN)), + 8, + SCR_MOVE_ABS (1) ^ SCR_DATA_IN, + NADDR (scratch), + /* + ** .. and repeat as required. + */ + SCR_CALL, + PADDR (databreak), + SCR_JUMP, + PADDRH (no_data), + +#if MAX_SCATTERH != 0 + +}/*-------------------------< HDATA_IN >-------------------*/,{ +/* +** Because the size depends on the +** #define MAX_SCATTERH parameter, +** it is filled in at runtime. +** +** ##==< i=MAX_SCATTERL; i== +** || SCR_CALL ^ IFFALSE (WHEN (SCR_DATA_IN)), +** || PADDR (databreak), +** || SCR_MOVE_TBL ^ SCR_DATA_IN, +** || offsetof (struct dsb, data[ i]), +** ##=================================================== +** +**--------------------------------------------------------- +*/ +0 +}/*-------------------------< HDATA_IN2 >------------------*/,{ + SCR_JUMP, + PADDR (data_in), + +}/*-------------------------< HDATA_OUT >-------------------*/,{ +/* +** Because the size depends on the +** #define MAX_SCATTERH parameter, +** it is filled in at runtime. +** +** ##==< i=MAX_SCATTERL; i== +** || SCR_CALL ^ IFFALSE (WHEN (SCR_DATA_OUT)), +** || PADDR (databreak), +** || SCR_MOVE_TBL ^ SCR_DATA_OUT, +** || offsetof (struct dsb, data[ i]), +** ##=================================================== +** +**--------------------------------------------------------- +*/ +0 +}/*-------------------------< HDATA_OUT2 >------------------*/,{ + SCR_JUMP, + PADDR (data_out), + +#endif /* MAX_SCATTERH */ + +}/*-------------------------< ABORT_RESEL >----------------*/,{ + SCR_SET (SCR_ATN), + 0, + SCR_CLR (SCR_ACK), + 0, + /* + ** send the abort/abortag/reset message + ** we expect an immediate disconnect + */ + SCR_REG_REG (scntl2, SCR_AND, 0x7f), + 0, + SCR_MOVE_ABS (1) ^ SCR_MSG_OUT, + NADDR (msgout), + SCR_CLR (SCR_ACK|SCR_ATN), + 0, + SCR_WAIT_DISC, + 0, + SCR_INT, + SIR_RESEL_ABORTED, + SCR_JUMP, + PADDR (start), +}/*-------------------------< RESEND_IDENT >-------------------*/,{ + /* + ** The target stays in MSG OUT phase after having acked + ** Identify [+ Tag [+ Extended message ]]. Targets shall + ** behave this way on parity error. + ** We must send it again all the messages. + */ + SCR_SET (SCR_ATN), /* Shall be asserted 2 deskew delays before the */ + 0, /* 1rst ACK = 90 ns. Hope the NCR is'nt too fast */ + SCR_JUMP, + PADDR (send_ident), +}/*-------------------------< IDENT_BREAK >-------------------*/,{ + SCR_CLR (SCR_ATN), + 0, + SCR_JUMP, + PADDR (select2), +}/*-------------------------< IDENT_BREAK_ATN >----------------*/,{ + SCR_SET (SCR_ATN), + 0, + SCR_JUMP, + PADDR (select2), +}/*-------------------------< SDATA_IN >-------------------*/,{ + SCR_MOVE_TBL ^ SCR_DATA_IN, + offsetof (struct dsb, sense), + SCR_CALL, + PADDR (databreak), + SCR_JUMP, + PADDRH (no_data), + +}/*-------------------------< DATA_IO >--------------------*/,{ + /* + ** We jump here if the data direction was unknown at the + ** time we had to queue the command to the scripts processor. + ** Pointers had been set as follow in this situation: + ** savep --> DATA_IO + ** lastp --> start pointer when DATA_IN + ** goalp --> goal pointer when DATA_IN + ** wlastp --> start pointer when DATA_OUT + ** wgoalp --> goal pointer when DATA_OUT + ** This script sets savep/lastp/goalp according to the + ** direction chosen by the target. + */ + SCR_JUMP ^ IFTRUE (WHEN (SCR_DATA_OUT)), + PADDRH(data_io_out), +}/*-------------------------< DATA_IO_COM >-----------------*/,{ + /* + ** Direction is DATA IN. + ** Warning: we jump here, even when phase is DATA OUT. + */ + SCR_LOAD_REL (scratcha, 4), + offsetof (struct ccb, phys.header.lastp), + SCR_STORE_REL (scratcha, 4), + offsetof (struct ccb, phys.header.savep), + + /* + ** Jump to the SCRIPTS according to actual direction. + */ + SCR_LOAD_REL (temp, 4), + offsetof (struct ccb, phys.header.savep), + SCR_RETURN, + 0, +}/*-------------------------< DATA_IO_OUT >-----------------*/,{ + /* + ** Direction is DATA OUT. + */ + SCR_LOAD_REL (scratcha, 4), + offsetof (struct ccb, phys.header.wlastp), + SCR_STORE_REL (scratcha, 4), + offsetof (struct ccb, phys.header.lastp), + SCR_LOAD_REL (scratcha, 4), + offsetof (struct ccb, phys.header.wgoalp), + SCR_STORE_REL (scratcha, 4), + offsetof (struct ccb, phys.header.goalp), + SCR_JUMP, + PADDRH(data_io_com), + +}/*-------------------------< BAD_IDENTIFY >---------------*/,{ + /* + ** If message phase but not an IDENTIFY, + ** get some help from the C code. + ** Old SCSI device may behave so. + */ + SCR_JUMPR ^ IFTRUE (MASK (0x80, 0x80)), + 16, + SCR_INT, + SIR_RESEL_NO_IDENTIFY, + SCR_JUMP, + PADDRH (abort_resel), + /* + ** Message is an IDENTIFY, but lun is unknown. + ** Read the message, since we got it directly + ** from the SCSI BUS data lines. + ** Signal problem to C code for logging the event. + ** Send a M_ABORT to clear all pending tasks. + */ + SCR_INT, + SIR_RESEL_BAD_LUN, + SCR_MOVE_ABS (1) ^ SCR_MSG_IN, + NADDR (msgin), + SCR_JUMP, + PADDRH (abort_resel), +}/*-------------------------< BAD_I_T_L >------------------*/,{ + /* + ** We donnot have a task for that I_T_L. + ** Signal problem to C code for logging the event. + ** Send a M_ABORT message. + */ + SCR_INT, + SIR_RESEL_BAD_I_T_L, + SCR_JUMP, + PADDRH (abort_resel), +}/*-------------------------< BAD_I_T_L_Q >----------------*/,{ + /* + ** We donnot have a task that matches the tag. + ** Signal problem to C code for logging the event. + ** Send a M_ABORTTAG message. + */ + SCR_INT, + SIR_RESEL_BAD_I_T_L_Q, + SCR_JUMP, + PADDRH (abort_resel), +}/*-------------------------< BAD_STATUS >-----------------*/,{ + /* + ** If command resulted in either QUEUE FULL, + ** CHECK CONDITION or COMMAND TERMINATED, + ** call the C code. + */ + SCR_LOAD_ABS (scratcha, 4), + PADDR (startpos), + SCR_INT ^ IFTRUE (DATA (S_QUEUE_FULL)), + SIR_BAD_STATUS, + SCR_INT ^ IFTRUE (DATA (S_CHECK_COND)), + SIR_BAD_STATUS, + SCR_INT ^ IFTRUE (DATA (S_TERMINATED)), + SIR_BAD_STATUS, + SCR_RETURN, + 0, + +}/*-------------------------< TWEAK_PMJ >------------------*/,{ + /* + ** Disable PM handling from SCRIPTS for the data phase + ** and so force PM to be handled from C code if HF_PM_TO_C + ** flag is set. + */ + SCR_FROM_REG(HF_REG), + 0, + SCR_JUMPR ^ IFTRUE (MASK (HF_PM_TO_C, HF_PM_TO_C)), + 16, + SCR_REG_REG (ccntl0, SCR_OR, ENPMJ), + 0, + SCR_RETURN, + 0, + SCR_REG_REG (ccntl0, SCR_AND, (~ENPMJ)), + 0, + SCR_RETURN, + 0, + +}/*-------------------------< PM_HANDLE >------------------*/,{ + /* + ** Phase mismatch handling. + ** + ** Since we have to deal with 2 SCSI data pointers + ** (current and saved), we need at least 2 contexts. + ** Each context (pm0 and pm1) has a saved area, a + ** SAVE mini-script and a DATA phase mini-script. + */ + /* + ** Get the PM handling flags. + */ + SCR_FROM_REG (HF_REG), + 0, + /* + ** If no flags (1rst PM for example), avoid + ** all the below heavy flags testing. + ** This makes the normal case a bit faster. + */ + SCR_JUMP ^ IFTRUE (MASK (0, (HF_IN_PM0 | HF_IN_PM1 | HF_DP_SAVED))), + PADDRH (pm_handle1), + /* + ** If we received a SAVE DP, switch to the + ** other PM context since the savep may point + ** to the current PM context. + */ + SCR_JUMPR ^ IFFALSE (MASK (HF_DP_SAVED, HF_DP_SAVED)), + 8, + SCR_REG_REG (sfbr, SCR_XOR, HF_ACT_PM), + 0, + /* + ** If we have been interrupt in a PM DATA mini-script, + ** we take the return address from the corresponding + ** saved area. + ** This ensure the return address always points to the + ** main DATA script for this transfer. + */ + SCR_JUMP ^ IFTRUE (MASK (0, (HF_IN_PM0 | HF_IN_PM1))), + PADDRH (pm_handle1), + SCR_JUMPR ^ IFFALSE (MASK (HF_IN_PM0, HF_IN_PM0)), + 16, + SCR_LOAD_REL (ia, 4), + offsetof(struct ccb, phys.pm0.ret), + SCR_JUMP, + PADDRH (pm_save), + SCR_LOAD_REL (ia, 4), + offsetof(struct ccb, phys.pm1.ret), + SCR_JUMP, + PADDRH (pm_save), +}/*-------------------------< PM_HANDLE1 >-----------------*/,{ + /* + ** Normal case. + ** Update the return address so that it + ** will point after the interrupted MOVE. + */ + SCR_REG_REG (ia, SCR_ADD, 8), + 0, + SCR_REG_REG (ia1, SCR_ADDC, 0), + 0, +}/*-------------------------< PM_SAVE >--------------------*/,{ + /* + ** Clear all the flags that told us if we were + ** interrupted in a PM DATA mini-script and/or + ** we received a SAVE DP. + */ + SCR_SFBR_REG (HF_REG, SCR_AND, (~(HF_IN_PM0|HF_IN_PM1|HF_DP_SAVED))), + 0, + /* + ** Choose the current PM context. + */ + SCR_JUMP ^ IFTRUE (MASK (HF_ACT_PM, HF_ACT_PM)), + PADDRH (pm1_save), +}/*-------------------------< PM0_SAVE >-------------------*/,{ + /* + ** Save the remaining byte count, the updated + ** address and the return address. + */ + SCR_STORE_REL (rbc, 4), + offsetof(struct ccb, phys.pm0.sg.size), + SCR_STORE_REL (ua, 4), + offsetof(struct ccb, phys.pm0.sg.addr), + SCR_STORE_REL (ia, 4), + offsetof(struct ccb, phys.pm0.ret), + /* + ** Set the current pointer at the PM0 DATA mini-script. + */ + SCR_LOAD_ABS (temp, 4), + PADDRH (pm0_data_addr), + SCR_JUMP, + PADDR (databreak), +}/*-------------------------< PM1_SAVE >-------------------*/,{ + /* + ** Save the remaining byte count, the updated + ** address and the return address. + */ + SCR_STORE_REL (rbc, 4), + offsetof(struct ccb, phys.pm1.sg.size), + SCR_STORE_REL (ua, 4), + offsetof(struct ccb, phys.pm1.sg.addr), + SCR_STORE_REL (ia, 4), + offsetof(struct ccb, phys.pm1.ret), + /* + ** Set the current pointer at the PM1 DATA mini-script. + */ + SCR_LOAD_ABS (temp, 4), + PADDRH (pm1_data_addr), + SCR_JUMP, + PADDR (databreak), +}/*-------------------------< PM0_DATA_ADDR >---------------*/,{ + SCR_DATA_ZERO, +}/*-------------------------< PM1_DATA_ADDR >---------------*/,{ + SCR_DATA_ZERO, +}/*-------------------------< START_RAM >-------------------*/,{ + /* + ** Load the script into on-chip RAM, + ** and jump to start point. + */ + SCR_COPY (sizeof (struct script)), +}/*-------------------------< SCRIPT0_BA >--------------------*/,{ + 0, + PADDR (start), + SCR_JUMP, + PADDR (init), + +}/*-------------------------< START_RAM64 >--------------------*/,{ + /* + ** Load the RAM and start for 64 bit PCI (896). + ** Both scripts (script and scripth) are loaded into + ** the RAM which is 8K (4K for 825A/875/895). + ** We also need to load some 32-63 bit segments + ** address of the SCRIPTS processor. + ** LOAD/STORE ABSOLUTE always refers to on-chip RAM + ** in our implementation. The main memory is + ** accessed using LOAD/STORE DSA RELATIVE. + */ + SCR_LOAD_REL (mmws, 4), + offsetof (struct ncb, scr_ram_seg), + SCR_COPY (sizeof(struct script)), +}/*-------------------------< SCRIPT0_BA64 >--------------------*/,{ + 0, + PADDR (start), + SCR_COPY (sizeof(struct scripth)), +}/*-------------------------< SCRIPTH0_BA64 >--------------------*/,{ + 0, + PADDRH (start64), + SCR_LOAD_REL (mmrs, 4), + offsetof (struct ncb, scr_ram_seg), + SCR_JUMP64, + PADDRH (start64), +}/*-------------------------< RAM_SEG64 >--------------------*/,{ + 0, +}/*-------------------------< SNOOPTEST >-------------------*/,{ + /* + ** Read the variable. + */ + SCR_LOAD_REL (scratcha, 4), + offsetof(struct ncb, ncr_cache), + SCR_STORE_REL (temp, 4), + offsetof(struct ncb, ncr_cache), + SCR_LOAD_REL (temp, 4), + offsetof(struct ncb, ncr_cache), +}/*-------------------------< SNOOPEND >-------------------*/,{ + /* + ** And stop. + */ + SCR_INT, + 99, +}/*--------------------------------------------------------*/ +}; + +/*========================================================== +** +** +** Fill in #define dependent parts of the script +** +** +**========================================================== +*/ + +__initfunc( +void ncr_script_fill (struct script * scr, struct scripth * scrh) +) +{ + int i; + ncrcmd *p; + +#if MAX_SCATTERH != 0 + p = scrh->hdata_in; + for (i=0; ihdata_in + sizeof (scrh->hdata_in)); +#endif + + p = scr->data_in; + for (i=MAX_SCATTERH; idata_in + sizeof (scr->data_in)); + +#if MAX_SCATTERH != 0 + p = scrh->hdata_out; + for (i=0; ihdata_out + sizeof (scrh->hdata_out)); +#endif + + p = scr->data_out; + for (i=MAX_SCATTERH; idata_out + sizeof (scr->data_out)); +} + +/*========================================================== +** +** +** Copy and rebind a script. +** +** +**========================================================== +*/ + +__initfunc( +static void ncr_script_copy_and_bind (ncb_p np,ncrcmd *src,ncrcmd *dst,int len) +) +{ + ncrcmd opcode, new, old, tmp1, tmp2; + ncrcmd *start, *end; + int relocs; + int opchanged = 0; + + start = src; + end = src + len/4; + + while (src < end) { + + opcode = *src++; + *dst++ = cpu_to_scr(opcode); + + /* + ** If we forget to change the length + ** in struct script, a field will be + ** padded with 0. This is an illegal + ** command. + */ + + if (opcode == 0) { + printk (KERN_INFO "%s: ERROR0 IN SCRIPT at %d.\n", + ncr_name(np), (int) (src-start-1)); + MDELAY (10000); + continue; + }; + + /* + ** We use the bogus value 0xf00ff00f ;-) + ** to reserve data area in SCRIPTS. + */ + if (opcode == SCR_DATA_ZERO) { + dst[-1] = 0; + continue; + } + + if (DEBUG_FLAGS & DEBUG_SCRIPT) + printk (KERN_INFO "%p: <%x>\n", + (src-1), (unsigned)opcode); + + /* + ** We don't have to decode ALL commands + */ + switch (opcode >> 28) { + + case 0xf: + /* + ** LOAD / STORE DSA relative, don't relocate. + */ + relocs = 0; + break; + case 0xe: + /* + ** LOAD / STORE absolute. + */ + relocs = 1; + break; + case 0xc: + /* + ** COPY has TWO arguments. + */ + relocs = 2; + tmp1 = src[0]; + tmp2 = src[1]; +#ifdef RELOC_KVAR + if ((tmp1 & RELOC_MASK) == RELOC_KVAR) + tmp1 = 0; + if ((tmp2 & RELOC_MASK) == RELOC_KVAR) + tmp2 = 0; +#endif + if ((tmp1 ^ tmp2) & 3) { + printk (KERN_ERR"%s: ERROR1 IN SCRIPT at %d.\n", + ncr_name(np), (int) (src-start-1)); + MDELAY (1000); + } + /* + ** If PREFETCH feature not enabled, remove + ** the NO FLUSH bit if present. + */ + if ((opcode & SCR_NO_FLUSH) && + !(np->features & FE_PFEN)) { + dst[-1] = cpu_to_scr(opcode & ~SCR_NO_FLUSH); + ++opchanged; + } + break; + + case 0x0: + /* + ** MOVE (absolute address) + */ + relocs = 1; + break; + + case 0x8: + /* + ** JUMP / CALL + ** dont't relocate if relative :-) + */ + if (opcode & 0x00800000) + relocs = 0; + else if ((opcode & 0xf8400000) == 0x80400000)/*JUMP64*/ + relocs = 2; + else + relocs = 1; + break; + + case 0x4: + case 0x5: + case 0x6: + case 0x7: + relocs = 1; + break; + + default: + relocs = 0; + break; + }; + + if (!relocs) { + *dst++ = cpu_to_scr(*src++); + continue; + } + while (relocs--) { + old = *src++; + + switch (old & RELOC_MASK) { + case RELOC_REGISTER: + new = (old & ~RELOC_MASK) + pcivtobus(np->base_ba); + break; + case RELOC_LABEL: + new = (old & ~RELOC_MASK) + np->p_script; + break; + case RELOC_LABELH: + new = (old & ~RELOC_MASK) + np->p_scripth; + break; + case RELOC_SOFTC: + new = (old & ~RELOC_MASK) + vtobus(np); + break; +#ifdef RELOC_KVAR + case RELOC_KVAR: + if (((old & ~RELOC_MASK) < SCRIPT_KVAR_FIRST) || + ((old & ~RELOC_MASK) > SCRIPT_KVAR_LAST)) + panic("ncr KVAR out of range"); + new = vtobus(script_kvars[old & ~RELOC_MASK]); +#endif + break; + case 0: + /* Don't relocate a 0 address. */ + if (old == 0) { + new = old; + break; + } + /* fall through */ + default: + panic("ncr_script_copy_and_bind: " + "weird relocation %x\n", old); + break; + } + + *dst++ = cpu_to_scr(new); + } + }; +} + +/*========================================================== +** +** +** Auto configuration: attach and init a host adapter. +** +** +**========================================================== +*/ + +/* +** Linux host data structure. +*/ + +struct host_data { + struct ncb *ncb; +}; + +/* +** Print something which allows to retrieve the controler type, unit, +** target, lun concerned by a kernel message. +*/ + +static void PRINT_TARGET(ncb_p np, int target) +{ + printk(KERN_INFO "%s-<%d,*>: ", ncr_name(np), target); +} + +static void PRINT_LUN(ncb_p np, int target, int lun) +{ + printk(KERN_INFO "%s-<%d,%d>: ", ncr_name(np), target, lun); +} + +static void PRINT_ADDR(Scsi_Cmnd *cmd) +{ + struct host_data *host_data = (struct host_data *) cmd->host->hostdata; + PRINT_LUN(host_data->ncb, cmd->target, cmd->lun); +} + +/*========================================================== +** +** NCR chip clock divisor table. +** Divisors are multiplied by 10,000,000 in order to make +** calculations more simple. +** +**========================================================== +*/ + +#define _5M 5000000 +static u_long div_10M[] = + {2*_5M, 3*_5M, 4*_5M, 6*_5M, 8*_5M, 12*_5M, 16*_5M}; + + +/*=============================================================== +** +** Prepare io register values used by ncr_init() according +** to selected and supported features. +** +** NCR chips allow burst lengths of 2, 4, 8, 16, 32, 64, 128 +** transfers. 32,64,128 are only supported by 825A, 875, 895 +** and 896 chips. +** We use log base 2 (burst length) as internal code, with +** value 0 meaning "burst disabled". +** +**=============================================================== +*/ + +/* + * Burst length from burst code. + */ +#define burst_length(bc) (!(bc))? 0 : 1 << (bc) + +/* + * Burst code from io register bits. + */ +#define burst_code(dmode, ctest4, ctest5) \ + (ctest4) & 0x80? 0 : (((dmode) & 0xc0) >> 6) + ((ctest5) & 0x04) + 1 + +/* + * Set initial io register bits from burst code. + */ +static inline void ncr_init_burst(ncb_p np, u_char bc) +{ + np->rv_ctest4 &= ~0x80; + np->rv_dmode &= ~(0x3 << 6); + np->rv_ctest5 &= ~0x4; + + if (!bc) { + np->rv_ctest4 |= 0x80; + } + else { + --bc; + np->rv_dmode |= ((bc & 0x3) << 6); + np->rv_ctest5 |= (bc & 0x4); + } +} + +#ifdef SCSI_NCR_NVRAM_SUPPORT + +/* +** Get target set-up from Symbios format NVRAM. +*/ + +__initfunc( +static void + ncr_Symbios_setup_target(ncb_p np, int target, Symbios_nvram *nvram) +) +{ + tcb_p tp = &np->target[target]; + Symbios_target *tn = &nvram->target[target]; + + tp->usrsync = tn->sync_period ? (tn->sync_period + 3) / 4 : 255; + tp->usrwide = tn->bus_width == 0x10 ? 1 : 0; + tp->usrtags = + (tn->flags & SYMBIOS_QUEUE_TAGS_ENABLED)? SCSI_NCR_MAX_TAGS : 0; + + if (!(tn->flags & SYMBIOS_DISCONNECT_ENABLE)) + tp->usrflag |= UF_NODISC; + if (!(tn->flags & SYMBIOS_SCAN_AT_BOOT_TIME)) + tp->usrflag |= UF_NOSCAN; +} + +/* +** Get target set-up from Tekram format NVRAM. +*/ + +__initfunc( +static void + ncr_Tekram_setup_target(ncb_p np, int target, Tekram_nvram *nvram) +) +{ + tcb_p tp = &np->target[target]; + struct Tekram_target *tn = &nvram->target[target]; + int i; + + if (tn->flags & TEKRAM_SYNC_NEGO) { + i = tn->sync_index & 0xf; + tp->usrsync = i < 12 ? Tekram_sync[i] : 255; + } + + tp->usrwide = (tn->flags & TEKRAM_WIDE_NEGO) ? 1 : 0; + + if (tn->flags & TEKRAM_TAGGED_COMMANDS) { + tp->usrtags = 2 << nvram->max_tags_index; + } + + if (!(tn->flags & TEKRAM_DISCONNECT_ENABLE)) + tp->usrflag = UF_NODISC; + + /* If any device does not support parity, we will not use this option */ + if (!(tn->flags & TEKRAM_PARITY_CHECK)) + np->rv_scntl0 &= ~0x0a; /* SCSI parity checking disabled */ +} +#endif /* SCSI_NCR_NVRAM_SUPPORT */ + +__initfunc( +static int ncr_prepare_setting(ncb_p np, ncr_nvram *nvram) +) +{ + u_char burst_max; + u_long period; + int i; + + /* + ** Save assumed BIOS setting + */ + + np->sv_scntl0 = INB(nc_scntl0) & 0x0a; + np->sv_scntl3 = INB(nc_scntl3) & 0x07; + np->sv_dmode = INB(nc_dmode) & 0xce; + np->sv_dcntl = INB(nc_dcntl) & 0xa8; + np->sv_ctest3 = INB(nc_ctest3) & 0x01; + np->sv_ctest4 = INB(nc_ctest4) & 0x80; + np->sv_ctest5 = INB(nc_ctest5) & 0x24; + np->sv_gpcntl = INB(nc_gpcntl); + np->sv_stest2 = INB(nc_stest2) & 0x20; + np->sv_stest4 = INB(nc_stest4); + + /* + ** Wide ? + */ + + np->maxwide = (np->features & FE_WIDE)? 1 : 0; + + /* + ** Get the frequency of the chip's clock. + ** Find the right value for scntl3. + */ + + if (np->features & FE_QUAD) + np->multiplier = 4; + else if (np->features & FE_DBLR) + np->multiplier = 2; + else + np->multiplier = 1; + + np->clock_khz = (np->features & FE_CLK80)? 80000 : 40000; + np->clock_khz *= np->multiplier; + + if (np->clock_khz != 40000) + ncr_getclock(np, np->multiplier); + + /* + * Divisor to be used for async (timer pre-scaler). + */ + i = np->clock_divn - 1; + while (--i >= 0) { + if (10ul * SCSI_NCR_MIN_ASYNC * np->clock_khz > div_10M[i]) { + ++i; + break; + } + } + np->rv_scntl3 = i+1; + + /* + * Minimum synchronous period factor supported by the chip. + * Btw, 'period' is in tenths of nanoseconds. + */ + + period = (4 * div_10M[0] + np->clock_khz - 1) / np->clock_khz; + if (period <= 250) np->minsync = 10; + else if (period <= 303) np->minsync = 11; + else if (period <= 500) np->minsync = 12; + else np->minsync = (period + 40 - 1) / 40; + + /* + * Check against chip SCSI standard support (SCSI-2,ULTRA,ULTRA2). + */ + + if (np->minsync < 25 && !(np->features & (FE_ULTRA|FE_ULTRA2))) + np->minsync = 25; + else if (np->minsync < 12 && !(np->features & FE_ULTRA2)) + np->minsync = 12; + + /* + * Maximum synchronous period factor supported by the chip. + */ + + period = (11 * div_10M[np->clock_divn - 1]) / (4 * np->clock_khz); + np->maxsync = period > 2540 ? 254 : period / 10; + + /* + ** 64 bit (53C896) ? + */ + if (np->features & FE_64BIT) +#if BITS_PER_LONG > 32 + np->rv_ccntl1 |= (XTIMOD | EXTIBMV); +#else + np->rv_ccntl1 |= (DDAC); +#endif + + /* + ** Phase mismatch handled by SCRIPTS (53C896) ? + */ + if (np->features & FE_NOPM) + np->rv_ccntl0 |= (ENPMJ); + + /* + ** Prepare initial value of other IO registers + */ +#if defined SCSI_NCR_TRUST_BIOS_SETTING + np->rv_scntl0 = np->sv_scntl0; + np->rv_dmode = np->sv_dmode; + np->rv_dcntl = np->sv_dcntl; + np->rv_ctest3 = np->sv_ctest3; + np->rv_ctest4 = np->sv_ctest4; + np->rv_ctest5 = np->sv_ctest5; + burst_max = burst_code(np->sv_dmode, np->sv_ctest4, np->sv_ctest5); +#else + + /* + ** Select burst length (dwords) + */ + burst_max = driver_setup.burst_max; + if (burst_max == 255) + burst_max = burst_code(np->sv_dmode, np->sv_ctest4, np->sv_ctest5); + if (burst_max > 7) + burst_max = 7; + if (burst_max > np->maxburst) + burst_max = np->maxburst; + + /* + ** DEL 352 - 53C810 Rev x11 - Part Number 609-0392140 - ITEM 2. + ** This chip and the 860 Rev 1 may wrongly use PCI cache line + ** based transactions on LOAD/STORE instructions. So we have + ** to prevent these chips from using such PCI transactions in + ** this driver. The generic sym53c8xx driver that does not use + ** LOAD/STORE instructions does not need this work-around. + */ + if ((np->device_id == PCI_DEVICE_ID_NCR_53C810 && + np->revision_id >= 0x10 && np->revision_id <= 0x11) || + (np->device_id == PCI_DEVICE_ID_NCR_53C860 && + np->revision_id <= 0x1)) + np->features &= ~(FE_WRIE|FE_ERL|FE_ERMP); + + /* + ** Select all supported special features. + ** If we are using on-board RAM for scripts, prefetch (PFEN) + ** does not help, but burst op fetch (BOF) does. + ** Disabling PFEN makes sure BOF will be used. + */ + if (np->features & FE_ERL) + np->rv_dmode |= ERL; /* Enable Read Line */ + if (np->features & FE_BOF) + np->rv_dmode |= BOF; /* Burst Opcode Fetch */ + if (np->features & FE_ERMP) + np->rv_dmode |= ERMP; /* Enable Read Multiple */ +#ifdef SCSI_NCR_OPTIMIZE_896 + if ((np->features & FE_PFEN) && !np->base2_ba) +#else + if (np->features & FE_PFEN) +#endif + np->rv_dcntl |= PFEN; /* Prefetch Enable */ + if (np->features & FE_CLSE) + np->rv_dcntl |= CLSE; /* Cache Line Size Enable */ + if (np->features & FE_WRIE) + np->rv_ctest3 |= WRIE; /* Write and Invalidate */ + if (np->features & FE_DFS) + np->rv_ctest5 |= DFS; /* Dma Fifo Size */ + + /* + ** Select some other + */ + if (driver_setup.master_parity) + np->rv_ctest4 |= MPEE; /* Master parity checking */ + if (driver_setup.scsi_parity) + np->rv_scntl0 |= 0x0a; /* full arb., ena parity, par->ATN */ + +#ifdef SCSI_NCR_NVRAM_SUPPORT + /* + ** Get parity checking, host ID and verbose mode from NVRAM + **/ + if (nvram) { + switch(nvram->type) { + case SCSI_NCR_TEKRAM_NVRAM: + np->myaddr = nvram->data.Tekram.host_id & 0x0f; + break; + case SCSI_NCR_SYMBIOS_NVRAM: + if (!(nvram->data.Symbios.flags & SYMBIOS_PARITY_ENABLE)) + np->rv_scntl0 &= ~0x0a; + np->myaddr = nvram->data.Symbios.host_id & 0x0f; + if (nvram->data.Symbios.flags & SYMBIOS_VERBOSE_MSGS) + np->verbose += 1; + break; + } + } +#endif + /* + ** Get SCSI addr of host adapter (set by bios?). + */ + if (np->myaddr == 255) { + np->myaddr = INB(nc_scid) & 0x07; + if (!np->myaddr) + np->myaddr = SCSI_NCR_MYADDR; + } + +#endif /* SCSI_NCR_TRUST_BIOS_SETTING */ + + /* + * Prepare initial io register bits for burst length + */ + ncr_init_burst(np, burst_max); + + /* + ** Set differential mode and LED support. + ** Ignore these features for boards known to use a + ** specific GPIO wiring (Tekram only for now) and + ** for the 896 that drives the LED directly. + ** Probe initial setting of GPREG and GPCNTL for + ** other ones. + */ + if (!nvram || nvram->type != SCSI_NCR_TEKRAM_NVRAM) { + switch(driver_setup.diff_support) { + case 3: + if (INB(nc_gpreg) & 0x08) + break; + case 2: + np->rv_stest2 |= 0x20; + break; + case 1: + np->rv_stest2 |= (np->sv_stest2 & 0x20); + break; + default: + break; + } + } + if ((driver_setup.led_pin || + (nvram && nvram->type == SCSI_NCR_SYMBIOS_NVRAM)) && + !(np->features & FE_LEDC) && !(np->sv_gpcntl & 0x01)) + np->features |= FE_LED0; + + /* + ** Set irq mode. + */ + switch(driver_setup.irqm & 3) { + case 2: + np->rv_dcntl |= IRQM; + break; + case 1: + np->rv_dcntl |= (np->sv_dcntl & IRQM); + break; + default: + break; + } + + /* + ** Configure targets according to driver setup. + ** If NVRAM present get targets setup from NVRAM. + ** Allow to override sync, wide and NOSCAN from + ** boot command line. + */ + for (i = 0 ; i < MAX_TARGET ; i++) { + tcb_p tp = &np->target[i]; + + tp->usrsync = 255; +#ifdef SCSI_NCR_NVRAM_SUPPORT + if (nvram) { + switch(nvram->type) { + case SCSI_NCR_TEKRAM_NVRAM: + ncr_Tekram_setup_target(np, i, &nvram->data.Tekram); + break; + case SCSI_NCR_SYMBIOS_NVRAM: + ncr_Symbios_setup_target(np, i, &nvram->data.Symbios); + break; + } + if (driver_setup.use_nvram & 0x2) + tp->usrsync = driver_setup.default_sync; + if (driver_setup.use_nvram & 0x4) + tp->usrwide = driver_setup.max_wide; + if (driver_setup.use_nvram & 0x8) + tp->usrflag &= ~UF_NOSCAN; + } + else { +#else + if (1) { +#endif + tp->usrsync = driver_setup.default_sync; + tp->usrwide = driver_setup.max_wide; + tp->usrtags = SCSI_NCR_MAX_TAGS; + if (!driver_setup.disconnection) + np->target[i].usrflag = UF_NODISC; + } + } + + /* + ** Announce all that stuff to user. + */ + + i = nvram ? nvram->type : 0; + printk(KERN_INFO "%s: %sID %d, Fast-%d%s%s\n", ncr_name(np), + i == SCSI_NCR_SYMBIOS_NVRAM ? "Symbios format NVRAM, " : + (i == SCSI_NCR_TEKRAM_NVRAM ? "Tekram format NVRAM, " : ""), + np->myaddr, + np->minsync < 12 ? 40 : (np->minsync < 25 ? 20 : 10), + (np->rv_scntl0 & 0xa) ? ", Parity Checking" : ", NO Parity", + (np->rv_stest2 & 0x20) ? ", Differential" : ""); + + if (bootverbose > 1) { + printk (KERN_INFO "%s: initial SCNTL3/DMODE/DCNTL/CTEST3/4/5 = " + "(hex) %02x/%02x/%02x/%02x/%02x/%02x\n", + ncr_name(np), np->sv_scntl3, np->sv_dmode, np->sv_dcntl, + np->sv_ctest3, np->sv_ctest4, np->sv_ctest5); + + printk (KERN_INFO "%s: final SCNTL3/DMODE/DCNTL/CTEST3/4/5 = " + "(hex) %02x/%02x/%02x/%02x/%02x/%02x\n", + ncr_name(np), np->rv_scntl3, np->rv_dmode, np->rv_dcntl, + np->rv_ctest3, np->rv_ctest4, np->rv_ctest5); + } + + if (bootverbose && np->base2_ba) + printk (KERN_INFO "%s: on-chip RAM at 0x%lx\n", + ncr_name(np), np->base2_ba); + + return 0; +} + + +#ifdef SCSI_NCR_DEBUG_NVRAM + +__initfunc( +void ncr_display_Symbios_nvram(ncb_p np, Symbios_nvram *nvram) +) +{ + int i; + + /* display Symbios nvram host data */ + printk(KERN_DEBUG "%s: HOST ID=%d%s%s%s%s%s\n", + ncr_name(np), nvram->host_id & 0x0f, + (nvram->flags & SYMBIOS_SCAM_ENABLE) ? " SCAM" :"", + (nvram->flags & SYMBIOS_PARITY_ENABLE) ? " PARITY" :"", + (nvram->flags & SYMBIOS_VERBOSE_MSGS) ? " VERBOSE" :"", + (nvram->flags & SYMBIOS_CHS_MAPPING) ? " CHS_ALT" :"", + (nvram->flags1 & SYMBIOS_SCAN_HI_LO) ? " HI_LO" :""); + + /* display Symbios nvram drive data */ + for (i = 0 ; i < 15 ; i++) { + struct Symbios_target *tn = &nvram->target[i]; + printk(KERN_DEBUG "%s-%d:%s%s%s%s WIDTH=%d SYNC=%d TMO=%d\n", + ncr_name(np), i, + (tn->flags & SYMBIOS_DISCONNECT_ENABLE) ? " DISC" : "", + (tn->flags & SYMBIOS_SCAN_AT_BOOT_TIME) ? " SCAN_BOOT" : "", + (tn->flags & SYMBIOS_SCAN_LUNS) ? " SCAN_LUNS" : "", + (tn->flags & SYMBIOS_QUEUE_TAGS_ENABLED)? " TCQ" : "", + tn->bus_width, + tn->sync_period / 4, + tn->timeout); + } +} + +static u_char Tekram_boot_delay[7] __initdata = {3, 5, 10, 20, 30, 60, 120}; + +__initfunc( +void ncr_display_Tekram_nvram(ncb_p np, Tekram_nvram *nvram) +) +{ + int i, tags, boot_delay; + char *rem; + + /* display Tekram nvram host data */ + tags = 2 << nvram->max_tags_index; + boot_delay = 0; + if (nvram->boot_delay_index < 6) + boot_delay = Tekram_boot_delay[nvram->boot_delay_index]; + switch((nvram->flags & TEKRAM_REMOVABLE_FLAGS) >> 6) { + default: + case 0: rem = ""; break; + case 1: rem = " REMOVABLE=boot device"; break; + case 2: rem = " REMOVABLE=all"; break; + } + + printk(KERN_DEBUG + "%s: HOST ID=%d%s%s%s%s%s%s%s%s%s BOOT DELAY=%d tags=%d\n", + ncr_name(np), nvram->host_id & 0x0f, + (nvram->flags1 & SYMBIOS_SCAM_ENABLE) ? " SCAM" :"", + (nvram->flags & TEKRAM_MORE_THAN_2_DRIVES) ? " >2DRIVES" :"", + (nvram->flags & TEKRAM_DRIVES_SUP_1GB) ? " >1GB" :"", + (nvram->flags & TEKRAM_RESET_ON_POWER_ON) ? " RESET" :"", + (nvram->flags & TEKRAM_ACTIVE_NEGATION) ? " ACT_NEG" :"", + (nvram->flags & TEKRAM_IMMEDIATE_SEEK) ? " IMM_SEEK" :"", + (nvram->flags & TEKRAM_SCAN_LUNS) ? " SCAN_LUNS" :"", + (nvram->flags1 & TEKRAM_F2_F6_ENABLED) ? " F2_F6" :"", + rem, boot_delay, tags); + + /* display Tekram nvram drive data */ + for (i = 0; i <= 15; i++) { + int sync, j; + struct Tekram_target *tn = &nvram->target[i]; + j = tn->sync_index & 0xf; + sync = j < 12 ? Tekram_sync[j] : 255; + printk(KERN_DEBUG "%s-%d:%s%s%s%s%s%s PERIOD=%d\n", + ncr_name(np), i, + (tn->flags & TEKRAM_PARITY_CHECK) ? " PARITY" : "", + (tn->flags & TEKRAM_SYNC_NEGO) ? " SYNC" : "", + (tn->flags & TEKRAM_DISCONNECT_ENABLE) ? " DISC" : "", + (tn->flags & TEKRAM_START_CMD) ? " START" : "", + (tn->flags & TEKRAM_TAGGED_COMMANDS) ? " TCQ" : "", + (tn->flags & TEKRAM_WIDE_NEGO) ? " WIDE" : "", + sync); + } +} +#endif /* SCSI_NCR_DEBUG_NVRAM */ + +/* +** Host attach and initialisations. +** +** Allocate host data and ncb structure. +** Request IO region and remap MMIO region. +** Do chip initialization. +** If all is OK, install interrupt handling and +** start the timer daemon. +*/ + +__initfunc( +static int ncr_attach (Scsi_Host_Template *tpnt, int unit, ncr_device *device) +) +{ + struct host_data *host_data; + ncb_p np = 0; + struct Scsi_Host *instance = 0; + u_long flags = 0; + ncr_nvram *nvram = device->nvram; + int i; + +#ifdef __sparc__ +printk(KERN_INFO "ncr53c%s-%d: rev=0x%02x, base=0x%lx, io_port=0x%lx, irq=0x%x\n", + device->chip.name, unit, device->chip.revision_id, device->slot.base, + device->slot.io_port, device->slot.irq); +#else +printk(KERN_INFO NAME53C "%s-%d: rev=0x%02x, base=0x%lx, io_port=0x%lx, irq=%d\n", + device->chip.name, unit, device->chip.revision_id, device->slot.base, + device->slot.io_port, device->slot.irq); +#endif + + /* + ** Allocate host_data structure + */ + if (!(instance = scsi_register(tpnt, sizeof(*host_data)))) + goto attach_error; + host_data = (struct host_data *) instance->hostdata; + + /* + ** Allocate the host control block. + */ + np = m_calloc(sizeof(struct ncb), "NCB", MEMO_WARN); + if (!np) + goto attach_error; + NCR_INIT_LOCK_NCB(np); + host_data->ncb = np; + + /* + ** Store input informations in the host data structure. + */ + strncpy(np->chip_name, device->chip.name, sizeof(np->chip_name) - 1); + np->unit = unit; + np->verbose = driver_setup.verbose; + sprintf(np->inst_name, NAME53C "%s-%d", np->chip_name, np->unit); + np->device_id = device->chip.device_id; + np->revision_id = device->chip.revision_id; + np->features = device->chip.features; + np->clock_divn = device->chip.nr_divisor; + np->maxoffs = device->chip.offset_max; + np->maxburst = device->chip.burst_max; + np->myaddr = device->host_id; + + /* + ** Allocate the start queue. + */ + np->squeue = (ncrcmd *) + m_calloc(sizeof(ncrcmd)*(MAX_START*2), "SQUEUE", MEMO_WARN); + if (!np->squeue) + goto attach_error; + + /* + ** Allocate the done queue. + */ + np->dqueue = (ncrcmd *) + m_calloc(sizeof(ncrcmd)*(MAX_START*2), "DQUEUE", MEMO_WARN); + if (!np->dqueue) + goto attach_error; + + /* + ** Allocate the target bus address array. + */ + np->targtbl = (u_int32 *) m_calloc(256, "TARGTBL", MEMO_WARN); + if (!np->targtbl) + goto attach_error; + + /* + ** Allocate SCRIPTS areas + */ + np->script0 = (struct script *) + m_calloc(sizeof(struct script), "SCRIPT", MEMO_WARN); + if (!np->script0) + goto attach_error; + np->scripth0 = (struct scripth *) + m_calloc(sizeof(struct scripth), "SCRIPTH", MEMO_WARN); + if (!np->scripth0) + goto attach_error; + + /* + ** Initialyze the CCB free queue and, + ** allocate some CCB. We need at least ONE. + */ + xpt_que_init(&np->free_ccbq); + xpt_que_init(&np->b0_ccbq); + if (!ncr_alloc_ccb(np)) + goto attach_error; + + /* + ** Initialize timer structure + ** + */ + init_timer(&np->timer); + np->timer.data = (unsigned long) np; + np->timer.function = sym53c8xx_timeout; + + /* + ** Try to map the controller chip to + ** virtual and physical memory. + */ + + np->base_ba = device->slot.base; + np->base_ws = (np->features & FE_IO256)? 256 : 128; + np->base2_ba = (np->features & FE_RAM)? device->slot.base_2 : 0; + +#ifndef NCR_IOMAPPED + np->base_va = remap_pci_mem(np->base_ba, np->base_ws); + if (!np->base_va) { + printk(KERN_ERR "%s: can't map PCI MMIO region\n",ncr_name(np)); + goto attach_error; + } + else if (bootverbose > 1) + printk(KERN_INFO "%s: using memory mapped IO\n", ncr_name(np)); + + /* + ** Make the controller's registers available. + ** Now the INB INW INL OUTB OUTW OUTL macros + ** can be used safely. + */ + + np->reg = (struct ncr_reg *) np->base_va; + +#endif /* !defined NCR_IOMAPPED */ + + /* + ** Try to map the controller chip into iospace. + */ + + if (device->slot.io_port) { + request_region(device->slot.io_port, np->base_ws, NAME53C8XX); + np->base_io = device->slot.io_port; + } + +#ifdef SCSI_NCR_NVRAM_SUPPORT + if (nvram) { + switch(nvram->type) { + case SCSI_NCR_SYMBIOS_NVRAM: +#ifdef SCSI_NCR_DEBUG_NVRAM + ncr_display_Symbios_nvram(np, &nvram->data.Symbios); +#endif + break; + case SCSI_NCR_TEKRAM_NVRAM: +#ifdef SCSI_NCR_DEBUG_NVRAM + ncr_display_Tekram_nvram(np, &nvram->data.Tekram); +#endif + break; + default: + nvram = 0; +#ifdef SCSI_NCR_DEBUG_NVRAM + printk(KERN_DEBUG "%s: NVRAM: None or invalid data.\n", ncr_name(np)); +#endif + } + } +#endif + + /* + ** Do chip dependent initialization. + */ + if (np->base2_ba && sizeof(struct script) > 4096) { + printk(KERN_ERR "%s: script too large.\n", ncr_name(np)); + goto attach_error; + } + (void) ncr_prepare_setting(np, nvram); + + /* + ** Patch script to physical addresses + */ + ncr_script_fill (&script0, &scripth0); + + np->p_script = vtobus(np->script0); + np->p_scripth = vtobus(np->scripth0); + np->p_scripth0 = np->p_scripth; + + if (np->base2_ba) { + np->p_script = pcivtobus(np->base2_ba); + if (np->features & FE_RAM8K) { + np->p_scripth = np->p_script + 4096; +#if BITS_PER_LONG > 32 + np->scr_ram_seg = cpu_to_scr(np->base2_ba >> 32); +#endif + } + } + + ncr_script_copy_and_bind (np, (ncrcmd *) &script0, (ncrcmd *) np->script0, sizeof(struct script)); + ncr_script_copy_and_bind (np, (ncrcmd *) &scripth0, (ncrcmd *) np->scripth0, sizeof(struct scripth)); + + /* + ** Patch some variables in SCRIPTS + */ + np->scripth0->pm0_data_addr[0] = + cpu_to_scr(NCB_SCRIPT_PHYS(np, pm0_data)); + np->scripth0->pm1_data_addr[0] = + cpu_to_scr(NCB_SCRIPT_PHYS(np, pm1_data)); + + np->scripth0->script0_ba[0] = cpu_to_scr(vtobus(np->script0)); + np->scripth0->script0_ba64[0] = cpu_to_scr(vtobus(np->script0)); + np->scripth0->scripth0_ba64[0] = cpu_to_scr(vtobus(np->scripth0)); + np->scripth0->ram_seg64[0] = np->scr_ram_seg; + + /* + ** Prepare the idle and invalid task actions. + */ + np->idletask.start = cpu_to_scr(NCB_SCRIPT_PHYS (np, idle)); + np->idletask.restart = cpu_to_scr(NCB_SCRIPTH_PHYS (np, bad_i_t_l)); + np->p_idletask = vtobus(&np->idletask); + + np->notask.start = cpu_to_scr(NCB_SCRIPT_PHYS (np, idle)); + np->notask.restart = cpu_to_scr(NCB_SCRIPTH_PHYS (np, bad_i_t_l)); + np->p_notask = vtobus(&np->notask); + + np->bad_i_t_l.start = cpu_to_scr(NCB_SCRIPT_PHYS (np, idle)); + np->bad_i_t_l.restart = cpu_to_scr(NCB_SCRIPTH_PHYS (np, bad_i_t_l)); + np->p_bad_i_t_l = vtobus(&np->bad_i_t_l); + + np->bad_i_t_l_q.start = cpu_to_scr(NCB_SCRIPT_PHYS (np, idle)); + np->bad_i_t_l_q.restart = cpu_to_scr(NCB_SCRIPTH_PHYS (np,bad_i_t_l_q)); + np->p_bad_i_t_l_q = vtobus(&np->bad_i_t_l_q); + + /* + ** Allocate and prepare the bad lun table. + */ + np->badluntbl = m_calloc(256, "BADLUNTBL", MEMO_WARN); + if (!np->badluntbl) + goto attach_error; + + assert (offsetof(struct lcb, resel_task) == 0); + np->resel_badlun = cpu_to_scr(NCB_SCRIPTH_PHYS(np, bad_identify)); + + for (i = 0 ; i < 64 ; i++) + np->badluntbl[i] = cpu_to_scr(vtobus(&np->resel_badlun)); + + /* + ** Prepare the target bus address array. + */ + np->script0->targtbl[0] = cpu_to_scr(vtobus(np->targtbl)); + for (i = 0 ; i < MAX_TARGET ; i++) { + np->targtbl[i] = cpu_to_scr(vtobus(&np->target[i])); + np->target[i].b_luntbl = cpu_to_scr(vtobus(np->badluntbl)); + } + + /* + ** Patch the script for LED support. + */ + + if (np->features & FE_LED0) { + np->script0->idle[0] = + cpu_to_scr(SCR_REG_REG(gpreg, SCR_OR, 0x01)); + np->script0->reselected[0] = + cpu_to_scr(SCR_REG_REG(gpreg, SCR_AND, 0xfe)); + np->script0->start[0] = + cpu_to_scr(SCR_REG_REG(gpreg, SCR_AND, 0xfe)); + } + + /* + ** DEL 472 - 53C896 Rev 1 - Part Number 609-0393055 - ITEM 5. + */ + if (np->device_id == PCI_DEVICE_ID_NCR_53C896 && + np->revision_id <= 0x1 && (np->features & FE_NOPM)) { + np->scatter = ncr_scatter_896R1; +#ifndef SCSI_NCR_PROFILE_SUPPORT +#define XXX 0 +#else +#define XXX 3 +#endif + np->script0->dataphase[XXX] = cpu_to_scr(SCR_JUMP); + np->script0->dataphase[XXX+1] = + cpu_to_scr(NCB_SCRIPTH_PHYS (np, tweak_pmj)); +#undef XXX + } + else +#ifdef DEBUG_896R1 + np->scatter = ncr_scatter_896R1; +#else + np->scatter = ncr_scatter; +#endif + + /* + ** Reset chip. + ** We should use ncr_soft_reset(), but we donnot want to do + ** so, since we may not be safe if ABRT interrupt occurs due + ** to the BIOS or previous O/S having enable this interrupt. + */ + OUTB (nc_istat, SRST); + UDELAY(10); + OUTB (nc_istat, 0); + + /* + ** Now check the cache handling of the pci chipset. + */ + + if (ncr_snooptest (np)) { + printk (KERN_ERR "CACHE INCORRECTLY CONFIGURED.\n"); + goto attach_error; + }; + + /* + ** Install the interrupt handler. + */ + if (request_irq(device->slot.irq, sym53c8xx_intr, + ((driver_setup.irqm & 0x10) ? 0 : SA_SHIRQ) | +#if LINUX_VERSION_CODE < LinuxVersionCode(2,2,0) + ((driver_setup.irqm & 0x20) ? 0 : SA_INTERRUPT), +#else + 0, +#endif + NAME53C8XX, np)) { + printk(KERN_ERR "%s: request irq %d failure\n", + ncr_name(np), device->slot.irq); + goto attach_error; + } + np->irq = device->slot.irq; + + /* + ** After SCSI devices have been opened, we cannot + ** reset the bus safely, so we do it here. + ** Interrupt handler does the real work. + ** Process the reset exception, + ** if interrupts are not enabled yet. + ** Then enable disconnects. + */ + NCR_LOCK_NCB(np, flags); + if (ncr_reset_scsi_bus(np, 0, driver_setup.settle_delay) != 0) { + printk(KERN_ERR "%s: FATAL ERROR: CHECK SCSI BUS - CABLES, TERMINATION, DEVICE POWER etc.!\n", ncr_name(np)); + + NCR_UNLOCK_NCB(np, flags); + goto attach_error; + } + ncr_exception (np); + + /* + ** The middle-level SCSI driver does not + ** wait for devices to settle. + ** Wait synchronously if more than 2 seconds. + */ + if (driver_setup.settle_delay > 2) { + printk(KERN_INFO "%s: waiting %d seconds for scsi devices to settle...\n", + ncr_name(np), driver_setup.settle_delay); + MDELAY (1000 * driver_setup.settle_delay); + } + + /* + ** start the timeout daemon + */ + np->lasttime=0; + ncr_timeout (np); + + /* + ** use SIMPLE TAG messages by default + */ +#ifdef SCSI_NCR_ALWAYS_SIMPLE_TAG + np->order = M_SIMPLE_TAG; +#endif + + /* + ** Done. + */ + if (!first_host) + first_host = instance; + + /* + ** Fill Linux host instance structure + ** and return success. + */ + instance->max_channel = 0; + instance->max_id = np->maxwide ? 16 : 8; + instance->max_lun = SCSI_NCR_MAX_LUN; +#ifndef NCR_IOMAPPED + instance->base = (char *) np->reg; +#endif + instance->irq = np->irq; + instance->unique_id = np->base_io; + instance->io_port = np->base_io; + instance->n_io_port = np->base_ws; + instance->dma_channel = 0; + instance->select_queue_depths = sym53c8xx_select_queue_depths; + + NCR_UNLOCK_NCB(np, flags); + + /* + ** Now let the generic SCSI driver + ** look for the SCSI devices on the bus .. + */ + return 0; + +attach_error: + if (!instance) return -1; + printk(KERN_INFO "%s: giving up ...\n", ncr_name(np)); + if (np) + ncr_free_resources(np); + scsi_unregister(instance); + + return -1; + } + + +/* +** Free controller resources. +*/ +static void ncr_free_resources(ncb_p np) +{ + ccb_p cp; + tcb_p tp; + lcb_p lp; + int target, lun; + + if (np->irq) + free_irq(np->irq, np); + if (np->base_io) + release_region(np->base_io, np->base_ws); +#ifndef NCR_IOMAPPED + if (np->base_va) + unmap_pci_mem(np->base_va, np->base_ws); +#endif + if (np->scripth0) + m_free(np->scripth0, sizeof(struct scripth), "SCRIPTH"); + if (np->script0) + m_free(np->script0, sizeof(struct script), "SCRIPT"); + if (np->squeue) + m_free(np->squeue, sizeof(ncrcmd)*(MAX_START*2), "SQUEUE"); + if (np->dqueue) + m_free(np->dqueue, sizeof(ncrcmd)*(MAX_START*2),"DQUEUE"); + + while ((cp = np->ccbc) != NULL) { + np->ccbc = cp->link_ccb; + m_free(cp, sizeof(*cp), "CCB"); + } + + if (np->badluntbl) + m_free(np->badluntbl, 256,"BADLUNTBL"); + + for (target = 0; target < MAX_TARGET ; target++) { + tp = &np->target[target]; + for (lun = 0 ; lun < MAX_LUN ; lun++) { + lp = tp->lp[lun]; + if (!lp) + continue; + if (lp->tasktbl != &lp->tasktbl_0) + m_free(lp->tasktbl, 256, "TASKTBL"); + m_free(lp, sizeof(*lp), "LCB"); + } + } + + m_free(np, sizeof(*np), "NCB"); +} + + +/*========================================================== +** +** +** Done SCSI commands list management. +** +** We donnot enter the scsi_done() callback immediately +** after a command has been seen as completed but we +** insert it into a list which is flushed outside any kind +** of driver critical section. +** This allows to do minimal stuff under interrupt and +** inside critical sections and to also avoid locking up +** on recursive calls to driver entry points under SMP. +** In fact, the only kernel point which is entered by the +** driver with a driver lock set is get_free_pages(GFP_ATOMIC...) +** that shall not reenter the driver under any circumstance. +** +**========================================================== +*/ +static inline void ncr_queue_done_cmd(ncb_p np, Scsi_Cmnd *cmd) +{ + cmd->host_scribble = (char *) np->done_list; + np->done_list = cmd; +} + +static inline void ncr_flush_done_cmds(Scsi_Cmnd *lcmd) +{ + Scsi_Cmnd *cmd; + + while (lcmd) { + cmd = lcmd; + lcmd = (Scsi_Cmnd *) cmd->host_scribble; + cmd->scsi_done(cmd); + } +} + + +/*========================================================== +** +** +** Start execution of a SCSI command. +** This is called from the generic SCSI driver. +** +** +**========================================================== +*/ +static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd) +{ +/* Scsi_Device *device = cmd->device; */ + tcb_p tp = &np->target[cmd->target]; + lcb_p lp = tp->lp[cmd->lun]; + ccb_p cp; + + int segments; + u_char nego, idmsg, *msgptr; + u_int msglen; + int direction; + u_int32 lastp, goalp; + + /*--------------------------------------------- + ** + ** Some shortcuts ... + ** + **--------------------------------------------- + */ + if ((cmd->target == np->myaddr ) || + (cmd->target >= MAX_TARGET) || + (cmd->lun >= MAX_LUN )) { + return(DID_BAD_TARGET); + } + + /*--------------------------------------------- + ** + ** Complete the 1st TEST UNIT READY command + ** with error condition if the device is + ** flagged NOSCAN, in order to speed up + ** the boot. + ** + **--------------------------------------------- + */ + if (cmd->cmnd[0] == 0 && (tp->usrflag & UF_NOSCAN)) { + tp->usrflag &= ~UF_NOSCAN; + return DID_BAD_TARGET; + } + + if (DEBUG_FLAGS & DEBUG_TINY) { + PRINT_ADDR(cmd); + printk ("CMD=%x ", cmd->cmnd[0]); + } + + /*--------------------------------------------------- + ** + ** Assign a ccb / bind cmd. + ** If resetting, shorten settle_time if necessary + ** in order to avoid spurious timeouts. + ** If resetting or no free ccb, + ** insert cmd into the waiting list. + ** + **---------------------------------------------------- + */ + if (np->settle_time && cmd->timeout_per_command >= HZ && + np->settle_time > jiffies + cmd->timeout_per_command - HZ) { + np->settle_time = jiffies + cmd->timeout_per_command - HZ; + } + + if (np->settle_time || !(cp=ncr_get_ccb (np, cmd->target, cmd->lun))) { + insert_into_waiting_list(np, cmd); + return(DID_OK); + } + cp->cmd = cmd; + + /*--------------------------------------------------- + ** + ** Enable tagged queue if asked by scsi ioctl + ** + **---------------------------------------------------- + */ +#if 0 /* This stuff was only usefull for linux-1.2.13 */ + if (lp && !lp->numtags && cmd->device && cmd->device->tagged_queue) { + lp->numtags = tp->usrtags; + ncr_setup_tags (np, cp->target, cp->lun); + } +#endif + +#ifdef SCSI_NCR_PROFILE_SUPPORT + cp->phys.num_disc = 0; +#endif + + /*--------------------------------------------------- + ** + ** negotiation required? + ** + **--------------------------------------------------- + */ + + nego = 0; + + if ((!tp->widedone || !tp->period) && !tp->nego_cp && tp->inq_done && lp) { + + /* + ** negotiate wide transfers ? + */ + + if (!tp->widedone) { + if (tp->inq_byte7 & INQ7_WIDE16) { + nego = NS_WIDE; + } else + tp->widedone=1; + }; + + /* + ** negotiate synchronous transfers? + */ + + if (!nego && !tp->period) { + if (tp->inq_byte7 & INQ7_SYNC) { + nego = NS_SYNC; + } else { + tp->period =0xffff; + PRINT_TARGET(np, cp->target); + printk ("target did not report SYNC.\n"); + }; + }; + + /* + ** remember nego is pending for the target. + ** Avoid to start a nego for all queued commands + ** when tagged command queuing is enabled. + */ + + if (nego) + tp->nego_cp = cp; + }; + + /*---------------------------------------------------- + ** + ** Build the identify / tag / sdtr message + ** + **---------------------------------------------------- + */ + + idmsg = M_IDENTIFY | cp->lun; + + if (cp ->tag != NO_TAG || (lp && !(tp->usrflag & UF_NODISC))) + idmsg |= 0x40; + + msgptr = cp->scsi_smsg; + msglen = 0; + msgptr[msglen++] = idmsg; + + if (cp->tag != NO_TAG) { + char order = np->order; + + /* + ** Force ordered tag if necessary to avoid timeouts + ** and to preserve interactivity. + */ + if (lp && lp->tags_stime + (3*HZ) <= jiffies) { + if (lp->tags_smap) { + order = M_ORDERED_TAG; + if ((DEBUG_FLAGS & DEBUG_TAGS)||bootverbose>2){ + PRINT_ADDR(cmd); + printk("ordered tag forced.\n"); + } + } + lp->tags_stime = jiffies; + lp->tags_smap = lp->tags_umap; + } + + if (order == 0) { + /* + ** Ordered write ops, unordered read ops. + */ + switch (cmd->cmnd[0]) { + case 0x08: /* READ_SMALL (6) */ + case 0x28: /* READ_BIG (10) */ + case 0xa8: /* READ_HUGE (12) */ + order = M_SIMPLE_TAG; + break; + default: + order = M_ORDERED_TAG; + } + } + msgptr[msglen++] = order; + /* + ** Actual tags are numbered 1,3,5,..2*MAXTAGS+1, + ** since we may have to deal with devices that have + ** problems with #TAG 0 or too great #TAG numbers. + */ + msgptr[msglen++] = (cp->tag << 1) + 1; + } + + switch (nego) { + case NS_SYNC: + msgptr[msglen++] = M_EXTENDED; + msgptr[msglen++] = 3; + msgptr[msglen++] = M_X_SYNC_REQ; + msgptr[msglen++] = tp->maxoffs ? tp->minsync : 0; + msgptr[msglen++] = tp->maxoffs; + if (DEBUG_FLAGS & DEBUG_NEGO) { + PRINT_ADDR(cp->cmd); + printk ("sync msgout: "); + ncr_show_msg (&cp->scsi_smsg [msglen-5]); + printk (".\n"); + }; + break; + case NS_WIDE: + msgptr[msglen++] = M_EXTENDED; + msgptr[msglen++] = 2; + msgptr[msglen++] = M_X_WIDE_REQ; + msgptr[msglen++] = tp->usrwide; + if (DEBUG_FLAGS & DEBUG_NEGO) { + PRINT_ADDR(cp->cmd); + printk ("wide msgout: "); + ncr_show_msg (&cp->scsi_smsg [msglen-4]); + printk (".\n"); + }; + break; + }; + + cp->host_flags = 0; + + /*---------------------------------------------------- + ** + ** Build the data descriptors + ** + **---------------------------------------------------- + */ + + segments = np->scatter (cp, cp->cmd); + + if (segments < 0) { + ncr_free_ccb(np, cp); + return(DID_ERROR); + } + + /*---------------------------------------------------- + ** + ** Determine xfer direction. + ** + **---------------------------------------------------- + */ + if (!cp->data_len) + direction = 0; + else { + switch((int) cmd->cmnd[0]) { + case 0x08: /* READ(6) 08 */ + case 0x28: /* READ(10) 28 */ + case 0xA8: /* READ(12) A8 */ + direction = XFER_IN; + break; + case 0x0A: /* WRITE(6) 0A */ + case 0x2A: /* WRITE(10) 2A */ + case 0xAA: /* WRITE(12) AA */ + direction = XFER_OUT; + break; + default: + direction = (XFER_IN|XFER_OUT); + break; + } + } + + /*---------------------------------------------------- + ** + ** Set the DATA POINTER. + ** + **---------------------------------------------------- + */ + + /* + ** Default to no data transfer. + */ + lastp = goalp = NCB_SCRIPTH_PHYS (np, no_data); + + /* + ** Compute data out pointers, if needed. + */ + if (direction & XFER_OUT) { + goalp = NCB_SCRIPT_PHYS (np, data_out2) + 8; +#if MAX_SCATTERH != 0 + if (segments <= MAX_SCATTERL) + lastp = goalp - 8 - (segments * (SCR_SG_SIZE*4)); + else { + lastp = NCB_SCRIPTH_PHYS (np, hdata_out2); + lastp -= (segments - MAX_SCATTERL) * (SCR_SG_SIZE*4); + } +#else + lastp = goalp - 8 - (segments * (SCR_SG_SIZE*4)); +#endif + /* + ** If actual data direction is unknown, save pointers + ** in header. The SCRIPTS will swap them to current + ** if target decision will be data out. + */ + if (direction & XFER_IN) { + cp->phys.header.wgoalp = cpu_to_scr(goalp); + cp->phys.header.wlastp = cpu_to_scr(lastp); + } + } + + /* + ** Compute data in pointers, if needed. + */ + if (direction & XFER_IN) { + goalp = NCB_SCRIPT_PHYS (np, data_in2) + 8; +#if MAX_SCATTERH != 0 + if (segments <= MAX_SCATTERL) + lastp = goalp - 8 - (segments * (SCR_SG_SIZE*4)); + else { + lastp = NCB_SCRIPTH_PHYS (np, hdata_in2); + lastp -= (segments - MAX_SCATTERL) * (SCR_SG_SIZE*4); + } +#else + lastp = goalp - 8 - (segments * (SCR_SG_SIZE*4)); +#endif + } + + /* + ** Set all pointers values needed by SCRIPTS. + ** If direction is unknown, start at data_io. + */ + cp->phys.header.lastp = cpu_to_scr(lastp); + cp->phys.header.goalp = cpu_to_scr(goalp); + + if ((direction & (XFER_IN|XFER_OUT)) == (XFER_IN|XFER_OUT)) + cp->phys.header.savep = + cpu_to_scr(NCB_SCRIPTH_PHYS (np, data_io)); + else + cp->phys.header.savep= cpu_to_scr(lastp); + + /* + ** Save the initial data pointer in order to be able + ** to redo the command. + */ + cp->startp = cp->phys.header.savep; + + /*---------------------------------------------------- + ** + ** fill in ccb + ** + **---------------------------------------------------- + ** + ** + ** physical -> virtual backlink + ** Generic SCSI command + */ + + /* + ** Startqueue + */ + cp->phys.header.go.start = cpu_to_scr(NCB_SCRIPT_PHYS (np,select)); + cp->phys.header.go.restart = cpu_to_scr(NCB_SCRIPT_PHYS (np,resel_dsa)); + /* + ** select + */ + cp->phys.select.sel_id = cp->target; + cp->phys.select.sel_scntl3 = tp->wval; + cp->phys.select.sel_sxfer = tp->sval; + /* + ** message + */ + cp->phys.smsg.addr = cpu_to_scr(CCB_PHYS (cp, scsi_smsg)); + cp->phys.smsg.size = cpu_to_scr(msglen); + + /* + ** command + */ + cp->phys.cmd.addr = cpu_to_scr(vtobus (&cmd->cmnd[0])); + cp->phys.cmd.size = cpu_to_scr(cmd->cmd_len); + + /* + ** status + */ + cp->actualquirks = tp->quirks; + cp->host_status = nego ? HS_NEGOTIATE : HS_BUSY; + cp->scsi_status = S_ILLEGAL; + + cp->xerr_status = XE_OK; + cp->nego_status = nego; + + /*---------------------------------------------------- + ** + ** Critical region: start this job. + ** + **---------------------------------------------------- + */ + + /* + ** activate this job. + */ + + /* Compute a time limit greater than the middle-level driver one */ + if (cmd->timeout_per_command > 0) + cp->tlimit = jiffies + cmd->timeout_per_command + HZ; + else + cp->tlimit = jiffies + 86400 * HZ;/* No timeout=24 hours */ + + /* + ** insert next CCBs into start queue. + ** 2 max at a time is enough to flush the CCB wait queue. + */ + cp->auto_sense = 0; + if (lp) + ncr_start_next_ccb(np, lp, 2); + else + ncr_put_start_queue(np, cp); + + /* + ** Command is successfully queued. + */ + + return(DID_OK); +} + + +/*========================================================== +** +** +** Insert a CCB into the start queue and wake up the +** SCRIPTS processor. +** +** +**========================================================== +*/ + +static void ncr_start_next_ccb(ncb_p np, lcb_p lp, int maxn) +{ + XPT_QUEHEAD *qp; + ccb_p cp; + + while (maxn-- && lp->queuedccbs < lp->queuedepth) { + qp = xpt_remque_head(&lp->wait_ccbq); + if (!qp) + break; + ++lp->queuedccbs; + cp = xpt_que_entry(qp, struct ccb, link_ccbq); + xpt_insque_tail(qp, &lp->busy_ccbq); + lp->tasktbl[cp->tag == NO_TAG ? 0 : cp->tag] = + cpu_to_scr(cp->p_ccb); + ncr_put_start_queue(np, cp); + } +} + +static void ncr_put_start_queue(ncb_p np, ccb_p cp) +{ + u_short qidx; + + /* + ** insert into start queue. + */ + qidx = np->squeueput + 2; + if (qidx >= MAX_START*2) qidx = 0; + + np->squeue [qidx] = cpu_to_scr(np->p_idletask); + MEMORY_BARRIER(); + np->squeue [np->squeueput] = cpu_to_scr(cp->p_ccb); + + np->squeueput = qidx; + cp->queued = 1; + + if (DEBUG_FLAGS & DEBUG_QUEUE) + printk ("%s: queuepos=%d.\n", ncr_name (np), np->squeueput); + + /* + ** Script processor may be waiting for reselect. + ** Wake it up. + */ + MEMORY_BARRIER(); + OUTB (nc_istat, SIGP); +} + + +/*========================================================== +** +** Soft reset the chip. +** +** Some 896 and 876 chip revisions may hang-up if we set +** the SRST (soft reset) bit at the wrong time when SCRIPTS +** are running. +** So, we need to abort the current operation prior to +** soft resetting the chip. +** +**========================================================== +*/ + +static void ncr_soft_reset(ncb_p np) +{ + u_char istat; + int i; + + OUTB (nc_istat, CABRT); + for (i = 1000000 ; i ; --i) { + istat = INB (nc_istat); + if (istat & SIP) { + INW (nc_sist); + continue; + } + if (istat & DIP) { + OUTB (nc_istat, 0); + INB (nc_dstat); + break; + } + } + if (!i) + printk("%s: unable to abort current chip operation.\n", + ncr_name(np)); + OUTB (nc_istat, SRST); + UDELAY(10); + OUTB (nc_istat, 0); +} + +/*========================================================== +** +** +** Start reset process. +** If reset in progress do nothing. +** The interrupt handler will reinitialize the chip. +** The timeout handler will wait for settle_time before +** clearing it and so resuming command processing. +** +** +**========================================================== +*/ +static void ncr_start_reset(ncb_p np) +{ + if (!np->settle_time) { + (void) ncr_reset_scsi_bus(np, 1, driver_setup.settle_delay); + } + } + +static int ncr_reset_scsi_bus(ncb_p np, int enab_int, int settle_delay) +{ + u_int32 term; + int retv = 0; + + np->settle_time = jiffies + settle_delay * HZ; + + if (bootverbose > 1) + printk("%s: resetting, " + "command processing suspended for %d seconds\n", + ncr_name(np), settle_delay); + + ncr_soft_reset(np); /* Soft reset the chip */ + UDELAY (2000); /* The 895/6 need time for the bus mode to settle */ + if (enab_int) + OUTW (nc_sien, RST); + /* + ** Enable Tolerant, reset IRQD if present and + ** properly set IRQ mode, prior to resetting the bus. + */ + OUTB (nc_stest3, TE); + OUTB (nc_dcntl, (np->rv_dcntl & IRQM)); + OUTB (nc_scntl1, CRST); + UDELAY (200); + + if (!driver_setup.bus_check) + goto out; + /* + ** Check for no terminators or SCSI bus shorts to ground. + ** Read SCSI data bus, data parity bits and control signals. + ** We are expecting RESET to be TRUE and other signals to be + ** FALSE. + */ + term = INB(nc_sstat0); /* rst, sdp0 */ + term = ((term & 2) << 7) + ((term & 1) << 16); + term |= ((INB(nc_sstat2) & 0x01) << 25) | /* sdp1 */ + (INW(nc_sbdl) << 9) | /* d15-0 */ + INB(nc_sbcl); /* req, ack, bsy, sel, atn, msg, cd, io */ + + if (!(np->features & FE_WIDE)) + term &= 0x3ffff; + + if (term != (2<<7)) { + printk("%s: suspicious SCSI data while resetting the BUS.\n", + ncr_name(np)); + printk("%s: %sdp0,d7-0,rst,req,ack,bsy,sel,atn,msg,c/d,i/o = " + "0x%lx, expecting 0x%lx\n", + ncr_name(np), + (np->features & FE_WIDE) ? "dp1,d15-8," : "", + (u_long)term, (u_long)(2<<7)); + if (driver_setup.bus_check == 1) + retv = 1; + } +out: + OUTB (nc_scntl1, 0); + return retv; +} + +/*========================================================== +** +** +** Reset the SCSI BUS. +** This is called from the generic SCSI driver. +** +** +**========================================================== +*/ +static int ncr_reset_bus (ncb_p np, Scsi_Cmnd *cmd, int sync_reset) +{ +/* Scsi_Device *device = cmd->device; */ + ccb_p cp; + int found; + +/* + * Return immediately if reset is in progress. + */ + if (np->settle_time) { + return SCSI_RESET_PUNT; + } +/* + * Start the reset process. + * The script processor is then assumed to be stopped. + * Commands will now be queued in the waiting list until a settle + * delay of 2 seconds will be completed. + */ + ncr_start_reset(np); +/* + * First, look in the wakeup list + */ + for (found=0, cp=np->ccbc; cp; cp=cp->link_ccb) { + /* + ** look for the ccb of this command. + */ + if (cp->host_status == HS_IDLE) continue; + if (cp->cmd == cmd) { + found = 1; + break; + } + } +/* + * Then, look in the waiting list + */ + if (!found && retrieve_from_waiting_list(0, np, cmd)) + found = 1; +/* + * Wake-up all awaiting commands with DID_RESET. + */ + reset_waiting_list(np); +/* + * Wake-up all pending commands with HS_RESET -> DID_RESET. + */ + ncr_wakeup(np, HS_RESET); +/* + * If the involved command was not in a driver queue, and the + * scsi driver told us reset is synchronous, and the command is not + * currently in the waiting list, complete it with DID_RESET status, + * in order to keep it alive. + */ + if (!found && sync_reset && !retrieve_from_waiting_list(0, np, cmd)) { + SetScsiResult(cmd, DID_RESET, 0); + ncr_queue_done_cmd(np, cmd); + } + + return SCSI_RESET_SUCCESS; +} + +/*========================================================== +** +** +** Abort an SCSI command. +** This is called from the generic SCSI driver. +** +** +**========================================================== +*/ +static int ncr_abort_command (ncb_p np, Scsi_Cmnd *cmd) +{ +/* Scsi_Device *device = cmd->device; */ + ccb_p cp; + int found; + int retv; + +/* + * First, look for the scsi command in the waiting list + */ + if (remove_from_waiting_list(np, cmd)) { + SetScsiResult(cmd, DID_ABORT, 0); + ncr_queue_done_cmd(np, cmd); + return SCSI_ABORT_SUCCESS; + } + +/* + * Then, look in the wakeup list + */ + for (found=0, cp=np->ccbc; cp; cp=cp->link_ccb) { + /* + ** look for the ccb of this command. + */ + if (cp->host_status == HS_IDLE) continue; + if (cp->cmd == cmd) { + found = 1; + break; + } + } + + if (!found) { + return SCSI_ABORT_NOT_RUNNING; + } + + if (np->settle_time) { + return SCSI_ABORT_SNOOZE; + } + + /* + ** If the CCB is active, patch schedule jumps for the + ** script to abort the command. + */ + + cp->tlimit = 0; + switch(cp->host_status) { + case HS_BUSY: + case HS_NEGOTIATE: + printk ("%s: abort ccb=%p (cancel)\n", ncr_name (np), cp); + cp->phys.header.go.start = + cpu_to_scr(NCB_SCRIPTH_PHYS (np, cancel)); + retv = SCSI_ABORT_PENDING; + break; + case HS_DISCONNECT: + cp->phys.header.go.restart = + cpu_to_scr(NCB_SCRIPTH_PHYS (np, bad_i_t_l_q)); + retv = SCSI_ABORT_PENDING; + break; + default: + retv = SCSI_ABORT_NOT_RUNNING; + break; + + } + + /* + ** If there are no requests, the script + ** processor will sleep on SEL_WAIT_RESEL. + ** Let's wake it up, since it may have to work. + */ + OUTB (nc_istat, SIGP); + + return retv; +} + +/*========================================================== +** +** Linux release module stuff. +** +** Called before unloading the module +** Detach the host. +** We have to free resources and halt the NCR chip +** +**========================================================== +*/ + +#ifdef MODULE +static int ncr_detach(ncb_p np) +{ + int i; + + printk("%s: detaching ...\n", ncr_name(np)); + +/* +** Stop the ncr_timeout process +** Set release_stage to 1 and wait that ncr_timeout() set it to 2. +*/ + np->release_stage = 1; + for (i = 50 ; i && np->release_stage != 2 ; i--) MDELAY (100); + if (np->release_stage != 2) + printk("%s: the timer seems to be already stopped\n", + ncr_name(np)); + else np->release_stage = 2; + +/* +** Reset NCR chip. +** We should use ncr_soft_reset(), but we donnot want to do +** so, since we may not be safe if interrupts occur. +*/ + + printk("%s: resetting chip\n", ncr_name(np)); + OUTB (nc_istat, SRST); + UDELAY (100); + OUTB (nc_istat, 0 ); + +/* +** Restore bios setting for automatic clock detection. +*/ + OUTB(nc_dmode, np->sv_dmode); + OUTB(nc_dcntl, np->sv_dcntl); + OUTB(nc_ctest3, np->sv_ctest3); + OUTB(nc_ctest4, np->sv_ctest4); + OUTB(nc_ctest5, np->sv_ctest5); + OUTB(nc_gpcntl, np->sv_gpcntl); + OUTB(nc_stest2, np->sv_stest2); + + ncr_selectclock(np, np->sv_scntl3); +/* +** Free host resources +*/ + ncr_free_resources(np); + + return 1; +} +#endif + +/*========================================================== +** +** +** Complete execution of a SCSI command. +** Signal completion to the generic SCSI driver. +** +** +**========================================================== +*/ + +void ncr_complete (ncb_p np, ccb_p cp) +{ + Scsi_Cmnd *cmd; + tcb_p tp; + lcb_p lp; + + /* + ** Sanity check + */ + if (!cp || !cp->cmd) + return; + + /* + ** Gather profiling data + */ +#ifdef SCSI_NCR_PROFILE_SUPPORT + ncb_profile (np, cp); +#endif + + if (DEBUG_FLAGS & DEBUG_TINY) + printk ("CCB=%lx STAT=%x/%x\n", (unsigned long)cp, + cp->host_status,cp->scsi_status); + + /* + ** Get command, target and lun pointers. + */ + + cmd = cp->cmd; + cp->cmd = NULL; + tp = &np->target[cp->target]; + lp = tp->lp[cp->lun]; + + /* + ** We donnot queue more than 1 ccb per target + ** with negotiation at any time. If this ccb was + ** used for negotiation, clear this info in the tcb. + */ + + if (cp == tp->nego_cp) + tp->nego_cp = 0; + + /* + ** If auto-sense performed, change scsi status. + */ + if (cp->auto_sense) { + cp->scsi_status = cp->auto_sense; + } + + /* + ** Check for parity errors. + */ + + if (cp->host_flags & HF_PAR_ERR) { + PRINT_ADDR(cmd); + printk ("unrecovered SCSI parity error.\n"); + if (cp->host_status==HS_COMPLETE) + cp->host_status = HS_FAIL; + } + + /* + ** Check for extended errors. + */ + + if (cp->xerr_status != XE_OK) { + PRINT_ADDR(cmd); + switch (cp->xerr_status) { + case XE_EXTRA_DATA: + printk ("extraneous data discarded.\n"); + break; + case XE_BAD_PHASE: + printk ("illegal scsi phase (4/5).\n"); + break; + default: + printk ("extended error %d.\n", cp->xerr_status); + break; + } + if (cp->host_status==HS_COMPLETE) + cp->host_status = HS_FAIL; + } + + /* + ** Print out any error for debugging purpose. + */ + if (DEBUG_FLAGS & (DEBUG_RESULT|DEBUG_TINY)) { + if (cp->host_status!=HS_COMPLETE || cp->scsi_status!=S_GOOD) { + PRINT_ADDR(cmd); + printk ("ERROR: cmd=%x host_status=%x scsi_status=%x\n", + cmd->cmnd[0], cp->host_status, cp->scsi_status); + } + } + + /* + ** Check the status. + */ + if ( (cp->host_status == HS_COMPLETE) + && (cp->scsi_status == S_GOOD || + cp->scsi_status == S_COND_MET)) { + /* + ** All went well (GOOD status). + ** CONDITION MET status is returned on + ** `Pre-Fetch' or `Search data' success. + */ + SetScsiResult(cmd, DID_OK, cp->scsi_status); + + /* + ** @RESID@ + ** Could dig out the correct value for resid, + ** but it would be quite complicated. + */ + /* if (cp->phys.header.lastp != cp->phys.header.goalp) */ + + /* + ** Allocate the lcb if not yet. + */ + if (!lp) + ncr_alloc_lcb (np, cp->target, cp->lun); + + /* + ** On standard INQUIRY response (EVPD and CmDt + ** not set), setup logical unit according to + ** announced capabilities (we need the 1rst 7 bytes). + */ + if (cmd->cmnd[0] == 0x12 && !(cmd->cmnd[1] & 0x3) && + cmd->cmnd[4] >= 7 && !cmd->use_sg) { + ncr_setup_lcb (np, cp->target, cp->lun, + (char *) cmd->request_buffer); + } + + tp->bytes += cp->data_len; + tp->transfers ++; + + /* + ** If tags was reduced due to queue full, + ** increase tags if 1000 good status received. + */ + if (lp && lp->usetags && lp->numtags < lp->maxtags) { + ++lp->num_good; + if (lp->num_good >= 1000) { + lp->num_good = 0; + ++lp->numtags; + ncr_setup_tags (np, cp->target, cp->lun); + } + } + } else if ((cp->host_status == HS_COMPLETE) + && (cp->scsi_status == S_CHECK_COND)) { + /* + ** Check condition code + */ + SetScsiResult(cmd, DID_OK, S_CHECK_COND); + + if (DEBUG_FLAGS & (DEBUG_RESULT|DEBUG_TINY)) { + u_char * p = (u_char*) & cmd->sense_buffer; + int i; + PRINT_ADDR(cmd); + printk ("sense data:"); + for (i=0; i<14; i++) printk (" %x", *p++); + printk (".\n"); + } + + } else if ((cp->host_status == HS_COMPLETE) + && (cp->scsi_status == S_BUSY || + cp->scsi_status == S_QUEUE_FULL)) { + + /* + ** Target is busy. + */ + SetScsiResult(cmd, DID_OK, cp->scsi_status); + + } else if ((cp->host_status == HS_SEL_TIMEOUT) + || (cp->host_status == HS_TIMEOUT)) { + + /* + ** No response + */ + SetScsiResult(cmd, DID_TIME_OUT, cp->scsi_status); + + } else if (cp->host_status == HS_RESET) { + + /* + ** SCSI bus reset + */ + SetScsiResult(cmd, DID_RESET, cp->scsi_status); + + } else if (cp->host_status == HS_ABORTED) { + + /* + ** Transfer aborted + */ + SetScsiResult(cmd, DID_ABORT, cp->scsi_status); + + } else { + + /* + ** Other protocol messes + */ + PRINT_ADDR(cmd); + printk ("COMMAND FAILED (%x %x) @%p.\n", + cp->host_status, cp->scsi_status, cp); + + SetScsiResult(cmd, DID_ERROR, cp->scsi_status); + } + + /* + ** trace output + */ + + if (tp->usrflag & UF_TRACE) { + u_char * p; + int i; + PRINT_ADDR(cmd); + printk (" CMD:"); + p = (u_char*) &cmd->cmnd[0]; + for (i=0; icmd_len; i++) printk (" %x", *p++); + + if (cp->host_status==HS_COMPLETE) { + switch (cp->scsi_status) { + case S_GOOD: + printk (" GOOD"); + break; + case S_CHECK_COND: + printk (" SENSE:"); + p = (u_char*) &cmd->sense_buffer; + for (i=0; i<14; i++) + printk (" %x", *p++); + break; + default: + printk (" STAT: %x\n", cp->scsi_status); + break; + } + } else printk (" HOSTERROR: %x", cp->host_status); + printk ("\n"); + } + + /* + ** Free this ccb + */ + ncr_free_ccb (np, cp); + + /* + ** requeue awaiting scsi commands for this lun. + */ + if (lp && lp->queuedccbs < lp->queuedepth && + !xpt_que_empty(&lp->wait_ccbq)) + ncr_start_next_ccb(np, lp, 2); + + /* + ** requeue awaiting scsi commands for this controller. + */ + if (np->waiting_list) + requeue_waiting_list(np); + + /* + ** signal completion to generic driver. + */ + ncr_queue_done_cmd(np, cmd); +} + +/*========================================================== +** +** +** Signal all (or one) control block done. +** +** +**========================================================== +*/ + +/* +** The NCR has completed CCBs. +** Look at the DONE QUEUE. +*/ +int ncr_wakeup_done (ncb_p np) +{ + ccb_p cp; + int i, n; + u_long dsa; + + n = 0; + i = np->dqueueget; + while (1) { + dsa = scr_to_cpu(np->dqueue[i]); + if (!dsa) + break; + np->dqueue[i] = 0; + if ((i = i+2) >= MAX_START*2) + i = 0; + + cp = ncr_ccb_from_dsa(np, dsa); + if (cp) { + ncr_complete (np, cp); + ++n; + } + else + printk (KERN_ERR "%s: bad DSA (%lx) in done queue.\n", + ncr_name(np), dsa); + } + np->dqueueget = i; + + return n; +} + +/* +** Complete all active CCBs. +*/ +void ncr_wakeup (ncb_p np, u_long code) +{ + ccb_p cp = np->ccbc; + + while (cp) { + if (cp->host_status != HS_IDLE) { + cp->host_status = code; + ncr_complete (np, cp); + } + cp = cp->link_ccb; + } +} + +/*========================================================== +** +** +** Start NCR chip. +** +** +**========================================================== +*/ + +void ncr_init (ncb_p np, int reset, char * msg, u_long code) +{ + int i; + u_long phys; + + /* + ** Reset chip if asked, otherwise just clear fifos. + */ + + if (reset) + ncr_soft_reset(np); + else { + OUTB (nc_stest3, TE|CSF); + OUTONB (nc_ctest3, CLF); + } + + /* + ** Message. + */ + + if (msg) printk (KERN_INFO "%s: restart (%s).\n", ncr_name (np), msg); + + /* + ** Clear Start Queue + */ + phys = vtobus(np->squeue); + np->queuedepth = MAX_START - 1; /* 1 entry needed as end marker */ + for (i = 0; i < MAX_START*2; i += 2) { + np->squeue[i] = cpu_to_scr(np->p_idletask); + np->squeue[i+1] = cpu_to_scr(phys + (i+2)*4); + } + np->squeue[MAX_START*2-1] = cpu_to_scr(phys); + + + /* + ** Start at first entry. + */ + np->squeueput = 0; + np->script0->startpos[0] = cpu_to_scr(phys); + + /* + ** Clear Done Queue + */ + phys = vtobus(np->dqueue); + for (i = 0; i < MAX_START*2; i += 2) { + np->dqueue[i] = 0; + np->dqueue[i+1] = cpu_to_scr(phys + (i+2)*4); + } + np->dqueue[MAX_START*2-1] = cpu_to_scr(phys); + + /* + ** Start at first entry. + */ + np->script0->done_pos[0] = cpu_to_scr(phys); + np->dqueueget = 0; + + /* + ** Wakeup all pending jobs. + */ + ncr_wakeup (np, code); + + /* + ** Init chip. + */ + + OUTB (nc_istat, 0x00 ); /* Remove Reset, abort */ + UDELAY (2000); /* The 895 needs time for the bus mode to settle */ + + OUTB (nc_scntl0, np->rv_scntl0 | 0xc0); + /* full arb., ena parity, par->ATN */ + OUTB (nc_scntl1, 0x00); /* odd parity, and remove CRST!! */ + + ncr_selectclock(np, np->rv_scntl3); /* Select SCSI clock */ + + OUTB (nc_scid , RRE|np->myaddr); /* Adapter SCSI address */ + OUTW (nc_respid, 1ul<myaddr); /* Id to respond to */ + OUTB (nc_istat , SIGP ); /* Signal Process */ + OUTB (nc_dmode , np->rv_dmode); /* Burst length, dma mode */ + OUTB (nc_ctest5, np->rv_ctest5); /* Large fifo + large burst */ + + OUTB (nc_dcntl , NOCOM|np->rv_dcntl); /* Protect SFBR */ + OUTB (nc_ctest3, np->rv_ctest3); /* Write and invalidate */ + OUTB (nc_ctest4, np->rv_ctest4); /* Master parity checking */ + + OUTB (nc_stest2, EXT|np->rv_stest2); /* Extended Sreq/Sack filtering */ + OUTB (nc_stest3, TE); /* TolerANT enable */ + OUTB (nc_stime0, 0x0c); /* HTH disabled STO 0.25 sec */ + + /* + ** DEL 441 - 53C876 Rev 5 - Part Number 609-0392787/2788 - ITEM 2. + ** Disable overlapped arbitration. + ** The 896 Rev 1 needs also this work-around to be applied. + */ + if (np->device_id == PCI_DEVICE_ID_NCR_53C875 && + np->revision_id >= 0x10 && np->revision_id <= 0x15) + OUTB (nc_ctest0, (1<<5)); + else if (np->device_id == PCI_DEVICE_ID_NCR_53C896 && + np->revision_id <= 0x1) + np->rv_ccntl0 |= DPR; + + /* + ** If 64 bit (53C896) enable 40 bit address table + ** indirect addressing for MOVE. + */ + + if (np->features & FE_64BIT) { + OUTB (nc_ccntl1, np->rv_ccntl1); + } + + /* + ** If phase mismatch handled by scripts (53C896), + ** set PM jump addresses. + */ + + if (np->features & FE_NOPM) { + printk(KERN_INFO "%s: handling phase mismatch from SCRIPTS.\n", + ncr_name(np)); + OUTB (nc_ccntl0, np->rv_ccntl0); + OUTL (nc_pmjad1, NCB_SCRIPTH_PHYS (np, pm_handle)); + OUTL (nc_pmjad2, NCB_SCRIPTH_PHYS (np, pm_handle)); + } + + /* + ** Enable GPIO0 pin for writing if LED support from SCRIPTS. + ** Also set GPIO5 and clear GPIO6 if hardware LED control. + */ + + if (np->features & FE_LED0) + OUTB(nc_gpcntl, INB(nc_gpcntl) & ~0x01); + else if (np->features & FE_LEDC) + OUTB(nc_gpcntl, (INB(nc_gpcntl) & ~0x41) | 0x20); + + + /* + ** enable ints + */ + + OUTW (nc_sien , STO|HTH|MA|SGE|UDC|RST|PAR); + OUTB (nc_dien , MDPE|BF|SSI|SIR|IID); + + /* + ** For 895/6 enable SBMC interrupt and save current SCSI bus mode. + */ + if (np->features & FE_ULTRA2) { + OUTONW (nc_sien, SBMC); + np->scsi_mode = INB (nc_stest4) & SMODE; + } + + /* + ** Fill in target structure. + ** Reinitialize usrsync. + ** Reinitialize usrwide. + ** Prepare sync negotiation according to actual SCSI bus mode. + */ + + for (i=0;itarget[i]; + + tp->sval = 0; + tp->wval = np->rv_scntl3; + + if (tp->usrsync != 255) { + if (tp->usrsync <= np->maxsync) { + if (tp->usrsync < np->minsync) { + tp->usrsync = np->minsync; + } + } + else + tp->usrsync = 255; + }; + + if (tp->usrwide > np->maxwide) + tp->usrwide = np->maxwide; + + ncr_negotiate (np, tp); + } + + /* + ** Start script processor. + */ + MEMORY_BARRIER(); + if (np->base2_ba) { + if (bootverbose) + printk ("%s: Downloading SCSI SCRIPTS.\n", + ncr_name(np)); + if (np->features & FE_RAM8K) + phys = NCB_SCRIPTH0_PHYS (np, start_ram64); + else + phys = NCB_SCRIPTH_PHYS (np, start_ram); + } + else + phys = NCB_SCRIPT_PHYS (np, init); + + OUTL (nc_dsa, vtobus(np)); + OUTL (nc_dsp, phys); +} + +/*========================================================== +** +** Prepare the negotiation values for wide and +** synchronous transfers. +** +**========================================================== +*/ + +static void ncr_negotiate (struct ncb* np, struct tcb* tp) +{ + /* + ** minsync unit is 4ns ! + */ + + u_long minsync = tp->usrsync; + + /* + ** SCSI bus mode limit + */ + + if (np->scsi_mode && np->scsi_mode == SMODE_SE) { + if (minsync < 12) minsync = 12; + } + + /* + ** our limit .. + */ + + if (minsync < np->minsync) + minsync = np->minsync; + + /* + ** divider limit + */ + + if (minsync > np->maxsync) + minsync = 255; + + tp->minsync = minsync; + tp->maxoffs = (minsync<255 ? np->maxoffs : 0); + + /* + ** period=0: has to negotiate sync transfer + */ + + tp->period=0; + + /* + ** widedone=0: has to negotiate wide transfer + */ + tp->widedone=0; +} + +/*========================================================== +** +** Get clock factor and sync divisor for a given +** synchronous factor period. +** Returns the clock factor (in sxfer) and scntl3 +** synchronous divisor field. +** +**========================================================== +*/ + +static void ncr_getsync(ncb_p np, u_char sfac, u_char *fakp, u_char *scntl3p) +{ + u_long clk = np->clock_khz; /* SCSI clock frequency in kHz */ + int div = np->clock_divn; /* Number of divisors supported */ + u_long fak; /* Sync factor in sxfer */ + u_long per; /* Period in tenths of ns */ + u_long kpc; /* (per * clk) */ + + /* + ** Compute the synchronous period in tenths of nano-seconds + */ + if (sfac <= 10) per = 250; + else if (sfac == 11) per = 303; + else if (sfac == 12) per = 500; + else per = 40 * sfac; + + /* + ** Look for the greatest clock divisor that allows an + ** input speed faster than the period. + */ + kpc = per * clk; + while (--div >= 0) + if (kpc >= (div_10M[div] << 2)) break; + + /* + ** Calculate the lowest clock factor that allows an output + ** speed not faster than the period. + */ + fak = (kpc - 1) / div_10M[div] + 1; + +#if 0 /* This optimization does not seem very usefull */ + + per = (fak * div_10M[div]) / clk; + + /* + ** Why not to try the immediate lower divisor and to choose + ** the one that allows the fastest output speed ? + ** We dont want input speed too much greater than output speed. + */ + if (div >= 1 && fak < 8) { + u_long fak2, per2; + fak2 = (kpc - 1) / div_10M[div-1] + 1; + per2 = (fak2 * div_10M[div-1]) / clk; + if (per2 < per && fak2 <= 8) { + fak = fak2; + per = per2; + --div; + } + } +#endif + + if (fak < 4) fak = 4; /* Should never happen, too bad ... */ + + /* + ** Compute and return sync parameters for the ncr + */ + *fakp = fak - 4; + *scntl3p = ((div+1) << 4) + (sfac < 25 ? 0x80 : 0); +} + + +/*========================================================== +** +** Set actual values, sync status and patch all ccbs of +** a target according to new sync/wide agreement. +** +**========================================================== +*/ + +static void ncr_set_sync_wide_status (ncb_p np, u_char target) +{ + ccb_p cp; + tcb_p tp = &np->target[target]; + + /* + ** set actual value and sync_status + */ + OUTB (nc_sxfer, tp->sval); + OUTB (nc_scntl3, tp->wval); + + /* + ** patch ALL ccbs of this target. + */ + for (cp = np->ccbc; cp; cp = cp->link_ccb) { + if (cp->host_status == HS_IDLE) + continue; + if (cp->target != target) + continue; + cp->phys.select.sel_scntl3 = tp->wval; + cp->phys.select.sel_sxfer = tp->sval; + }; +} + +/*========================================================== +** +** Switch sync mode for current job and it's target +** +**========================================================== +*/ + +static void ncr_setsync (ncb_p np, ccb_p cp, u_char scntl3, u_char sxfer) +{ + tcb_p tp; + u_char target = INB (nc_sdid) & 0x0f; + u_char idiv; + + assert (cp); + if (!cp) return; + + assert (target == (cp->target & 0xf)); + + tp = &np->target[target]; + + if (!scntl3 || !(sxfer & 0x1f)) + scntl3 = np->rv_scntl3; + scntl3 = (scntl3 & 0xf0) | (tp->wval & EWS) | (np->rv_scntl3 & 0x07); + + /* + ** Deduce the value of controller sync period from scntl3. + ** period is in tenths of nano-seconds. + */ + + idiv = ((scntl3 >> 4) & 0x7); + if ((sxfer & 0x1f) && idiv) + tp->period = (((sxfer>>5)+4)*div_10M[idiv-1])/np->clock_khz; + else + tp->period = 0xffff; + + /* + ** Stop there if sync parameters are unchanged + */ + if (tp->sval == sxfer && tp->wval == scntl3) return; + tp->sval = sxfer; + tp->wval = scntl3; + + /* + ** Bells and whistles ;-) + */ + PRINT_TARGET(np, target); + if (sxfer & 0x01f) { + unsigned f10 = 100000 << (tp->widedone ? tp->widedone -1 : 0); + unsigned mb10 = (f10 + tp->period/2) / tp->period; + char *scsi; + + /* + ** Disable extended Sreq/Sack filtering + */ + if (tp->period <= 2000) OUTOFFB (nc_stest2, EXT); + + /* + ** Bells and whistles ;-) + */ + if (tp->period < 500) scsi = "FAST-40"; + else if (tp->period < 1000) scsi = "FAST-20"; + else if (tp->period < 2000) scsi = "FAST-10"; + else scsi = "FAST-5"; + + printk ("%s %sSCSI %d.%d MB/s (%d ns, offset %d)\n", scsi, + tp->widedone > 1 ? "WIDE " : "", + mb10 / 10, mb10 % 10, tp->period / 10, sxfer & 0x1f); + } else + printk ("%sasynchronous.\n", tp->widedone > 1 ? "wide " : ""); + + /* + ** set actual value and sync_status + ** patch ALL ccbs of this target. + */ + ncr_set_sync_wide_status(np, target); +} + +/*========================================================== +** +** Switch wide mode for current job and it's target +** SCSI specs say: a SCSI device that accepts a WDTR +** message shall reset the synchronous agreement to +** asynchronous mode. +** +**========================================================== +*/ + +static void ncr_setwide (ncb_p np, ccb_p cp, u_char wide, u_char ack) +{ + u_short target = INB (nc_sdid) & 0x0f; + tcb_p tp; + u_char scntl3; + u_char sxfer; + + assert (cp); + if (!cp) return; + + assert (target == (cp->target & 0xf)); + + tp = &np->target[target]; + tp->widedone = wide+1; + scntl3 = (tp->wval & (~EWS)) | (wide ? EWS : 0); + + sxfer = ack ? 0 : tp->sval; + + /* + ** Stop there if sync/wide parameters are unchanged + */ + if (tp->sval == sxfer && tp->wval == scntl3) return; + tp->sval = sxfer; + tp->wval = scntl3; + + /* + ** Bells and whistles ;-) + */ + if (bootverbose >= 2) { + PRINT_TARGET(np, target); + if (scntl3 & EWS) + printk ("WIDE SCSI (16 bit) enabled.\n"); + else + printk ("WIDE SCSI disabled.\n"); + } + + /* + ** set actual value and sync_status + ** patch ALL ccbs of this target. + */ + ncr_set_sync_wide_status(np, target); +} + +/*========================================================== +** +** Switch tagged mode for a target. +** +**========================================================== +*/ + +static void ncr_setup_tags (ncb_p np, u_char tn, u_char ln) +{ + tcb_p tp = &np->target[tn]; + lcb_p lp = tp->lp[ln]; + u_char reqtags, maxdepth; + + /* + ** Just in case ... + */ + if ((!tp) || (!lp)) + return; + + /* + ** If SCSI device queue depth is not yet set, leave here. + */ + if (!lp->scdev_depth) + return; + + /* + ** Donnot allow more tags than the SCSI driver can queue + ** for this device. + ** Donnot allow more tags than we can handle. + */ + maxdepth = lp->scdev_depth; + if (maxdepth > lp->maxnxs) maxdepth = lp->maxnxs; + if (lp->maxtags > maxdepth) lp->maxtags = maxdepth; + if (lp->numtags > maxdepth) lp->numtags = maxdepth; + + /* + ** only devices conformant to ANSI Version >= 2 + ** only devices capable of tagged commands + ** only if enabled by user .. + */ + if ((lp->inq_byte7 & INQ7_QUEUE) && lp->numtags > 1) { + reqtags = lp->numtags; + } else { + reqtags = 1; + }; + + /* + ** Update max number of tags + */ + lp->numtags = reqtags; + if (lp->numtags > lp->maxtags) + lp->maxtags = lp->numtags; + + /* + ** If we want to switch tag mode, we must wait + ** for no CCB to be active. + */ + if (reqtags > 1 && lp->usetags) { /* Stay in tagged mode */ + if (lp->queuedepth == reqtags) /* Already announced */ + return; + lp->queuedepth = reqtags; + } + else if (reqtags <= 1 && !lp->usetags) { /* Stay in untagged mode */ + lp->queuedepth = reqtags; + return; + } + else { /* Want to switch tag mode */ + if (lp->busyccbs) /* If not yet safe, return */ + return; + lp->queuedepth = reqtags; + lp->usetags = reqtags > 1 ? 1 : 0; + } + + /* + ** Patch the lun mini-script, according to tag mode. + */ + lp->resel_task = lp->usetags? + cpu_to_scr(NCB_SCRIPT_PHYS(np, resel_tag)) : + cpu_to_scr(NCB_SCRIPT_PHYS(np, resel_notag)); + + /* + ** Announce change to user. + */ + if (bootverbose) { + PRINT_LUN(np, tn, ln); + if (lp->usetags) + printk("tagged command queue depth set to %d\n", reqtags); + else + printk("tagged command queueing disabled\n"); + } +} + +/*---------------------------------------------------- +** +** handle user commands +** +**---------------------------------------------------- +*/ + +#ifdef SCSI_NCR_USER_COMMAND_SUPPORT + +static void ncr_usercmd (ncb_p np) +{ + u_char t; + tcb_p tp; + + switch (np->user.cmd) { + + case 0: return; + + case UC_SETSYNC: + for (t=0; tuser.target>>t)&1)) continue; + tp = &np->target[t]; + tp->usrsync = np->user.data; + ncr_negotiate (np, tp); + }; + break; + + case UC_SETTAGS: + for (t=0; tuser.target>>t)&1)) continue; + np->target[t].usrtags = np->user.data; + for (ln = 0; ln < MAX_LUN; ln++) { + lcb_p lp = np->target[t].lp[ln]; + if (!lp) + continue; + lp->maxtags = lp->numtags = np->user.data; + ncr_setup_tags (np, t, ln); + } + }; + break; + + case UC_SETDEBUG: +#ifdef SCSI_NCR_DEBUG_INFO_SUPPORT + ncr_debug = np->user.data; +#endif + break; + + case UC_SETORDER: + np->order = np->user.data; + break; + + case UC_SETVERBOSE: + np->verbose = np->user.data; + break; + + case UC_SETWIDE: + for (t=0; tuser.target>>t)&1)) continue; + tp = &np->target[t]; + size = np->user.data; + if (size > np->maxwide) size=np->maxwide; + tp->usrwide = size; + ncr_negotiate (np, tp); + }; + break; + + case UC_SETFLAG: + for (t=0; tuser.target>>t)&1)) continue; + tp = &np->target[t]; + tp->usrflag = np->user.data; + }; + break; + +#ifdef SCSI_NCR_PROFILE_SUPPORT + case UC_CLEARPROF: + bzero(&np->profile, sizeof(np->profile)); + break; +#endif + } + np->user.cmd=0; +} +#endif + +/*========================================================== +** +** +** ncr timeout handler. +** +** +**========================================================== +** +** Misused to keep the driver running when +** interrupts are not configured correctly. +** +**---------------------------------------------------------- +*/ + +static void ncr_timeout (ncb_p np) +{ + u_long thistime = jiffies; + + /* + ** If release process in progress, let's go + ** Set the release stage from 1 to 2 to synchronize + ** with the release process. + */ + + if (np->release_stage) { + if (np->release_stage == 1) np->release_stage = 2; + return; + } + + np->timer.expires = jiffies + SCSI_NCR_TIMER_INTERVAL; + add_timer(&np->timer); + + /* + ** If we are resetting the ncr, wait for settle_time before + ** clearing it. Then command processing will be resumed. + */ + if (np->settle_time) { + if (np->settle_time <= thistime) { + if (bootverbose > 1) + printk("%s: command processing resumed\n", ncr_name(np)); + np->settle_time = 0; + requeue_waiting_list(np); + } + return; + } + + /* + ** Nothing to do for now, but that may come. + */ + if (np->lasttime + 4*HZ < thistime) { + np->lasttime = thistime; + } + +#ifdef SCSI_NCR_BROKEN_INTR + if (INB(nc_istat) & (INTF|SIP|DIP)) { + + /* + ** Process pending interrupts. + */ + if (DEBUG_FLAGS & DEBUG_TINY) printk ("{"); + ncr_exception (np); + if (DEBUG_FLAGS & DEBUG_TINY) printk ("}"); + } +#endif /* SCSI_NCR_BROKEN_INTR */ +} + +/*========================================================== +** +** log message for real hard errors +** +** "ncr0 targ 0?: ERROR (ds:si) (so-si-sd) (sxfer/scntl3) @ name (dsp:dbc)." +** " reg: r0 r1 r2 r3 r4 r5 r6 ..... rf." +** +** exception register: +** ds: dstat +** si: sist +** +** SCSI bus lines: +** so: control lines as driver by NCR. +** si: control lines as seen by NCR. +** sd: scsi data lines as seen by NCR. +** +** wide/fastmode: +** sxfer: (see the manual) +** scntl3: (see the manual) +** +** current script command: +** dsp: script adress (relative to start of script). +** dbc: first word of script command. +** +** First 16 register of the chip: +** r0..rf +** +**========================================================== +*/ + +static void ncr_log_hard_error(ncb_p np, u_short sist, u_char dstat) +{ + u_int32 dsp; + int script_ofs; + int script_size; + char *script_name; + u_char *script_base; + int i; + + dsp = INL (nc_dsp); + + if (dsp > np->p_script && dsp <= np->p_script + sizeof(struct script)) { + script_ofs = dsp - np->p_script; + script_size = sizeof(struct script); + script_base = (u_char *) np->script0; + script_name = "script"; + } + else if (np->p_scripth < dsp && + dsp <= np->p_scripth + sizeof(struct scripth)) { + script_ofs = dsp - np->p_scripth; + script_size = sizeof(struct scripth); + script_base = (u_char *) np->scripth0; + script_name = "scripth"; + } else { + script_ofs = dsp; + script_size = 0; + script_base = 0; + script_name = "mem"; + } + + printk ("%s:%d: ERROR (%x:%x) (%x-%x-%x) (%x/%x) @ (%s %x:%08x).\n", + ncr_name (np), (unsigned)INB (nc_sdid)&0x0f, dstat, sist, + (unsigned)INB (nc_socl), (unsigned)INB (nc_sbcl), (unsigned)INB (nc_sbdl), + (unsigned)INB (nc_sxfer),(unsigned)INB (nc_scntl3), script_name, script_ofs, + (unsigned)INL (nc_dbc)); + + if (((script_ofs & 3) == 0) && + (unsigned)script_ofs < script_size) { + printk ("%s: script cmd = %08x\n", ncr_name(np), + scr_to_cpu((int) *(ncrcmd *)(script_base + script_ofs))); + } + + printk ("%s: regdump:", ncr_name(np)); + for (i=0; i<16;i++) + printk (" %02x", (unsigned)INB_OFF(i)); + printk (".\n"); +} + +/*============================================================ +** +** ncr chip exception handler. +** +**============================================================ +** +** In normal situations, interrupt conditions occur one at +** a time. But when something bad happens on the SCSI BUS, +** the chip may raise several interrupt flags before +** stopping and interrupting the CPU. The additionnal +** interrupt flags are stacked in some extra registers +** after the SIP and/or DIP flag has been raised in the +** ISTAT. After the CPU has read the interrupt condition +** flag from SIST or DSTAT, the chip unstacks the other +** interrupt flags and sets the corresponding bits in +** SIST or DSTAT. Since the chip starts stacking once the +** SIP or DIP flag is set, there is a small window of time +** where the stacking does not occur. +** +** Typically, multiple interrupt conditions may happen in +** the following situations: +** +** - SCSI parity error + Phase mismatch (PAR|MA) +** When an parity error is detected in input phase +** and the device switches to msg-in phase inside a +** block MOV. +** - SCSI parity error + Unexpected disconnect (PAR|UDC) +** When a stupid device does not want to handle the +** recovery of an SCSI parity error. +** - Some combinations of STO, PAR, UDC, ... +** When using non compliant SCSI stuff, when user is +** doing non compliant hot tampering on the BUS, when +** something really bad happens to a device, etc ... +** +** The heuristic suggested by SYMBIOS to handle +** multiple interrupts is to try unstacking all +** interrupts conditions and to handle them on some +** priority based on error severity. +** This will work when the unstacking has been +** successful, but we cannot be 100 % sure of that, +** since the CPU may have been faster to unstack than +** the chip is able to stack. Hmmm ... But it seems that +** such a situation is very unlikely to happen. +** +** If this happen, for example STO catched by the CPU +** then UDC happenning before the CPU have restarted +** the SCRIPTS, the driver may wrongly complete the +** same command on UDC, since the SCRIPTS didn't restart +** and the DSA still points to the same command. +** We avoid this situation by setting the DSA to an +** invalid value when the CCB is completed and before +** restarting the SCRIPTS. +** +** Another issue is that we need some section of our +** recovery procedures to be somehow uninterruptible and +** that the SCRIPTS processor does not provides such a +** feature. For this reason, we handle recovery preferently +** from the C code and check against some SCRIPTS +** critical sections from the C code. +** +** Hopefully, the interrupt handling of the driver is now +** able to resist to weird BUS error conditions, but donnot +** ask me for any guarantee that it will never fail. :-) +** Use at your own decision and risk. +** +**============================================================ +*/ + +void ncr_exception (ncb_p np) +{ + u_char istat, istatc; + u_char dstat; + u_short sist; + int i; + +#ifdef SCSI_NCR_OPTIMIZE_896_1 + /* + ** This optimization when used with a 896 that handles + ** phase mismatch from the SCRIPTS allows to only do + ** PCI memory writes transactions from the CPU and so to + ** take advantage of PCI posted writes. + ** Who wants his 500 MHz CPU to wait several micro-seconds + ** for the PCI BUS to be granted when this can be avoided? + ** I don't, even for my slow 233 MHz PII. :-) + ** + ** We assume we have been called for command completion. + ** If no completion found, go with normal handling. + ** Ordering is ensured by the SCRIPTS performing a read + ** from main memory prior to raising INTFLY. + ** We have to raise SIGP since the chip may be currently + ** going to a wait reselect instruction. IMO, SIGP should + ** not be clearable in ISTAT since it can be polled and + ** cleared by reading CTEST2. This tiny chip misdesign is a + ** penalty here. + ** + ** The MA interrupt and interrupt sharing may also have + ** adverse effects on this optimization, so we only want + ** to use it if it is enabled by user. + ** (BTW, this optimization seems to even have some goodness + ** with my 895 that unfortunately suffers of the MA int.). + */ + if (driver_setup.optimize & 1) { + OUTB(nc_istat, (INTF | SIGP)); + if (ncr_wakeup_done (np)) { +#ifdef SCSI_NCR_PROFILE_SUPPORT + ++np->profile.num_fly; +#endif + return; + } + } +#endif /* SCSI_NCR_OPTIMIZE_896_1 */ + + /* + ** interrupt on the fly ? + */ + istat = INB (nc_istat); + if (istat & INTF) { + OUTB (nc_istat, (istat & SIGP) | INTF); + if (DEBUG_FLAGS & DEBUG_TINY) printk ("F "); + (void)ncr_wakeup_done (np); +#ifdef SCSI_NCR_PROFILE_SUPPORT + ++np->profile.num_fly; +#endif + }; + + if (!(istat & (SIP|DIP))) + return; + +#ifdef SCSI_NCR_PROFILE_SUPPORT + ++np->profile.num_int; +#endif + +#if 0 /* We should never get this one */ + if (istat & CABRT) + OUTB (nc_istat, CABRT); +#endif + + /* + ** Steinbach's Guideline for Systems Programming: + ** Never test for an error condition you don't know how to handle. + */ + + /*======================================================== + ** PAR and MA interrupts may occur at the same time, + ** and we need to know of both in order to handle + ** this situation properly. We try to unstack SCSI + ** interrupts for that reason. BTW, I dislike a LOT + ** such a loop inside the interrupt routine. + ** Even if DMA interrupt stacking is very unlikely to + ** happen, we also try unstacking these ones, since + ** this has no performance impact. + **========================================================= + */ + sist = 0; + dstat = 0; + istatc = istat; + do { + if (istatc & SIP) + sist |= INW (nc_sist); + if (istatc & DIP) + dstat |= INB (nc_dstat); + istatc = INB (nc_istat); + istat |= istatc; + } while (istatc & (SIP|DIP)); + + if (DEBUG_FLAGS & DEBUG_TINY) + printk ("<%d|%x:%x|%x:%x>", + (int)INB(nc_scr0), + dstat,sist, + (unsigned)INL(nc_dsp), + (unsigned)INL(nc_dbc)); + + /*======================================================== + ** First, interrupts we want to service cleanly. + ** + ** Phase mismatch (MA) is the most frequent interrupt + ** for chip earlier than the 896 and so we have to service + ** it as quickly as possible. + ** A SCSI parity error (PAR) may be combined with a phase + ** mismatch condition (MA). + ** Programmed interrupts (SIR) are used to call the C code + ** from SCRIPTS. + ** The single step interrupt (SSI) is not used in this + ** driver. + **========================================================= + */ + + if (!(sist & (STO|GEN|HTH|SGE|UDC|SBMC|RST)) && + !(dstat & (MDPE|BF|ABRT|IID))) { + if (sist & PAR) ncr_int_par (np, sist); + else if (sist & MA) ncr_int_ma (np); + else if (dstat & SIR) ncr_int_sir (np); + else if (dstat & SSI) OUTONB (nc_dcntl, (STD|NOCOM)); + else goto unknown_int; + return; + }; + + /*======================================================== + ** Now, interrupts that donnot happen in normal + ** situations and that we may need to recover from. + ** + ** On SCSI RESET (RST), we reset everything. + ** On SCSI BUS MODE CHANGE (SBMC), we complete all + ** active CCBs with RESET status, prepare all devices + ** for negotiating again and restart the SCRIPTS. + ** On STO and UDC, we complete the CCB with the corres- + ** ponding status and restart the SCRIPTS. + **========================================================= + */ + + if (sist & RST) { + ncr_init (np, 1, bootverbose ? "scsi reset" : NULL, HS_RESET); + return; + }; + + OUTB (nc_ctest3, np->rv_ctest3 | CLF); /* clear dma fifo */ + OUTB (nc_stest3, TE|CSF); /* clear scsi fifo */ + + if (!(sist & (GEN|HTH|SGE)) && + !(dstat & (MDPE|BF|ABRT|IID))) { + if (sist & SBMC) ncr_int_sbmc (np); + else if (sist & STO) ncr_int_sto (np); + else if (sist & UDC) ncr_int_udc (np); + else goto unknown_int; + return; + }; + + /*========================================================= + ** Now, interrupts we are not able to recover cleanly. + ** + ** Do the register dump. + ** Log message for hard errors. + ** Reset everything. + **========================================================= + */ + if (jiffies - np->regtime > 10*HZ) { + np->regtime = jiffies; + for (i = 0; iregdump); i++) + ((char*)&np->regdump)[i] = INB_OFF(i); + np->regdump.nc_dstat = dstat; + np->regdump.nc_sist = sist; + }; + + ncr_log_hard_error(np, sist, dstat); + + if ((sist & (GEN|HTH|SGE)) || + (dstat & (MDPE|BF|ABRT|IID))) { + ncr_start_reset(np); + return; + }; + +unknown_int: + /*========================================================= + ** We just miss the cause of the interrupt. :( + ** Print a message. The timeout will do the real work. + **========================================================= + */ + printk( "%s: unknown interrupt(s) ignored, " + "ISTAT=0x%x DSTAT=0x%x SIST=0x%x\n", + ncr_name(np), istat, dstat, sist); +} + + +/*========================================================== +** +** generic recovery from scsi interrupt +** +**========================================================== +** +** The doc says that when the chip gets an SCSI interrupt, +** it tries to stop in an orderly fashion, by completing +** an instruction fetch that had started or by flushing +** the DMA fifo for a write to memory that was executing. +** Such a fashion is not enough to know if the instruction +** that was just before the current DSP value has been +** executed or not. +** +** There are 3 small SCRIPTS sections that deal with the +** start queue and the done queue that may break any +** assomption from the C code if we are interrupted +** inside, so we reset if it happens. Btw, since these +** SCRIPTS sections are executed while the SCRIPTS hasn't +** started SCSI operations, it is very unlikely to happen. +** +** All the driver data structures are supposed to be +** allocated from the same 4 GB memory window, so there +** is a 1 to 1 relationship between DSA and driver data +** structures. Since we are careful :) to invalidate the +** DSA when we complete a command or when the SCRIPTS +** pushes a DSA into a queue, we can trust it when it +** points to a CCB. +** +**---------------------------------------------------------- +*/ +static void ncr_recover_scsi_int (ncb_p np, u_char hsts) +{ + u_int32 dsp = INL (nc_dsp); + u_int32 dsa = INL (nc_dsa); + u_char scntl1 = INB (nc_scntl1); + ccb_p cp = ncr_ccb_from_dsa(np, dsa); + + /* + ** If we are connected to the SCSI BUS, we only + ** can reset the BUS. + */ + if (scntl1 & ISCON) + goto reset_all; + + /* + ** If we haven't been interrupted inside the SCRIPTS + ** critical pathes, we can safely restart the SCRIPTS + ** and trust the DSA value if it matches a CCB. + */ + if ((!(dsp > NCB_SCRIPT_PHYS (np, getjob_begin) && + dsp < NCB_SCRIPT_PHYS (np, getjob_end) + 1)) && + (!(dsp > NCB_SCRIPT_PHYS (np, ungetjob) && + dsp < NCB_SCRIPT_PHYS (np, reselect) + 1)) && + (!(dsp > NCB_SCRIPT_PHYS (np, done) && + dsp < NCB_SCRIPT_PHYS (np, done_end) + 1))) { + if (cp) { + cp->host_status = hsts; + ncr_complete (np, cp); + } + OUTL (nc_dsa, DSA_INVALID); + OUTB (nc_ctest3, np->rv_ctest3 | CLF); /* clear dma fifo */ + OUTB (nc_stest3, TE|CSF); /* clear scsi fifo */ + OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, start)); + } + else + goto reset_all; + + return; + +reset_all: + ncr_start_reset(np); +} + +/*========================================================== +** +** ncr chip exception handler for selection timeout +** +**========================================================== +** +** There seems to be a bug in the 53c810. +** Although a STO-Interrupt is pending, +** it continues executing script commands. +** But it will fail and interrupt (IID) on +** the next instruction where it's looking +** for a valid phase. +** +**---------------------------------------------------------- +*/ + +void ncr_int_sto (ncb_p np) +{ + u_int32 dsp = INL (nc_dsp); + + if (DEBUG_FLAGS & DEBUG_TINY) printk ("T"); + + if (dsp == NCB_SCRIPT_PHYS (np, wf_sel_done) + 8 || + dsp == NCB_SCRIPTH_PHYS (np, wf_sel_done_no_atn) + 8 || + !(driver_setup.recovery & 1)) + ncr_recover_scsi_int(np, HS_SEL_TIMEOUT); + else + ncr_start_reset(np); +} + +/*========================================================== +** +** ncr chip exception handler for unexpected disconnect +** +**========================================================== +** +**---------------------------------------------------------- +*/ +void ncr_int_udc (ncb_p np) +{ + printk ("%s: unexpected disconnect\n", ncr_name(np)); + ncr_recover_scsi_int(np, HS_UNEXPECTED); +} + +/*========================================================== +** +** ncr chip exception handler for SCSI bus mode change +** +**========================================================== +** +** spi2-r12 11.2.3 says a transceiver mode change must +** generate a reset event and a device that detects a reset +** event shall initiate a hard reset. It says also that a +** device that detects a mode change shall set data transfer +** mode to eight bit asynchronous, etc... +** So, just resetting should be enough. +** +** +**---------------------------------------------------------- +*/ + +static void ncr_int_sbmc (ncb_p np) +{ + u_char scsi_mode = INB (nc_stest4) & SMODE; + + printk("%s: SCSI bus mode change from %x to %x.\n", + ncr_name(np), np->scsi_mode, scsi_mode); + + np->scsi_mode = scsi_mode; + + + /* + ** Suspend command processing for 1 second and + ** reinitialize all except the chip. + */ + np->settle_time = jiffies + HZ; + ncr_init (np, 0, bootverbose ? "scsi mode change" : NULL, HS_RESET); +} + +/*========================================================== +** +** ncr chip exception handler for SCSI parity error. +** +**========================================================== +** +** When the chip detects a SCSI parity error and is +** currently executing a (CH)MOV instruction, it does +** not interrupt immediately, but tries to finish the +** transfer of the current scatter entry before +** interrupting. The following situations may occur: +** +** - The complete scatter entry has been transferred +** without the device having changed phase. +** The chip will then interrupt with the DSP pointing +** to the instruction that follows the MOV. +** +** - A phase mismatch occurs before the MOV finished +** and phase errors are to be handled by the C code. +** The chip will then interrupt with both PAR and MA +** conditions set. +** +** - A phase mismatch occurs before the MOV finished +** and phase errors are to be handled by SCRIPTS (896). +** The chip will load the DSP with the phase mismatch +** JUMP address and interrupt the host processor. +** +**---------------------------------------------------------- +*/ + +static void ncr_int_par (ncb_p np, u_short sist) +{ + u_char hsts = INB (HS_PRT); + u_int32 dsp = INL (nc_dsp); + u_int32 dbc = INL (nc_dbc); + u_int32 dsa = INL (nc_dsa); + u_char sbcl = INB (nc_sbcl); + u_char cmd = dbc >> 24; + int phase = cmd & 7; + + printk("%s: SCSI parity error detected: SCR1=%d DBC=%x SBCL=%x\n", + ncr_name(np), hsts, dbc, sbcl); + + /* + ** Check that the chip is connected to the SCSI BUS. + */ + if (!(INB (nc_scntl1) & ISCON)) { + if (!(driver_setup.recovery & 1)) { + ncr_recover_scsi_int(np, HS_FAIL); + return; + } + goto reset_all; + } + + /* + ** If the nexus is not clearly identified, reset the bus. + ** We will try to do better later. + */ + if (!ncr_ccb_from_dsa(np, dsa)) + goto reset_all; + + /* + ** Check instruction was a MOV, direction was INPUT and + ** ATN is asserted. + */ + if ((cmd & 0xc0) || !(phase & 1) || !(sbcl & 0x8)) + goto reset_all; + + /* + ** Keep track of the parity error. + */ + OUTONB (HF_PRT, HF_PAR_ERR); + + /* + ** Prepare the message to send to the device. + */ + np->msgout[0] = (phase == 7) ? M_PARITY : M_ID_ERROR; + + /* + ** If the old phase was DATA IN phase, we have to deal with + ** the 3 situations described above. + ** For other input phases (MSG IN and STATUS), the device + ** must resend the whole thing that failed parity checking + ** or signal error. So, jumping to dispatcher should be OK. + */ + if (phase == 1) { + /* Phase mismatch handled by SCRIPTS */ + if (dsp == NCB_SCRIPTH_PHYS (np, pm_handle)) + OUTL (nc_dsp, dsp); + /* Phase mismatch handled by the C code */ + else if (sist & MA) + ncr_int_ma (np); + /* No phase mismatch occurred */ + else { + OUTL (nc_temp, dsp); + OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, databreak)); + } + } + else + OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, clrack)); + return; + +reset_all: + ncr_start_reset(np); + return; +} + +/*========================================================== +** +** +** ncr chip exception handler for phase errors. +** +** +**========================================================== +** +** We have to construct a new transfer descriptor, +** to transfer the rest of the current block. +** +**---------------------------------------------------------- +*/ + +static void ncr_int_ma (ncb_p np) +{ + u_int32 dbc; + u_int32 rest; + u_int32 dsp; + u_int32 dsa; + u_int32 nxtdsp; + u_int32 *vdsp; + u_int32 oadr, olen; + u_int32 *tblp; + u_int32 newcmd; + u_int delta; + u_char cmd; + u_char hflags, hflags0; + struct pm_ctx *pm; + ccb_p cp; + +#ifdef SCSI_NCR_PROFILE_SUPPORT + ++np->profile.num_break; +#endif + + dsp = INL (nc_dsp); + dbc = INL (nc_dbc); + dsa = INL (nc_dsa); + + cmd = dbc >> 24; + rest = dbc & 0xffffff; + delta = 0; + + /* + ** locate matching cp. + */ + cp = ncr_ccb_from_dsa(np, dsa); + + /* + ** Donnot take into account dma fifo and various buffers in + ** DATA IN phase since the chip flushes everything before + ** raising the MA interrupt for interrupted INPUT phases. + */ + if ((cmd & 7) != 1) { + u_int32 dfifo; + u_char ss0, ss2; + + /* + ** Read DFIFO, CTEST[4-6] using 1 PCI bus ownership. + */ + dfifo = INL(nc_dfifo); + + /* + ** Calculate remaining bytes in DMA fifo. + ** (CTEST5 = dfifo >> 16) + */ + if (dfifo & (DFS << 16)) + delta = ((((dfifo >> 8) & 0x300) | + (dfifo & 0xff)) - rest) & 0x3ff; + else + delta = ((dfifo & 0xff) - rest) & 0x7f; + + /* + ** The data in the dma fifo has not been transfered to + ** the target -> add the amount to the rest + ** and clear the data. + ** Check the sstat2 register in case of wide transfer. + */ + rest += delta; + ss0 = INB (nc_sstat0); + if (ss0 & OLF) rest++; + if (ss0 & ORF) rest++; + if (cp && (cp->phys.select.sel_scntl3 & EWS)) { + ss2 = INB (nc_sstat2); + if (ss2 & OLF1) rest++; + if (ss2 & ORF1) rest++; + }; + + /* + ** Clear fifos. + */ + OUTB (nc_ctest3, np->rv_ctest3 | CLF); /* dma fifo */ + OUTB (nc_stest3, TE|CSF); /* scsi fifo */ + }; + + /* + ** log the information + */ + + if (DEBUG_FLAGS & (DEBUG_TINY|DEBUG_PHASE)) + printk ("P%x%x RL=%d D=%d ", cmd&7, INB(nc_sbcl)&7, + (unsigned) rest, (unsigned) delta); + + /* + ** try to find the interrupted script command, + ** and the address at which to continue. + */ + vdsp = 0; + nxtdsp = 0; + if (dsp > np->p_script && + dsp <= np->p_script + sizeof(struct script)) { + vdsp = (u_int32 *)((char*)np->script0 + (dsp-np->p_script-8)); + nxtdsp = dsp; + } + else if (dsp > np->p_scripth && + dsp <= np->p_scripth + sizeof(struct scripth)) { + vdsp = (u_int32 *)((char*)np->scripth0 + (dsp-np->p_scripth-8)); + nxtdsp = dsp; + } + + /* + ** log the information + */ + if (DEBUG_FLAGS & DEBUG_PHASE) { + printk ("\nCP=%p DSP=%x NXT=%x VDSP=%p CMD=%x ", + cp, (unsigned)dsp, (unsigned)nxtdsp, vdsp, cmd); + }; + + if (!vdsp) { + printk ("%s: interrupted SCRIPT address not found.\n", + ncr_name (np)); + goto reset_all; + } + + if (!cp) { + printk ("%s: SCSI phase error fixup: CCB already dequeued.\n", + ncr_name (np)); + goto reset_all; + } + + /* + ** get old startaddress and old length. + */ + + oadr = scr_to_cpu(vdsp[1]); + + if (cmd & 0x10) { /* Table indirect */ + tblp = (u_int32 *) ((char*) &cp->phys + oadr); + olen = scr_to_cpu(tblp[0]); + oadr = scr_to_cpu(tblp[1]); + } else { + tblp = (u_int32 *) 0; + olen = scr_to_cpu(vdsp[0]) & 0xffffff; + }; + + if (DEBUG_FLAGS & DEBUG_PHASE) { + printk ("OCMD=%x\nTBLP=%p OLEN=%x OADR=%x\n", + (unsigned) (scr_to_cpu(vdsp[0]) >> 24), + tblp, + (unsigned) olen, + (unsigned) oadr); + }; + + /* + ** check cmd against assumed interrupted script command. + */ + + if (cmd != (scr_to_cpu(vdsp[0]) >> 24)) { + PRINT_ADDR(cp->cmd); + printk ("internal error: cmd=%02x != %02x=(vdsp[0] >> 24)\n", + (unsigned)cmd, (unsigned)scr_to_cpu(vdsp[0]) >> 24); + + goto reset_all; + }; + + /* + ** if old phase not dataphase, leave here. + */ + + if (cmd & 0x06) { + PRINT_ADDR(cp->cmd); + printk ("phase change %x-%x %d@%08x resid=%d.\n", + cmd&7, INB(nc_sbcl)&7, (unsigned)olen, + (unsigned)oadr, (unsigned)rest); + goto unexpected_phase; + }; + + /* + ** Choose the correct PM save area. + ** + ** Look at the PM_SAVE SCRIPT if you want to understand + ** this stuff. The equivalent code is implemented in + ** SCRIPTS for the 896 that is able to handle PM from + ** the SCRIPTS processor. + */ + + hflags0 = INB (HF_PRT); + hflags = hflags0; + + if (hflags & (HF_IN_PM0 | HF_IN_PM1 | HF_DP_SAVED)) { + if (hflags & HF_IN_PM0) + nxtdsp = scr_to_cpu(cp->phys.pm0.ret); + else if (hflags & HF_IN_PM1) + nxtdsp = scr_to_cpu(cp->phys.pm1.ret); + + if (hflags & HF_DP_SAVED) + hflags ^= HF_ACT_PM; + } + + if (!(hflags & HF_ACT_PM)) { + pm = &cp->phys.pm0; + newcmd = NCB_SCRIPT_PHYS(np, pm0_data); + } + else { + pm = &cp->phys.pm1; + newcmd = NCB_SCRIPT_PHYS(np, pm1_data); + } + + hflags &= ~(HF_IN_PM0 | HF_IN_PM1 | HF_DP_SAVED); + if (hflags != hflags0) + OUTB (HF_PRT, hflags); + + /* + ** fillin the phase mismatch context + */ + + pm->sg.addr = cpu_to_scr(oadr + olen - rest); + pm->sg.size = cpu_to_scr(rest); + pm->ret = cpu_to_scr(nxtdsp); + + if (DEBUG_FLAGS & DEBUG_PHASE) { + PRINT_ADDR(cp->cmd); + printk ("PM %x %x %x / %x %x %x.\n", + hflags0, hflags, newcmd, + (unsigned)scr_to_cpu(pm->sg.addr), + (unsigned)scr_to_cpu(pm->sg.size), + (unsigned)scr_to_cpu(pm->ret)); + } + + /* + ** fake the return address (to the patch). + ** and restart script processor at dispatcher. + */ + + OUTL (nc_temp, newcmd); + OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, databreak)); + return; + + /* + ** Unexpected phase changes that occurs when the current phase + ** is not a DATA IN or DATA OUT phase are due to error conditions. + ** Such event may only happen when the SCRIPTS is using a + ** multibyte SCSI MOVE. + ** + ** Phase change Some possible cause + ** + ** COMMAND --> MSG IN SCSI parity error detected by target. + ** COMMAND --> STATUS Bad command or refused by target. + ** MSG OUT --> MSG IN Message rejected by target. + ** MSG OUT --> COMMAND Bogus target that discards extended + ** negotiation messages. + ** + ** The code below does not care of the new phase and so + ** trusts the target. Why to annoy it ? + ** If the interrupted phase is COMMAND phase, we restart at + ** dispatcher. + ** If a target does not get all the messages after selection, + ** the code assumes blindly that the target discards extended + ** messages and clears the negotiation status. + ** If the target does not want all our response to negotiation, + ** we force a SIR_NEGO_PROTO interrupt (it is a hack that avoids + ** bloat for such a should_not_happen situation). + ** In all other situation, we reset the BUS. + ** Are these assumptions reasonnable ? (Wait and see ...) + */ +unexpected_phase: + dsp -= 8; + nxtdsp = 0; + + switch (cmd & 7) { + case 2: /* COMMAND phase */ + nxtdsp = NCB_SCRIPT_PHYS (np, dispatch); + break; +#if 0 + case 3: /* STATUS phase */ + nxtdsp = NCB_SCRIPT_PHYS (np, dispatch); + break; +#endif + case 6: /* MSG OUT phase */ + /* + ** If the device may want to use untagged when we want + ** tagged, we prepare an IDENTIFY without disc. granted, + ** since we will not be able to handle reselect. + ** Otherwise, we just don't care. + */ + if (dsp == NCB_SCRIPT_PHYS (np, send_ident)) { + if (cp->tag != NO_TAG && olen - rest <= 3) { + cp->host_status = HS_BUSY; + np->msgout[0] = M_IDENTIFY | cp->lun; + nxtdsp = NCB_SCRIPTH_PHYS (np, ident_break_atn); + } + else + nxtdsp = NCB_SCRIPTH_PHYS (np, ident_break); + } + else if (dsp == NCB_SCRIPTH_PHYS (np, send_wdtr) || + dsp == NCB_SCRIPTH_PHYS (np, send_sdtr)) { + nxtdsp = NCB_SCRIPTH_PHYS (np, nego_bad_phase); + } + break; +#if 0 + case 7: /* MSG IN phase */ + nxtdsp = NCB_SCRIPT_PHYS (np, clrack); + break; +#endif + } + + if (nxtdsp) { + OUTL (nc_dsp, nxtdsp); + return; + } + +reset_all: + ncr_start_reset(np); +} + +/*========================================================== +** +** ncr chip handler for QUEUE FULL and CHECK CONDITION +** +**========================================================== +** +** On QUEUE FULL status, we set the actual tagged command +** queue depth to the number of disconnected CCBs that is +** hopefully a good value to avoid further QUEUE FULL. +** +** On CHECK CONDITION or COMMAND TERMINATED, we use the +** CCB of the failed command for performing a REQUEST +** SENSE SCSI command. +** +** We do not want to change the order commands will be +** actually queued to the device after we received a +** QUEUE FULL status. We also want to properly deal with +** contingent allegiance condition. For these reasons, +** we remove from the start queue all commands for this +** LUN that haven't been yet queued to the device and +** put them back in the correponding LUN queue, then +** requeue the CCB that failed in front of the LUN queue. +** I just hope this not to be performed too often. :) +** +**---------------------------------------------------------- +*/ + +static void ncr_sir_to_redo(ncb_p np, int num, ccb_p cp) +{ + Scsi_Cmnd *cmd = cp->cmd; + tcb_p tp = &np->target[cp->target]; + lcb_p lp = tp->lp[cp->lun]; + ccb_p cp2; + int busyccbs = 1; + u_int32 startp; + u_char s_status = INB (SS_PRT); + + /* + ** Remove all CCBs queued to the chip for that LUN and put + ** them back in the LUN CCB wait queue. + */ + if (lp) { + int i = np->squeueput; + int j = (INL (nc_scratcha) - vtobus(np->squeue)) / 4; + int k = np->squeueput; + + busyccbs = lp->queuedccbs; + while (1) { + if (i == j) + break; + if (i == 0) + i = MAX_START*2; + i = i - 2; + cp2 = ncr_ccb_from_dsa(np, scr_to_cpu(np->squeue[i])); + if (!cp2) + continue; + if (cp2->target != cp->target || cp2->lun != cp->lun) + continue; + xpt_remque(&cp2->link_ccbq); + xpt_insque_head(&cp2->link_ccbq, &lp->wait_ccbq); + --lp->queuedccbs; + cp2->queued = 0; + np->squeue[i] = DSA_INVALID; + k = i; + } + + /* + ** Requeue the interrupted CCB in front of + ** the LUN CCB wait queue. + */ + xpt_remque(&cp->link_ccbq); + xpt_insque_head(&cp->link_ccbq, &lp->wait_ccbq); + --lp->queuedccbs; + cp->queued = 0; + + /* + ** Repair the startqueue if necessary. + */ + if (k != np->squeueput) { + j = k; + while (1) { + j += 2; + if (j >= MAX_START*2) + j = 0; + if (np->squeue[j] == DSA_INVALID) + continue; + np->squeue[k] = np->squeue[j]; + if (j == np->squeueput) + break; + k += 2; + if (k >= MAX_START*2) + k = 0; + } + np->squeueput = k; + } + } + + /* + ** Now we can restart the SCRIPTS processor safely. + */ + MEMORY_BARRIER(); + OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, start)); + + switch(s_status) { + default: /* Just for safety, should never happen */ + case S_QUEUE_FULL: + if (!lp || !lp->queuedccbs) { + ncr_complete(np, cp); + break; + } + if (bootverbose >= 1) { + PRINT_ADDR(cmd); + printk ("QUEUE FULL! %d busy, %d disconnected CCBs\n", + busyccbs, lp->queuedccbs); + } + /* + ** Decrease number of tags to the number of + ** disconnected commands. + */ + if (lp->queuedccbs < lp->numtags) { + lp->numtags = lp->queuedccbs; + lp->num_good = 0; + ncr_setup_tags (np, cp->target, cp->lun); + } + /* + ** Repair the offending CCB. + */ + cp->phys.header.savep = cp->startp; + cp->host_status = HS_BUSY; + cp->scsi_status = S_ILLEGAL; + cp->host_flags &= HF_PM_TO_C; + + break; + + case S_TERMINATED: + case S_CHECK_COND: + /* + ** If we were requesting sense, give up. + */ + if (cp->auto_sense) { + ncr_complete(np, cp); + break; + } + + /* + ** Device returned CHECK CONDITION status. + ** Prepare all needed data strutures for getting + ** sense data. + */ + + /* + ** identify message + */ + cp->scsi_smsg2[0] = M_IDENTIFY | cp->lun; + cp->phys.smsg.addr = cpu_to_scr(CCB_PHYS (cp, scsi_smsg2)); + cp->phys.smsg.size = cpu_to_scr(1); + + /* + ** sense command + */ + cp->phys.cmd.addr = cpu_to_scr(CCB_PHYS (cp, sensecmd)); + cp->phys.cmd.size = cpu_to_scr(6); + + /* + ** patch requested size into sense command + */ + cp->sensecmd[0] = 0x03; + cp->sensecmd[1] = cp->lun << 5; + cp->sensecmd[4] = sizeof(cmd->sense_buffer); + + /* + ** sense data + */ + cp->phys.sense.addr = + cpu_to_scr(vtobus (&cmd->sense_buffer[0])); + cp->phys.sense.size = + cpu_to_scr(sizeof(cmd->sense_buffer)); + + /* + ** requeue the command. + */ + startp = cpu_to_scr(NCB_SCRIPTH_PHYS (np, sdata_in)); + + cp->phys.header.savep = startp; + cp->phys.header.goalp = startp + 24; + cp->phys.header.lastp = startp; + cp->phys.header.wgoalp = startp + 24; + cp->phys.header.wlastp = startp; + + cp->host_status = HS_BUSY; + cp->scsi_status = S_ILLEGAL; + cp->host_flags = 0; + cp->auto_sense = s_status; + + cp->phys.header.go.start = + cpu_to_scr(NCB_SCRIPT_PHYS (np, select)); + + /* + ** Select without ATN for quirky devices. + */ + if (tp->quirks & QUIRK_NOMSG) + cp->phys.header.go.start = + cpu_to_scr(NCB_SCRIPTH_PHYS (np, select_no_atn)); + + /* + ** If lp not yet allocated, requeue the command. + */ + if (!lp) + ncr_put_start_queue(np, cp); + break; + } + + /* + ** requeue awaiting scsi commands for this lun. + */ + if (lp) + ncr_start_next_ccb(np, lp, 1); + + return; +} + + +/*========================================================== +** +** +** ncr chip exception handler for programmed interrupts. +** +** +**========================================================== +*/ + +static int ncr_show_msg (u_char * msg) +{ + u_char i; + printk ("%x",*msg); + if (*msg==M_EXTENDED) { + for (i=1;i<8;i++) { + if (i-1>msg[1]) break; + printk ("-%x",msg[i]); + }; + return (i+1); + } else if ((*msg & 0xf0) == 0x20) { + printk ("-%x",msg[1]); + return (2); + }; + return (1); +} + + +void ncr_int_sir (ncb_p np) +{ + u_char scntl3; + u_char chg, ofs, per, fak, wide; + u_char num = INB (nc_dsps); + ccb_p cp=0; + u_long dsa = INL (nc_dsa); + u_char target = INB (nc_sdid) & 0x0f; + tcb_p tp = &np->target[target]; + + if (DEBUG_FLAGS & DEBUG_TINY) printk ("I#%d", num); + + switch (num) { + case SIR_SEL_ATN_NO_MSG_OUT: + /* + ** The device didn't go to MSG OUT phase after having + ** been selected with ATN. We donnot want to handle + ** that. + */ + printk ("%s:%d: No MSG OUT phase after selection with ATN.\n", + ncr_name (np), target); + goto out_stuck; + case SIR_RESEL_NO_MSG_IN: + case SIR_RESEL_NO_IDENTIFY: + /* + ** If devices reselecting without sending an IDENTIFY + ** message still exist, this should help. + ** We just assume lun=0, 1 CCB, no tag. + */ + if (tp->lp[0]) { + OUTL (nc_dsa, scr_to_cpu(tp->lp[0]->tasktbl[0])); + OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, resel_go)); + return; + } + case SIR_RESEL_BAD_LUN: + np->msgout[0] = M_RESET; + goto out; + case SIR_RESEL_BAD_I_T_L: + np->msgout[0] = M_ABORT; + goto out; + case SIR_RESEL_BAD_I_T_L_Q: + np->msgout[0] = M_ABORT_TAG; + goto out; + case SIR_RESEL_ABORTED: + np->lastmsg = np->msgout[0]; + np->msgout[0] = M_NOOP; + printk ("%s:%d: message %d sent on bad reselection.\n", + ncr_name (np), target, np->lastmsg); + goto out; + case SIR_MSG_OUT_DONE: + np->lastmsg = np->msgout[0]; + np->msgout[0] = M_NOOP; + /* Should we really care of that */ + if (np->lastmsg == M_PARITY || np->lastmsg == M_ID_ERROR) + OUTOFFB (HF_PRT, HF_PAR_ERR); + goto out; + case SIR_BAD_STATUS: + cp = ncr_ccb_from_dsa(np, dsa); + if (!cp) + goto out; + ncr_sir_to_redo(np, num, cp); + return; + default: + /* + ** lookup the ccb + */ + cp = ncr_ccb_from_dsa(np, dsa); + if (!cp) + goto out; + } + + switch (num) { +/*----------------------------------------------------------------------------- +** +** Was Sie schon immer ueber transfermode negotiation wissen wollten ... +** +** We try to negotiate sync and wide transfer only after +** a successfull inquire command. We look at byte 7 of the +** inquire data to determine the capabilities of the target. +** +** When we try to negotiate, we append the negotiation message +** to the identify and (maybe) simple tag message. +** The host status field is set to HS_NEGOTIATE to mark this +** situation. +** +** If the target doesn't answer this message immidiately +** (as required by the standard), the SIR_NEGO_FAIL interrupt +** will be raised eventually. +** The handler removes the HS_NEGOTIATE status, and sets the +** negotiated value to the default (async / nowide). +** +** If we receive a matching answer immediately, we check it +** for validity, and set the values. +** +** If we receive a Reject message immediately, we assume the +** negotiation has failed, and fall back to standard values. +** +** If we receive a negotiation message while not in HS_NEGOTIATE +** state, it's a target initiated negotiation. We prepare a +** (hopefully) valid answer, set our parameters, and send back +** this answer to the target. +** +** If the target doesn't fetch the answer (no message out phase), +** we assume the negotiation has failed, and fall back to default +** settings. +** +** When we set the values, we adjust them in all ccbs belonging +** to this target, in the controller's register, and in the "phys" +** field of the controller's struct ncb. +** +** Possible cases: hs sir msg_in value send goto +** We try to negotiate: +** -> target doesnt't msgin NEG FAIL noop defa. - dispatch +** -> target rejected our msg NEG FAIL reject defa. - dispatch +** -> target answered (ok) NEG SYNC sdtr set - clrack +** -> target answered (!ok) NEG SYNC sdtr defa. REJ--->msg_bad +** -> target answered (ok) NEG WIDE wdtr set - clrack +** -> target answered (!ok) NEG WIDE wdtr defa. REJ--->msg_bad +** -> any other msgin NEG FAIL noop defa. - dispatch +** +** Target tries to negotiate: +** -> incoming message --- SYNC sdtr set SDTR - +** -> incoming message --- WIDE wdtr set WDTR - +** We sent our answer: +** -> target doesn't msgout --- PROTO ? defa. - dispatch +** +**----------------------------------------------------------------------------- +*/ + + case SIR_NEGO_FAILED: + /*------------------------------------------------------- + ** + ** Negotiation failed. + ** Target doesn't send an answer message, + ** or target rejected our message. + ** + ** Remove negotiation request. + ** + **------------------------------------------------------- + */ + OUTB (HS_PRT, HS_BUSY); + + /* fall through */ + + case SIR_NEGO_PROTO: + /*------------------------------------------------------- + ** + ** Negotiation failed. + ** Target doesn't fetch the answer message. + ** + **------------------------------------------------------- + */ + + if (DEBUG_FLAGS & DEBUG_NEGO) { + PRINT_ADDR(cp->cmd); + printk ("negotiation failed sir=%x status=%x.\n", + num, cp->nego_status); + }; + + /* + ** any error in negotiation: + ** fall back to default mode. + */ + switch (cp->nego_status) { + + case NS_SYNC: + ncr_setsync (np, cp, 0, 0xe0); + break; + + case NS_WIDE: + ncr_setwide (np, cp, 0, 0); + break; + + }; + np->msgin [0] = M_NOOP; + np->msgout[0] = M_NOOP; + cp->nego_status = 0; + break; + + case SIR_NEGO_SYNC: + /* + ** Synchronous request message received. + */ + + if (DEBUG_FLAGS & DEBUG_NEGO) { + PRINT_ADDR(cp->cmd); + printk ("sync msgin: "); + (void) ncr_show_msg (np->msgin); + printk (".\n"); + }; + + /* + ** get requested values. + */ + + chg = 0; + per = np->msgin[3]; + ofs = np->msgin[4]; + if (ofs==0) per=255; + + /* + ** if target sends SDTR message, + ** it CAN transfer synch. + */ + + if (ofs) + tp->inq_byte7 |= INQ7_SYNC; + + /* + ** check values against driver limits. + */ + + if (per < np->minsync) + {chg = 1; per = np->minsync;} + if (per < tp->minsync) + {chg = 1; per = tp->minsync;} + if (ofs > tp->maxoffs) + {chg = 1; ofs = tp->maxoffs;} + + /* + ** Check against controller limits. + */ + fak = 7; + scntl3 = 0; + if (ofs != 0) { + ncr_getsync(np, per, &fak, &scntl3); + if (fak > 7) { + chg = 1; + ofs = 0; + } + } + if (ofs == 0) { + fak = 7; + per = 0; + scntl3 = 0; + tp->minsync = 0; + } + + if (DEBUG_FLAGS & DEBUG_NEGO) { + PRINT_ADDR(cp->cmd); + printk ("sync: per=%d scntl3=0x%x ofs=%d fak=%d chg=%d.\n", + per, scntl3, ofs, fak, chg); + } + + if (INB (HS_PRT) == HS_NEGOTIATE) { + OUTB (HS_PRT, HS_BUSY); + switch (cp->nego_status) { + + case NS_SYNC: + /* + ** This was an answer message + */ + if (chg) { + /* + ** Answer wasn't acceptable. + */ + ncr_setsync (np, cp, 0, 0xe0); + OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, msg_bad)); + } else { + /* + ** Answer is ok. + */ + ncr_setsync (np, cp, scntl3, (fak<<5)|ofs); + OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, clrack)); + }; + return; + + case NS_WIDE: + ncr_setwide (np, cp, 0, 0); + break; + }; + }; + + /* + ** It was a request. Set value and + ** prepare an answer message + */ + + ncr_setsync (np, cp, scntl3, (fak<<5)|ofs); + + np->msgout[0] = M_EXTENDED; + np->msgout[1] = 3; + np->msgout[2] = M_X_SYNC_REQ; + np->msgout[3] = per; + np->msgout[4] = ofs; + + cp->nego_status = NS_SYNC; + + if (DEBUG_FLAGS & DEBUG_NEGO) { + PRINT_ADDR(cp->cmd); + printk ("sync msgout: "); + (void) ncr_show_msg (np->msgout); + printk (".\n"); + } + + if (!ofs) { + OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, msg_bad)); + return; + } + np->msgin [0] = M_NOOP; + + break; + + case SIR_NEGO_WIDE: + /* + ** Wide request message received. + */ + if (DEBUG_FLAGS & DEBUG_NEGO) { + PRINT_ADDR(cp->cmd); + printk ("wide msgin: "); + (void) ncr_show_msg (np->msgin); + printk (".\n"); + }; + + /* + ** get requested values. + */ + + chg = 0; + wide = np->msgin[3]; + + /* + ** if target sends WDTR message, + ** it CAN transfer wide. + */ + + if (wide) + tp->inq_byte7 |= INQ7_WIDE16; + + /* + ** check values against driver limits. + */ + + if (wide > tp->usrwide) + {chg = 1; wide = tp->usrwide;} + + if (DEBUG_FLAGS & DEBUG_NEGO) { + PRINT_ADDR(cp->cmd); + printk ("wide: wide=%d chg=%d.\n", wide, chg); + } + + if (INB (HS_PRT) == HS_NEGOTIATE) { + OUTB (HS_PRT, HS_BUSY); + switch (cp->nego_status) { + + case NS_WIDE: + /* + ** This was an answer message + */ + if (chg) { + /* + ** Answer wasn't acceptable. + */ + ncr_setwide (np, cp, 0, 1); + OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, msg_bad)); + } else { + /* + ** Answer is ok. + */ + ncr_setwide (np, cp, wide, 1); + OUTL (nc_dsp, NCB_SCRIPT_PHYS (np, clrack)); + }; + return; + + case NS_SYNC: + ncr_setsync (np, cp, 0, 0xe0); + break; + }; + }; + + /* + ** It was a request, set value and + ** prepare an answer message + */ + + ncr_setwide (np, cp, wide, 1); + + np->msgout[0] = M_EXTENDED; + np->msgout[1] = 2; + np->msgout[2] = M_X_WIDE_REQ; + np->msgout[3] = wide; + + np->msgin [0] = M_NOOP; + + cp->nego_status = NS_WIDE; + + if (DEBUG_FLAGS & DEBUG_NEGO) { + PRINT_ADDR(cp->cmd); + printk ("wide msgout: "); + (void) ncr_show_msg (np->msgin); + printk (".\n"); + } + break; + +/*-------------------------------------------------------------------- +** +** Processing of special messages +** +**-------------------------------------------------------------------- +*/ + + case SIR_REJECT_RECEIVED: + /*----------------------------------------------- + ** + ** We received a M_REJECT message. + ** + **----------------------------------------------- + */ + + PRINT_ADDR(cp->cmd); + printk ("M_REJECT received (%x:%x).\n", + (unsigned)scr_to_cpu(np->lastmsg), np->msgout[0]); + break; + + case SIR_REJECT_TO_SEND: + /*----------------------------------------------- + ** + ** We received an unknown message + ** + **----------------------------------------------- + */ + + PRINT_ADDR(cp->cmd); + printk ("M_REJECT to send for "); + (void) ncr_show_msg (np->msgin); + printk (".\n"); + np->msgout[0] = M_REJECT; + break; + +/*-------------------------------------------------------------------- +** +** Processing of special messages +** +**-------------------------------------------------------------------- +*/ + + case SIR_IGN_RESIDUE: + /*----------------------------------------------- + ** + ** We received an IGNORE RESIDUE message, + ** which couldn't be handled by the script. + ** + **----------------------------------------------- + */ + + PRINT_ADDR(cp->cmd); + printk ("M_IGN_RESIDUE received, but not yet implemented.\n"); + break; +#if 0 + case SIR_MISSING_SAVE: + /*----------------------------------------------- + ** + ** We received an DISCONNECT message, + ** but the datapointer wasn't saved before. + ** + **----------------------------------------------- + */ + + PRINT_ADDR(cp->cmd); + printk ("M_DISCONNECT received, but datapointer not saved: " + "data=%x save=%x goal=%x.\n", + (unsigned) INL (nc_temp), + (unsigned) scr_to_cpu(np->header.savep), + (unsigned) scr_to_cpu(np->header.goalp)); + break; +#endif + }; + +out: + OUTONB (nc_dcntl, (STD|NOCOM)); +out_stuck: +} + +/*========================================================== +** +** +** Aquire a control block +** +** +**========================================================== +*/ + +static ccb_p ncr_get_ccb (ncb_p np, u_char tn, u_char ln) +{ + tcb_p tp = &np->target[tn]; + lcb_p lp = tp->lp[ln]; + u_char tag = NO_TAG; + XPT_QUEHEAD *qp; + ccb_p cp = (ccb_p) 0; + + /* + ** Allocate a new CCB if needed. + */ + if (xpt_que_empty(&np->free_ccbq)) + (void) ncr_alloc_ccb(np); + + /* + ** Look for a free CCB + */ + qp = xpt_remque_head(&np->free_ccbq); + if (!qp) + goto out; + cp = xpt_que_entry(qp, struct ccb, link_ccbq); + + /* + ** If the LCB is not yet available and we already + ** have queued a CCB for a LUN without LCB, + ** give up. Otherwise all is fine. :-) + */ + if (!lp) { + if (xpt_que_empty(&np->b0_ccbq)) + xpt_insque_head(&cp->link_ccbq, &np->b0_ccbq); + else + goto out_free; + } else { + /* + ** Tune tag mode if asked by user. + */ + if (lp->queuedepth != lp->numtags) { + ncr_setup_tags(np, tn, ln); + } + + /* + ** Get a tag for this nexus if required. + ** Keep from using more tags than we can handle. + */ + if (lp->usetags) { + if (lp->busyccbs < lp->maxnxs) { + tag = lp->cb_tags[lp->ia_tag]; + ++lp->ia_tag; + if (lp->ia_tag == SCSI_NCR_MAX_TAGS) + lp->ia_tag = 0; + lp->tags_umap |= (((tagmap_t) 1) << tag); + } + else + goto out_free; + } + + /* + ** Put the CCB in the LUN wait queue and + ** count it as busy. + */ + xpt_insque_tail(&cp->link_ccbq, &lp->wait_ccbq); + ++lp->busyccbs; + } + + /* + ** Remember all informations needed to free this CCB. + */ + cp->tag = tag; + cp->target = tn; + cp->lun = ln; + + if (DEBUG_FLAGS & DEBUG_TAGS) { + PRINT_LUN(np, tn, ln); + printk ("ccb @%p using tag %d.\n", cp, tag); + } + +out: + return cp; +out_free: + xpt_insque_head(&cp->link_ccbq, &np->free_ccbq); + return (ccb_p) 0; +} + +/*========================================================== +** +** +** Release one control block +** +** +**========================================================== +*/ + +static void ncr_free_ccb (ncb_p np, ccb_p cp) +{ + tcb_p tp = &np->target[cp->target]; + lcb_p lp = tp->lp[cp->lun]; + + if (DEBUG_FLAGS & DEBUG_TAGS) { + PRINT_LUN(np, cp->target, cp->lun); + printk ("ccb @%p freeing tag %d.\n", cp, cp->tag); + } + + /* + ** If lun control block available, make available + ** the task slot and the tag if any. + ** Decrement counters. + */ + if (lp) { + if (cp->tag != NO_TAG) { + lp->cb_tags[lp->if_tag++] = cp->tag; + if (lp->if_tag == SCSI_NCR_MAX_TAGS) + lp->if_tag = 0; + lp->tags_umap &= ~(((tagmap_t) 1) << cp->tag); + lp->tags_smap &= lp->tags_umap; + lp->tasktbl[cp->tag] = cpu_to_scr(np->p_bad_i_t_l_q); + } else { + lp->tasktbl[0] = cpu_to_scr(np->p_bad_i_t_l); + } + --lp->busyccbs; + if (cp->queued) { + --lp->queuedccbs; + } + } + + /* + ** Make this CCB available. + */ + xpt_remque(&cp->link_ccbq); + xpt_insque_head(&cp->link_ccbq, &np->free_ccbq); + cp -> host_status = HS_IDLE; + cp -> queued = 0; +} + +/*------------------------------------------------------------------------ +** Allocate a CCB and initialize its fixed part. +**------------------------------------------------------------------------ +**------------------------------------------------------------------------ +*/ +static ccb_p ncr_alloc_ccb(ncb_p np) +{ + ccb_p cp = 0; + int hcode; + + /* + ** Allocate memory for this CCB. + */ + cp = m_calloc(sizeof(struct ccb), "CCB", MEMO_WARN); + if (!cp) + return 0; + + /* + ** Count it and initialyze it. + */ + np->actccbs++; + + /* + ** Remember virtual and bus address of this ccb. + */ + cp->p_ccb = vtobus(cp); + + /* + ** Insert this ccb into the hashed list. + */ + hcode = CCB_HASH_CODE(cp->p_ccb); + cp->link_ccbh = np->ccbh[hcode]; + np->ccbh[hcode] = cp; + + /* + ** Initialyze the start and restart actions. + */ + cp->phys.header.go.start = cpu_to_scr(NCB_SCRIPT_PHYS (np, idle)); + cp->phys.header.go.restart = cpu_to_scr(NCB_SCRIPTH_PHYS(np,bad_i_t_l)); + + /* + ** Chain into wakeup list and free ccb queue. + */ + cp->link_ccb = np->ccbc; + np->ccbc = cp; + + xpt_insque_head(&cp->link_ccbq, &np->free_ccbq); + + return cp; +} + +/*------------------------------------------------------------------------ +** Look up a CCB from a DSA value. +**------------------------------------------------------------------------ +**------------------------------------------------------------------------ +*/ +static ccb_p ncr_ccb_from_dsa(ncb_p np, u_long dsa) +{ + int hcode; + ccb_p cp; + + hcode = CCB_HASH_CODE(dsa); + cp = np->ccbh[hcode]; + while (cp) { + if (cp->p_ccb == dsa) + break; + cp = cp->link_ccbh; + } + + return cp; +} + +/*========================================================== +** +** +** Allocation of resources for Targets/Luns/Tags. +** +** +**========================================================== +*/ + + +/*------------------------------------------------------------------------ +** Target control block initialisation. +**------------------------------------------------------------------------ +** This data structure is fully initialized after a SCSI command +** has been successfully completed for this target. +**------------------------------------------------------------------------ +*/ +static void ncr_init_tcb (ncb_p np, u_char tn) +{ + tcb_p tp = &np->target[tn]; + + /* + ** Already bone. + */ + if (tp->luntbl) + return; + /* + ** Allocate the lcb bus address array. + */ + tp->luntbl = m_calloc(256, "LUNTBL", MEMO_WARN); + if (!tp->luntbl) + return; + + /* + ** Compute the bus address of this table. + */ + tp->b_luntbl = cpu_to_scr(vtobus(tp->luntbl)); + + /* + ** Check some alignments required by the chip. + */ + assert (( (offsetof(struct ncr_reg, nc_sxfer) ^ + offsetof(struct tcb , sval )) &3) == 0); + assert (( (offsetof(struct ncr_reg, nc_scntl3) ^ + offsetof(struct tcb , wval )) &3) == 0); +} + +/*------------------------------------------------------------------------ +** Lun control block allocation and initialization. +**------------------------------------------------------------------------ +** This data structure is allocated and initialized after a SCSI +** command has been successfully completed for this target/lun. +**------------------------------------------------------------------------ +*/ +static lcb_p ncr_alloc_lcb (ncb_p np, u_char tn, u_char ln) +{ + tcb_p tp = &np->target[tn]; + lcb_p lp = tp->lp[ln]; + + /* + ** Already done, return. + */ + if (lp) + return lp; + + /* + ** Initialize the target control block if not yet. + */ + ncr_init_tcb(np, tn); + if (!tp->luntbl) + goto fail; + + /* + ** Allocate the lcb. + */ + lp = m_calloc(sizeof(struct lcb), "LCB", MEMO_WARN); + if (!lp) + goto fail; + tp->lp[ln] = lp; + + /* + ** Make it available to the chip. + */ + tp->luntbl[ln] = cpu_to_scr(vtobus(lp)); + + /* + ** Initialize the CCB queue headers. + */ + xpt_que_init(&lp->busy_ccbq); + xpt_que_init(&lp->wait_ccbq); + + /* + ** Set max CCBs to 1 and use the default task array + ** by default. + */ + lp->maxnxs = 1; + lp->tasktbl = &lp->tasktbl_0; + lp->b_tasktbl = cpu_to_scr(vtobus(lp->tasktbl)); + lp->tasktbl[0] = cpu_to_scr(np->p_notask); + lp->resel_task = cpu_to_scr(NCB_SCRIPT_PHYS(np, resel_notag)); + + /* + ** Initialize command queuing control. + */ + lp->busyccbs = 1; + lp->queuedccbs = 1; + lp->queuedepth = 1; +fail: + return lp; +} + + +/*------------------------------------------------------------------------ +** Lun control block setup on INQUIRY data received. +**------------------------------------------------------------------------ +** We only support WIDE, SYNC for targets and CMDQ for logical units. +** This setup is done on each INQUIRY since we are expecting user +** will play with CHANGE DEFINITION commands. :-) +**------------------------------------------------------------------------ +*/ +static lcb_p ncr_setup_lcb (ncb_p np, u_char tn, u_char ln, u_char *inq_data) +{ + tcb_p tp = &np->target[tn]; + lcb_p lp = tp->lp[ln]; + u_char inq_byte7; + int i; + + /* + ** If no lcb, try to allocate it. + */ + if (!lp && !(lp = ncr_alloc_lcb(np, tn, ln))) + goto fail; + + /* + ** Get device quirks from a speciality table. + */ + tp->quirks = ncr_lookup (inq_data); + if (tp->quirks && bootverbose) { + PRINT_LUN(np, tn, ln); + printk ("quirks=%x.\n", tp->quirks); + } + + /* + ** Evaluate trustable target/unit capabilities. + ** We only believe device version >= SCSI-2 that + ** use appropriate response data format (2). + ** But it seems that some CCS devices also + ** support SYNC and I donnot want to frustrate + ** anybody. ;-) + */ + inq_byte7 = 0; + if ((inq_data[2] & 0x7) >= 2 && (inq_data[3] & 0xf) == 2) + inq_byte7 = inq_data[7]; + else if ((inq_data[2] & 0x7) == 1 && (inq_data[3] & 0xf) == 1) + inq_byte7 = INQ7_SYNC; + + /* + ** Throw away announced LUN capabilities if we are told + ** that there is no real device supported by the logical unit. + */ + if ((inq_data[0] & 0xe0) > 0x20 || (inq_data[0] & 0x1f) == 0x1f) + inq_byte7 &= (INQ7_SYNC | INQ7_WIDE16); + + /* + ** If user is wanting SYNC, force this feature. + */ + if (driver_setup.force_sync_nego) + inq_byte7 |= INQ7_SYNC; + + /* + ** Prepare negotiation if SIP capabilities have changed. + */ + tp->inq_done = 1; + if ((inq_byte7 ^ tp->inq_byte7) & (INQ7_SYNC | INQ7_WIDE16)) { + tp->inq_byte7 = inq_byte7; + ncr_negotiate(np, tp); + } + + /* + ** If unit supports tagged commands, allocate and + ** initialyze the task table if not yet. + */ + if ((inq_byte7 & INQ7_QUEUE) && lp->tasktbl == &lp->tasktbl_0) { + lp->tasktbl = m_calloc(256, "TASKTBL", MEMO_WARN); + if (!lp->tasktbl) { + lp->tasktbl = &lp->tasktbl_0; + goto fail; + } + lp->b_tasktbl = cpu_to_scr(vtobus(lp->tasktbl)); + for (i = 0 ; i < 64 ; i++) + lp->tasktbl[i] = cpu_to_scr(np->p_notask); + for (i = 0 ; i < SCSI_NCR_MAX_TAGS ; i++) + lp->cb_tags[i] = i; + lp->maxnxs = SCSI_NCR_MAX_TAGS; + lp->tags_stime = jiffies; + } + + /* + ** Adjust tagged queueing status if needed. + */ + if ((inq_byte7 ^ lp->inq_byte7) & INQ7_QUEUE) { + lp->inq_byte7 = inq_byte7; + lp->numtags = lp->maxtags; + ncr_setup_tags (np, tn, ln); + } + +fail: + return lp; +} + +/*========================================================== +** +** +** Build Scatter Gather Block +** +** +**========================================================== +** +** The transfer area may be scattered among +** several non adjacent physical pages. +** +** We may use MAX_SCATTER blocks. +** +**---------------------------------------------------------- +*/ + +/* +** We try to reduce the number of interrupts caused +** by unexpected phase changes due to disconnects. +** A typical harddisk may disconnect before ANY block. +** If we wanted to avoid unexpected phase changes at all +** we had to use a break point every 512 bytes. +** Of course the number of scatter/gather blocks is +** limited. +** Under Linux, the scatter/gatter blocks are provided by +** the generic driver. We just have to copy addresses and +** sizes to the data segment array. +*/ + +/* +** For 64 bit systems, we use the 8 upper bits of the size field +** to provide bus address bits 32-39 to the SCRIPTS processor. +** This allows the 896 to access up to 1 tera-bytes of memory. +** For 32 bit chips on 64 bit systems, we must be provided with +** memory addresses that fit into the first 32 bit bus address +** range and so, this does not matter and we expect an error from +** the chip if this ever happen. +** +** We use a separate function for the case Linux does not provide +** a scatter list in order to allow better code optimization +** for the case we have a scatter list (BTW, for now this just wastes +** about 40 bytes of code for x86, but my guess is that the scatter +** code will get more complex later). +*/ + +#if BITS_PER_LONG > 32 +#define SCATTER_ONE(data, badd, len) \ + (data)->addr = cpu_to_scr(badd); \ + (data)->size = cpu_to_scr((((badd) >> 8) & 0xff000000) + len); +#else +#define SCATTER_ONE(data, badd, len) \ + (data)->addr = cpu_to_scr(badd); \ + (data)->size = cpu_to_scr(len); +#endif + +#define CROSS_16MB(p, n) (((((u_long) p) + n - 1) ^ ((u_long) p)) & ~0xffffff) + +static int ncr_scatter_no_sglist(ccb_p cp, Scsi_Cmnd *cmd) +{ + struct scr_tblmove *data = &cp->phys.data[MAX_SCATTER-1]; + int segment; + + cp->data_len = cmd->request_bufflen; + + if (cmd->request_bufflen) { + u_long baddr = vtobus(cmd->request_buffer); + SCATTER_ONE(data, baddr, cmd->request_bufflen); + if (CROSS_16MB(baddr, cmd->request_bufflen)) { + cp->host_flags |= HF_PM_TO_C; +#ifdef DEBUG_896R1 +printk("He! we are crossing a 16 MB boundary (0x%lx, 0x%x)\n", + baddr, cmd->request_bufflen); +#endif + } + segment = 1; + } + else + segment = 0; + + return segment; +} + +/* +** DEL 472 - 53C896 Rev 1 - Part Number 609-0393055 - ITEM 5. +** +** We disable data phase mismatch handling from SCRIPTS for data +** transfers that contains scatter/gather entries that cross +** a 16 MB boundary. +** We use a different scatter function for 896 rev. 1 that needs +** such a work-around. Doing so, we do not affect performance for +** other chips. +** This problem should not be triggered for disk IOs under Linux, +** since such IOs are performed using pages and buffers that are +** nicely power-of-two sized and aligned. But, since this may change +** at any time, a work-around was required. +*/ +static int ncr_scatter_896R1(ccb_p cp, Scsi_Cmnd *cmd) +{ + int segn; + int use_sg = (int) cmd->use_sg; + + cp->data_len = 0; + + if (!use_sg) + segn = ncr_scatter_no_sglist(cp, cmd); + else if (use_sg > MAX_SCATTER) + segn = -1; + else { + struct scatterlist *scatter = (struct scatterlist *)cmd->buffer; + struct scr_tblmove *data = &cp->phys.data[MAX_SCATTER - use_sg]; + + for (segn = 0; segn < use_sg; segn++) { + u_long baddr = vtobus(scatter[segn].address); + SCATTER_ONE(&data[segn], + baddr, + scatter[segn].length); + if (CROSS_16MB(baddr, scatter[segn].length)) { + cp->host_flags |= HF_PM_TO_C; +#ifdef DEBUG_896R1 +printk("He! we are crossing a 16 MB boundary (0x%lx, 0x%x)\n", + baddr, scatter[segn].length); +#endif + } + cp->data_len += scatter[segn].length; + } + } + + return segn; +} + +static int ncr_scatter(ccb_p cp, Scsi_Cmnd *cmd) +{ + int segment; + int use_sg = (int) cmd->use_sg; + + cp->data_len = 0; + + if (!use_sg) + segment = ncr_scatter_no_sglist(cp, cmd); + else if (use_sg > MAX_SCATTER) + segment = -1; + else { + struct scatterlist *scatter = (struct scatterlist *)cmd->buffer; + struct scr_tblmove *data = &cp->phys.data[MAX_SCATTER - use_sg]; + + for (segment = 0; segment < use_sg; segment++) { + u_long baddr = vtobus(scatter[segment].address); + SCATTER_ONE(&data[segment], + baddr, + scatter[segment].length); + cp->data_len += scatter[segment].length; + } + } + + return segment; +} + +/*========================================================== +** +** +** Test the pci bus snoop logic :-( +** +** Has to be called with interrupts disabled. +** +** +**========================================================== +*/ + +#ifndef NCR_IOMAPPED +__initfunc( +static int ncr_regtest (struct ncb* np) +) +{ + register volatile u_int32 data; + /* + ** ncr registers may NOT be cached. + ** write 0xffffffff to a read only register area, + ** and try to read it back. + */ + data = 0xffffffff; + OUTL_OFF(offsetof(struct ncr_reg, nc_dstat), data); + data = INL_OFF(offsetof(struct ncr_reg, nc_dstat)); +#if 1 + if (data == 0xffffffff) { +#else + if ((data & 0xe2f0fffd) != 0x02000080) { +#endif + printk ("CACHE TEST FAILED: reg dstat-sstat2 readback %x.\n", + (unsigned) data); + return (0x10); + }; + return (0); +} +#endif + +__initfunc( +static int ncr_snooptest (struct ncb* np) +) +{ + u_int32 ncr_rd, ncr_wr, ncr_bk, host_rd, host_wr, pc; + int i, err=0; +#ifndef NCR_IOMAPPED + if (np->reg) { + err |= ncr_regtest (np); + if (err) return (err); + } +#endif + /* + ** init + */ + pc = NCB_SCRIPTH0_PHYS (np, snooptest); + host_wr = 1; + ncr_wr = 2; + /* + ** Set memory and register. + */ + np->ncr_cache = cpu_to_scr(host_wr); + OUTL (nc_temp, ncr_wr); + /* + ** Start script (exchange values) + */ + OUTL (nc_dsa, vtobus(np)); + OUTL (nc_dsp, pc); + /* + ** Wait 'til done (with timeout) + */ + for (i=0; incr_cache); + ncr_rd = INL (nc_scratcha); + ncr_bk = INL (nc_temp); + + /* + ** check for timeout + */ + if (i>=NCR_SNOOP_TIMEOUT) { + printk ("CACHE TEST FAILED: timeout.\n"); + return (0x20); + }; + /* + ** Check termination position. + */ + if (pc != NCB_SCRIPTH0_PHYS (np, snoopend)+8) { + printk ("CACHE TEST FAILED: script execution failed.\n"); + printk ("start=%08lx, pc=%08lx, end=%08lx\n", + (u_long) NCB_SCRIPTH0_PHYS (np, snooptest), (u_long) pc, + (u_long) NCB_SCRIPTH0_PHYS (np, snoopend) +8); + return (0x40); + }; + /* + ** Show results. + */ + if (host_wr != ncr_rd) { + printk ("CACHE TEST FAILED: host wrote %d, ncr read %d.\n", + (int) host_wr, (int) ncr_rd); + err |= 1; + }; + if (host_rd != ncr_wr) { + printk ("CACHE TEST FAILED: ncr wrote %d, host read %d.\n", + (int) ncr_wr, (int) host_rd); + err |= 2; + }; + if (ncr_bk != ncr_wr) { + printk ("CACHE TEST FAILED: ncr wrote %d, read back %d.\n", + (int) ncr_wr, (int) ncr_bk); + err |= 4; + }; + return (err); +} + +/*========================================================== +** +** +** Profiling the drivers and targets performance. +** +** +**========================================================== +*/ + +#ifdef SCSI_NCR_PROFILE_SUPPORT + +static void ncb_profile (ncb_p np, ccb_p cp) +{ + int num_disc = (cp->phys.num_disc & 0xff); + int num_disc0 = (cp->phys.num_disc >> 8); + + ++np->profile.num_trans; + np->profile.num_disc += num_disc; + np->profile.num_disc0 += num_disc0; + np->profile.num_kbytes += (cp->data_len >> 10); +#if 000 + if (num_disc > num_disc0) { + if (cp->data_len <= 1024) + np->profile.num_br1k += (num_disc - num_disc0); + else if (cp->data_len <= 2048) + np->profile.num_br2k += (num_disc - num_disc0); + else if (cp->data_len <= 4096) + np->profile.num_br4k += (num_disc - num_disc0); + else if (cp->data_len <= 8192) + np->profile.num_br8k += (num_disc - num_disc0); + else + np->profile.num_brnk += (num_disc - num_disc0); + } +#endif +} + +#endif /* SCSI_NCR_PROFILE_SUPPORT */ + +/*========================================================== +** +** +** Device lookup. +** +** @GENSCSI@ should be integrated to scsiconf.c +** +** +**========================================================== +*/ + +struct table_entry { + char * manufacturer; + char * model; + char * version; + u_long info; +}; + +static struct table_entry device_tab[] = +{ +#if 0 + {"", "", "", QUIRK_NOMSG}, +#endif + {"SONY", "SDT-5000", "3.17", QUIRK_NOMSG}, + {"WangDAT", "Model 2600", "01.7", QUIRK_NOMSG}, + {"WangDAT", "Model 3200", "02.2", QUIRK_NOMSG}, + {"WangDAT", "Model 1300", "02.4", QUIRK_NOMSG}, + {"", "", "", 0} /* catch all: must be last entry. */ +}; + +static u_long ncr_lookup(char * id) +{ + struct table_entry * p = device_tab; + char *d, *r, c; + + for (;;p++) { + + d = id+8; + r = p->manufacturer; + while ((c=*r++)) if (c!=*d++) break; + if (c) continue; + + d = id+16; + r = p->model; + while ((c=*r++)) if (c!=*d++) break; + if (c) continue; + + d = id+32; + r = p->version; + while ((c=*r++)) if (c!=*d++) break; + if (c) continue; + + return (p->info); + } +} + +/*========================================================== +** +** Determine the ncr's clock frequency. +** This is essential for the negotiation +** of the synchronous transfer rate. +** +**========================================================== +** +** Note: we have to return the correct value. +** THERE IS NO SAFE DEFAULT VALUE. +** +** Most NCR/SYMBIOS boards are delivered with a 40 Mhz clock. +** 53C860 and 53C875 rev. 1 support fast20 transfers but +** do not have a clock doubler and so are provided with a +** 80 MHz clock. All other fast20 boards incorporate a doubler +** and so should be delivered with a 40 MHz clock. +** The recent fast40 chips (895/896) use a 40 Mhz base clock +** and provide a clock quadrupler (160 Mhz). The code below +** tries to deal as cleverly as possible with all this stuff. +** +**---------------------------------------------------------- +*/ + +/* + * Select NCR SCSI clock frequency + */ +static void ncr_selectclock(ncb_p np, u_char scntl3) +{ + if (np->multiplier < 2) { + OUTB(nc_scntl3, scntl3); + return; + } + + if (bootverbose >= 2) + printk ("%s: enabling clock multiplier\n", ncr_name(np)); + + OUTB(nc_stest1, DBLEN); /* Enable clock multiplier */ + if (np->multiplier > 2) { /* Poll bit 5 of stest4 for quadrupler */ + int i = 20; + while (!(INB(nc_stest4) & LCKFRQ) && --i > 0) + UDELAY (20); + if (!i) + printk("%s: the chip cannot lock the frequency\n", ncr_name(np)); + } else /* Wait 20 micro-seconds for doubler */ + UDELAY (20); + OUTB(nc_stest3, HSC); /* Halt the scsi clock */ + OUTB(nc_scntl3, scntl3); + OUTB(nc_stest1, (DBLEN|DBLSEL));/* Select clock multiplier */ + OUTB(nc_stest3, 0x00); /* Restart scsi clock */ +} + + +/* + * calculate NCR SCSI clock frequency (in KHz) + */ +__initfunc( +static unsigned ncrgetfreq (ncb_p np, int gen) +) +{ + unsigned ms = 0; + + /* + * Measure GEN timer delay in order + * to calculate SCSI clock frequency + * + * This code will never execute too + * many loop iterations (if DELAY is + * reasonably correct). It could get + * too low a delay (too high a freq.) + * if the CPU is slow executing the + * loop for some reason (an NMI, for + * example). For this reason we will + * if multiple measurements are to be + * performed trust the higher delay + * (lower frequency returned). + */ + OUTB (nc_stest1, 0); /* make sure clock doubler is OFF */ + OUTW (nc_sien , 0); /* mask all scsi interrupts */ + (void) INW (nc_sist); /* clear pending scsi interrupt */ + OUTB (nc_dien , 0); /* mask all dma interrupts */ + (void) INW (nc_sist); /* another one, just to be sure :) */ + OUTB (nc_scntl3, 4); /* set pre-scaler to divide by 3 */ + OUTB (nc_stime1, 0); /* disable general purpose timer */ + OUTB (nc_stime1, gen); /* set to nominal delay of 1<= 2) + printk ("%s: Delay (GEN=%d): %u msec\n", ncr_name(np), gen, ms); + /* + * adjust for prescaler, and convert into KHz + */ + return ms ? ((1 << gen) * 4340) / ms : 0; +} + +/* + * Get/probe NCR SCSI clock frequency + */ +__initfunc( +static void ncr_getclock (ncb_p np, int mult) +) +{ + unsigned char scntl3 = INB(nc_scntl3); + unsigned char stest1 = INB(nc_stest1); + unsigned f1; + + np->multiplier = 1; + f1 = 40000; + + /* + ** True with 875/895/896 with clock multiplier selected + */ + if (mult > 1 && (stest1 & (DBLEN+DBLSEL)) == DBLEN+DBLSEL) { + if (bootverbose >= 2) + printk ("%s: clock multiplier found\n", ncr_name(np)); + np->multiplier = mult; + } + + /* + ** If multiplier not found or scntl3 not 7,5,3, + ** reset chip and get frequency from general purpose timer. + ** Otherwise trust scntl3 BIOS setting. + */ + if (np->multiplier != mult || (scntl3 & 7) < 3 || !(scntl3 & 1)) { + unsigned f2; + + (void) ncrgetfreq (np, 11); /* throw away first result */ + f1 = ncrgetfreq (np, 11); + f2 = ncrgetfreq (np, 11); + + if (bootverbose) + printk ("%s: NCR clock is %uKHz, %uKHz\n", ncr_name(np), f1, f2); + + if (f1 > f2) f1 = f2; /* trust lower result */ + + if (f1 < 45000) f1 = 40000; + else if (f1 < 55000) f1 = 50000; + else f1 = 80000; + + if (f1 < 80000 && mult > 1) { + if (bootverbose >= 2) + printk ("%s: clock multiplier assumed\n", ncr_name(np)); + np->multiplier = mult; + } + } else { + if ((scntl3 & 7) == 3) f1 = 40000; + else if ((scntl3 & 7) == 5) f1 = 80000; + else f1 = 160000; + + f1 /= np->multiplier; + } + + /* + ** Compute controller synchronous parameters. + */ + f1 *= np->multiplier; + np->clock_khz = f1; +} + +/*===================== LINUX ENTRY POINTS SECTION ==========================*/ + +#ifndef uchar +#define uchar unsigned char +#endif + +#ifndef ushort +#define ushort unsigned short +#endif + +#ifndef ulong +#define ulong unsigned long +#endif + +/* --------------------------------------------------------------------- +** +** Driver setup from the boot command line +** +** --------------------------------------------------------------------- +*/ + +#ifdef MODULE +#define ARG_SEP ' ' +#else +#define ARG_SEP ',' +#endif + +#define OPT_TAGS 1 +#define OPT_MASTER_PARITY 2 +#define OPT_SCSI_PARITY 3 +#define OPT_DISCONNECTION 4 +#define OPT_SPECIAL_FEATURES 5 +#define OPT_ULTRA_SCSI 6 +#define OPT_FORCE_SYNC_NEGO 7 +#define OPT_REVERSE_PROBE 8 +#define OPT_DEFAULT_SYNC 9 +#define OPT_VERBOSE 10 +#define OPT_DEBUG 11 +#define OPT_BURST_MAX 12 +#define OPT_LED_PIN 13 +#define OPT_MAX_WIDE 14 +#define OPT_SETTLE_DELAY 15 +#define OPT_DIFF_SUPPORT 16 +#define OPT_IRQM 17 +#define OPT_PCI_FIX_UP 18 +#define OPT_BUS_CHECK 19 +#define OPT_OPTIMIZE 20 +#define OPT_RECOVERY 21 +#define OPT_SAFE_SETUP 22 +#define OPT_USE_NVRAM 23 +#define OPT_EXCLUDE 24 + +static char setup_token[] __initdata = + "tags:" "mpar:" + "spar:" "disc:" + "specf:" "ultra:" + "fsn:" "revprob:" + "sync:" "verb:" + "debug:" "burst:" + "led:" "wide:" + "settle:" "diff:" + "irqm:" "pcifix:" + "buschk:" "optim:" + "recovery:" + "safe:" "nvram:" + "excl:"; + +#ifdef MODULE +#define ARG_SEP ' ' +#else +#define ARG_SEP ',' +#endif + +__initfunc( +static int get_setup_token(char *p) +) +{ + char *cur = setup_token; + char *pc; + int i = 0; + + while (cur != NULL && (pc = strchr(cur, ':')) != NULL) { + ++pc; + ++i; + if (!strncmp(p, cur, pc - cur)) + return i; + cur = pc; + } + return 0; +} + + +__initfunc( +void sym53c8xx_setup(char *str, int *ints) +) +{ +#ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT + char *cur = str; + char *pc, *pv; + int i, val, c; + int xi = 0; + + while (cur != NULL && (pc = strchr(cur, ':')) != NULL) { + char *pe; + + val = 0; + pv = pc; + c = *++pv; + + if (c == 'n') + val = 0; + else if (c == 'y') + val = 1; + else + val = (int) simple_strtoul(pv, &pe, 0); + + switch (get_setup_token(cur)) { + case OPT_TAGS: + driver_setup.default_tags = val; + if (pe && *pe == '/') { + i = 0; + while (*pe && *pe != ARG_SEP && + i < sizeof(driver_setup.tag_ctrl)-1) { + driver_setup.tag_ctrl[i++] = *pe++; + } + driver_setup.tag_ctrl[i] = '\0'; + } + break; + case OPT_MASTER_PARITY: + driver_setup.master_parity = val; + break; + case OPT_SCSI_PARITY: + driver_setup.scsi_parity = val; + break; + case OPT_DISCONNECTION: + driver_setup.disconnection = val; + break; + case OPT_SPECIAL_FEATURES: + driver_setup.special_features = val; + break; + case OPT_ULTRA_SCSI: + driver_setup.ultra_scsi = val; + break; + case OPT_FORCE_SYNC_NEGO: + driver_setup.force_sync_nego = val; + break; + case OPT_REVERSE_PROBE: + driver_setup.reverse_probe = val; + break; + case OPT_DEFAULT_SYNC: + driver_setup.default_sync = val; + break; + case OPT_VERBOSE: + driver_setup.verbose = val; + break; + case OPT_DEBUG: + driver_setup.debug = val; + break; + case OPT_BURST_MAX: + driver_setup.burst_max = val; + break; + case OPT_LED_PIN: + driver_setup.led_pin = val; + break; + case OPT_MAX_WIDE: + driver_setup.max_wide = val? 1:0; + break; + case OPT_SETTLE_DELAY: + driver_setup.settle_delay = val; + break; + case OPT_DIFF_SUPPORT: + driver_setup.diff_support = val; + break; + case OPT_IRQM: + driver_setup.irqm = val; + break; + case OPT_PCI_FIX_UP: + driver_setup.pci_fix_up = val; + break; + case OPT_BUS_CHECK: + driver_setup.bus_check = val; + break; + case OPT_OPTIMIZE: + driver_setup.optimize = val; + break; + case OPT_RECOVERY: + driver_setup.recovery = val; + break; + case OPT_USE_NVRAM: + driver_setup.use_nvram = val; + break; + case OPT_SAFE_SETUP: + memcpy(&driver_setup, &driver_safe_setup, + sizeof(driver_setup)); + break; + case OPT_EXCLUDE: + if (xi < SCSI_NCR_MAX_EXCLUDES) + driver_setup.excludes[xi++] = val; + break; + default: + printk("sym53c8xx_setup: unexpected boot option '%.*s' ignored\n", (int)(pc-cur+1), cur); + break; + } + + if ((cur = strchr(cur, ARG_SEP)) != NULL) + ++cur; + } +#endif /* SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT */ +} + +static int sym53c8xx_pci_init(Scsi_Host_Template *tpnt, + uchar bus, uchar device_fn, ncr_device *device); + +/* +** Linux entry point for SYM53C8XX devices detection routine. +** +** Called by the middle-level scsi drivers at initialization time, +** or at module installation. +** +** Read the PCI configuration and try to attach each +** detected NCR board. +** +** If NVRAM is present, try to attach boards according to +** the used defined boot order. +** +** Returns the number of boards successfully attached. +*/ + +__initfunc( +static void ncr_print_driver_setup(void) +) +{ +#define YesNo(y) y ? 'y' : 'n' + printk (NAME53C8XX ": setup=disc:%c,specf:%d,ultra:%d,tags:%d,sync:%d," + "burst:%d,wide:%c,diff:%d,revprob:%c,buschk:0x%x\n", + YesNo(driver_setup.disconnection), + driver_setup.special_features, + driver_setup.ultra_scsi, + driver_setup.default_tags, + driver_setup.default_sync, + driver_setup.burst_max, + YesNo(driver_setup.max_wide), + driver_setup.diff_support, + YesNo(driver_setup.reverse_probe), + driver_setup.bus_check); + + printk (NAME53C8XX ": setup=mpar:%c,spar:%c,fsn=%c,verb:%d,debug:0x%x," + "led:%c,settle:%d,irqm:0x%x,nvram:0x%x,pcifix:0x%x\n", + YesNo(driver_setup.master_parity), + YesNo(driver_setup.scsi_parity), + YesNo(driver_setup.force_sync_nego), + driver_setup.verbose, + driver_setup.debug, + YesNo(driver_setup.led_pin), + driver_setup.settle_delay, + driver_setup.irqm, + driver_setup.use_nvram, + driver_setup.pci_fix_up); +#undef YesNo +} + +/*=================================================================== +** SYM53C8XX devices description table and chip ids list. +**=================================================================== +*/ + +static ncr_chip ncr_chip_table[] __initdata = SCSI_NCR_CHIP_TABLE; +static ushort ncr_chip_ids[] __initdata = SCSI_NCR_CHIP_IDS; + +#ifdef SCSI_NCR_PQS_PDS_SUPPORT +/*=================================================================== +** Detect all NCR PQS/PDS boards and keep track of their bus nr. +** +** The NCR PQS or PDS card is constructed as a DEC bridge +** behind which sit a proprietary NCR memory controller and +** four or two 53c875s as separate devices. In its usual mode +** of operation, the 875s are slaved to the memory controller +** for all transfers. We can tell if an 875 is part of a +** PQS/PDS or not since if it is, it will be on the same bus +** as the memory controller. To operate with the Linux +** driver, the memory controller is disabled and the 875s +** freed to function independently. The only wrinkle is that +** the preset SCSI ID (which may be zero) must be read in from +** a special configuration space register of the 875 +**=================================================================== +*/ +#define SCSI_NCR_MAX_PQS_BUS 16 +static int pqs_bus[SCSI_NCR_MAX_PQS_BUS] __initdata = { 0 }; + +__initfunc( +static void ncr_detect_pqs_pds(void) +) +{ + short index; + + for(index=0; index < SCSI_NCR_MAX_PQS_BUS; index ++) { + u_char tmp, bus, device_fn; + + if (pcibios_find_device(0x101a, 0x0009, index, &bus, + &device_fn) != PCIBIOS_SUCCESSFUL) { + pqs_bus[index] = -1; + break; + } + printk(KERN_INFO NAME53C8XX ": NCR PQS/PDS memory controller detected on bus %d\n", bus); + pcibios_read_config_byte(bus, device_fn, 0x44, &tmp); + /* bit 1: allow individual 875 configuration */ + tmp |= 0x2; + pcibios_write_config_byte(bus, device_fn, 0x44, tmp); + pcibios_read_config_byte(bus, device_fn, 0x45, &tmp); + /* bit 2: drive individual 875 interrupts to the bus */ + tmp |= 0x4; + pcibios_write_config_byte(bus, device_fn, 0x45, tmp); + + pqs_bus[index] = bus; + } +} +#endif /* SCSI_NCR_PQS_PDS_SUPPORT */ + +/*=================================================================== +** Detect all 53c8xx hosts and then attach them. +** +** If we are using NVRAM, once all hosts are detected, we need to +** check any NVRAM for boot order in case detect and boot order +** differ and attach them using the order in the NVRAM. +** +** If no NVRAM is found or data appears invalid attach boards in +** the the order they are detected. +**=================================================================== +*/ +__initfunc( +int sym53c8xx_detect(Scsi_Host_Template *tpnt) +) +{ + int i, j, chips, hosts, count; + u_char bus, device_fn; + short index; + int attach_count = 0; + ncr_device *devtbl, *devp; +#ifdef SCSI_NCR_NVRAM_SUPPORT + ncr_nvram nvram0, nvram, *nvp; +#endif + + /* + ** PCI is required. + */ +#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,92) + if (!pci_present()) +#else + if (!pcibios_present()) +#endif + return 0; + + /* + ** Initialize driver general stuff. + */ +#ifdef SCSI_NCR_PROC_INFO_SUPPORT + tpnt->proc_dir = &proc_scsi_sym53c8xx; + tpnt->proc_info = sym53c8xx_proc_info; +#endif + +#if defined(SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT) && defined(MODULE) +if (sym53c8xx) + sym53c8xx_setup(sym53c8xx, (int *) 0); +#endif +#ifdef SCSI_NCR_DEBUG_INFO_SUPPORT + ncr_debug = driver_setup.debug; +#endif + + if (initverbose >= 2) + ncr_print_driver_setup(); + + /* + ** Allocate the device table since we donnot want to + ** overflow the kernel stack. + ** 1 x 4K PAGE is enough for more than 40 devices for i386. + */ + devtbl = m_calloc(PAGE_SIZE, "devtbl", MEMO_WARN); + if (!devtbl) + return 0; + + /* + ** Detect all NCR PQS/PDS memory controllers. + */ +#ifdef SCSI_NCR_PQS_PDS_SUPPORT + ncr_detect_pqs_pds(); +#endif + + /* + ** Detect all 53c8xx hosts. + ** Save the first Symbios NVRAM content if any + ** for the boot order. + */ + chips = sizeof(ncr_chip_ids) / sizeof(ncr_chip_ids[0]); + hosts = PAGE_SIZE / sizeof(*devtbl); +#ifdef SCSI_NCR_NVRAM_SUPPORT + nvp = (driver_setup.use_nvram & 0x1) ? &nvram0 : 0; +#endif + j = 0; + index = 0; + count = 0; + while (1) { + char *msg = ""; + if (count >= hosts) + break; + if (j >= chips) + break; + i = driver_setup.reverse_probe ? chips - 1 - j : j; + if (pcibios_find_device(PCI_VENDOR_ID_NCR, ncr_chip_ids[i], + index, &bus, &device_fn)) { + ++j; + index = 0; + continue; + } + ++index; + devp = &devtbl[count]; + devp->host_id = 255; + devp->attach_done = 0; + if (sym53c8xx_pci_init(tpnt, bus, device_fn, devp)) { + continue; + } + ++count; +#ifdef SCSI_NCR_NVRAM_SUPPORT + if (nvp) { + ncr_get_nvram(devp, nvp); + switch(nvp->type) { + case SCSI_NCR_SYMBIOS_NVRAM: + /* + * Switch to the other nvram buffer, so that + * nvram0 will contain the first Symbios + * format NVRAM content with boot order. + */ + nvp = &nvram; + msg = "with Symbios NVRAM"; + break; + case SCSI_NCR_TEKRAM_NVRAM: + msg = "with Tekram NVRAM"; + break; + } + } +#endif +#ifdef SCSI_NCR_PQS_PDS_SUPPORT + if (devp->pqs_pds) + msg = "(NCR PQS/PDS)"; +#endif + printk(KERN_INFO NAME53C8XX ": 53c%s detected %s\n", + devp->chip.name, msg); + } + + /* + ** If we have found a SYMBIOS NVRAM, use first the NVRAM boot + ** sequence as device boot order. + ** check devices in the boot record against devices detected. + ** attach devices if we find a match. boot table records that + ** do not match any detected devices will be ignored. + ** devices that do not match any boot table will not be attached + ** here but will attempt to be attached during the device table + ** rescan. + */ +#ifdef SCSI_NCR_NVRAM_SUPPORT + if (!nvp || nvram0.type != SCSI_NCR_SYMBIOS_NVRAM) + goto next; + for (i = 0; i < 4; i++) { + Symbios_host *h = &nvram0.data.Symbios.host[i]; + for (j = 0 ; j < count ; j++) { + devp = &devtbl[j]; + if (h->device_fn != devp->slot.device_fn || + h->bus_nr != devp->slot.bus || + h->device_id != devp->chip.device_id) + continue; + if (devp->attach_done) + continue; + if (h->flags & SYMBIOS_INIT_SCAN_AT_BOOT) { + ncr_get_nvram(devp, nvp); + if (!ncr_attach (tpnt, attach_count, devp)) + attach_count++; + } + else if (!(driver_setup.use_nvram & 0x80)) + printk(KERN_INFO NAME53C8XX + ": 53c%s state OFF thus not attached\n", + devp->chip.name); + else + continue; + + devp->attach_done = 1; + break; + } + } +next: +#endif + + /* + ** Rescan device list to make sure all boards attached. + ** Devices without boot records will not be attached yet + ** so try to attach them here. + */ + for (i= 0; i < count; i++) { + devp = &devtbl[i]; + if (!devp->attach_done) { +#ifdef SCSI_NCR_NVRAM_SUPPORT + ncr_get_nvram(devp, nvp); +#endif + if (!ncr_attach (tpnt, attach_count, devp)) + attach_count++; + } + } + + m_free(devtbl, PAGE_SIZE, "devtbl"); + + return attach_count; +} + +/*=================================================================== +** Generically read a base address from the PCI configuration space. +** Return the offset immediately after the base address that has +** been read. Btw, we blindly assume that the high 32 bits of 64 bit +** base addresses are set to zero on 32 bit architectures. +**=================================================================== +*/ +#if LINUX_VERSION_CODE <= LinuxVersionCode(2,1,92) +__initfunc( +static int +pci_read_base_address(u_char bus, u_char device_fn, int offset, u_long *base) +) +{ + u_int32 tmp; + + pcibios_read_config_dword(bus, device_fn, offset, &tmp); + *base = tmp; + offset += sizeof(u_int32); + if ((tmp & 0x7) == 0x4) { +#if BITS_PER_LONG > 32 + pcibios_read_config_dword(bus, device_fn, offset, &tmp); + *base |= (((u_long)tmp) << 32); +#endif + offset += sizeof(u_int32); + } + return offset; +} +#else /* LINUX_VERSION_CODE > LinuxVersionCode(2,1,92) */ +__initfunc( +static int +pci_get_base_address(struct pci_dev *pdev, int index, u_long *base) +) +{ + *base = pdev->base_address[index++]; + if ((*base & 0x7) == 0x4) { +#if BITS_PER_LONG > 32 + *base |= (((u_long)pdev->base_address[index]) << 32); +#endif + ++index; + } + return index; +} +#endif + +/*=================================================================== +** Read and check the PCI configuration for any detected NCR +** boards and save data for attaching after all boards have +** been detected. +**=================================================================== +*/ +__initfunc( +static int sym53c8xx_pci_init(Scsi_Host_Template *tpnt, + uchar bus, uchar device_fn, ncr_device *device) +) +{ + u_short vendor_id, device_id, command; + u_char cache_line_size, latency_timer; + u_char suggested_cache_line_size = 0; + u_char revision; +#if LINUX_VERSION_CODE > LinuxVersionCode(2,1,92) + struct pci_dev *pdev; + u_int irq; +#else + u_char irq; +#endif + u_long base, base_2, io_port; + int i; + ncr_chip *chip; + + printk(KERN_INFO NAME53C8XX ": at PCI bus %d, device %d, function %d\n", + bus, (int) (device_fn & 0xf8) >> 3, (int) device_fn & 7); + /* + ** Read info from the PCI config space. + ** pcibios_read_config_xxx() functions are assumed to be used for + ** successfully detected PCI devices. + */ +#if LINUX_VERSION_CODE > LinuxVersionCode(2,1,92) + pdev = pci_find_slot(bus, device_fn); + vendor_id = pdev->vendor; + device_id = pdev->device; + irq = pdev->irq; + i = 0; + i = pci_get_base_address(pdev, i, &io_port); + i = pci_get_base_address(pdev, i, &base); + (void) pci_get_base_address(pdev, i, &base_2); +#else + pcibios_read_config_word(bus, device_fn, PCI_VENDOR_ID, &vendor_id); + pcibios_read_config_word(bus, device_fn, PCI_DEVICE_ID, &device_id); + pcibios_read_config_byte(bus, device_fn, PCI_INTERRUPT_LINE, &irq); + i = PCI_BASE_ADDRESS_0; + i = pci_read_base_address(bus, device_fn, i, &io_port); + i = pci_read_base_address(bus, device_fn, i, &base); + (void) pci_read_base_address(bus, device_fn, i, &base_2); +#endif + pcibios_read_config_word(bus, device_fn, PCI_COMMAND, &command); + pcibios_read_config_byte(bus, device_fn, PCI_CLASS_REVISION, &revision); + pcibios_read_config_byte(bus, device_fn, PCI_CACHE_LINE_SIZE, + &cache_line_size); + pcibios_read_config_byte(bus, device_fn, PCI_LATENCY_TIMER, + &latency_timer); + +#ifdef SCSI_NCR_PQS_PDS_SUPPORT + /* + ** Match the BUS number for PQS/PDS devices. + ** Read the SCSI ID from a special register mapped + ** into the configuration space of the individual + ** 875s. This register is set up by the PQS bios + */ + for(i = 0; i < SCSI_NCR_MAX_PQS_BUS && pqs_bus[i] != -1; i++) { + u_char tmp; + if (pqs_bus[i] == bus) { + pcibios_read_config_byte(bus, device_fn, 0x84, &tmp); + device->pqs_pds = 1; + device->host_id = tmp; + break; + } + } +#endif /* SCSI_NCR_PQS_PDS_SUPPORT */ + + /* + ** If user excludes this chip, donnot initialize it. + */ + for (i = 0 ; i < SCSI_NCR_MAX_EXCLUDES ; i++) { + if (driver_setup.excludes[i] == + (io_port & PCI_BASE_ADDRESS_IO_MASK)) + return -1; + } + /* + ** Check if the chip is supported + */ + chip = 0; + for (i = 0; i < sizeof(ncr_chip_table)/sizeof(ncr_chip_table[0]); i++) { + if (device_id != ncr_chip_table[i].device_id) + continue; + if (revision > ncr_chip_table[i].revision_id) + continue; + if (!(ncr_chip_table[i].features & FE_LDSTR)) + continue; + chip = &device->chip; + memcpy(chip, &ncr_chip_table[i], sizeof(*chip)); + chip->revision_id = revision; + break; + } + +#if defined(__i386__) + /* + ** Ignore Symbios chips controlled by SISL RAID controller. + ** This controller sets value 0x52414944 at RAM end - 16. + */ + if (chip && (base_2 & PCI_BASE_ADDRESS_MEM_MASK)) { + unsigned int ram_size, ram_val; + u_long ram_ptr; + + if (chip->features & FE_RAM8K) + ram_size = 8192; + else + ram_size = 4096; + + ram_ptr = remap_pci_mem(base_2 & PCI_BASE_ADDRESS_MEM_MASK, + ram_size); + if (ram_ptr) { + ram_val = readl_raw(ram_ptr + ram_size - 16); + unmap_pci_mem(ram_ptr, ram_size); + if (ram_val == 0x52414944) { + printk(NAME53C8XX": not initializing, " + "driven by SISL RAID controller.\n"); + return -1; + } + } + } +#endif + + if (!chip) { + printk(NAME53C8XX ": not initializing, device not supported\n"); + return -1; + } + +#ifdef __powerpc__ + /* + ** Fix-up for power/pc. + ** Should not be performed by the driver. + */ + if ((command & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) + != (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { + printk(NAME53C8XX ": setting%s%s...\n", + (command & PCI_COMMAND_IO) ? "" : " PCI_COMMAND_IO", + (command & PCI_COMMAND_MEMORY) ? "" : " PCI_COMMAND_MEMORY"); + command |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY); + pcibios_write_config_word(bus, device_fn, PCI_COMMAND, command); + } + +#if LINUX_VERSION_CODE < LinuxVersionCode(2,2,0) + if ( is_prep ) { + if (io_port >= 0x10000000) { + printk(NAME53C8XX ": reallocating io_port (Wacky IBM)"); + io_port = (io_port & 0x00FFFFFF) | 0x01000000; + pcibios_write_config_dword(bus, device_fn, + PCI_BASE_ADDRESS_0, io_port); + } + if (base >= 0x10000000) { + printk(NAME53C8XX ": reallocating base (Wacky IBM)"); + base = (base & 0x00FFFFFF) | 0x01000000; + pcibios_write_config_dword(bus, device_fn, + PCI_BASE_ADDRESS_1, base); + } + if (base_2 >= 0x10000000) { + printk(NAME53C8XX ": reallocating base2 (Wacky IBM)"); + base_2 = (base_2 & 0x00FFFFFF) | 0x01000000; + pcibios_write_config_dword(bus, device_fn, + PCI_BASE_ADDRESS_2, base_2); + } + } +#endif +#endif /* __powerpc__ */ + +#ifdef __sparc__ + /* + ** Fix-ups for sparc. + ** + ** I wrote: Should not be performed by the driver, + ** Guy wrote: but how can OBP know each and every PCI card, + ** if they don't use Fcode? + ** I replied: no need to know each and every PCI card, just + ** be skilled enough to understand the PCI specs. + */ + + /* + ** PCI configuration is based on configuration registers being + ** coherent with hardware and software resource identifications. + ** This is fairly simple, but seems still too complex for Sparc. + */ + base = __pa(base); + base_2 = __pa(base_2); + + if (!cache_line_size) + suggested_cache_line_size = 16; + +#endif /* __sparc__ */ + +#if defined(__i386__) && !defined(MODULE) + if (!cache_line_size) { +#if LINUX_VERSION_CODE < LinuxVersionCode(2,1,75) + extern char x86; + switch(x86) { +#else + switch(boot_cpu_data.x86) { +#endif + case 4: suggested_cache_line_size = 4; break; + case 6: + case 5: suggested_cache_line_size = 8; break; + } + } +#endif /* __i386__ */ + + /* + ** Check availability of IO space, memory space. + ** Enable master capability if not yet. + */ +#ifdef NCR_IOMAPPED + if (!(command & PCI_COMMAND_IO) || !(io_port & 1)) { + printk(NAME53C8XX ": I/O base address (0x%lx) disabled.\n", + (long) io_port); + io_port = 0; + } +#endif + if (!(command & PCI_COMMAND_MEMORY)) { + printk(NAME53C8XX ": PCI_COMMAND_MEMORY not set.\n"); + base = 0; + base_2 = 0; + } + io_port &= PCI_BASE_ADDRESS_IO_MASK; + base &= PCI_BASE_ADDRESS_MEM_MASK; + base_2 &= PCI_BASE_ADDRESS_MEM_MASK; + +#ifdef NCR_IOMAPPED + if (io_port && check_region (io_port, 128)) { + printk(NAME53C8XX ": IO region 0x%lx[0..127] is in use\n", + (long) io_port); + io_port = 0; + } + if (!io_port) + return -1; +#else + if (!base) { + printk(NAME53C8XX ": MMIO base address disabled.\n"); + return -1; + } +#endif + + /* + ** Set MASTER capable and PARITY bit, if not yet. + */ + if ((command & (PCI_COMMAND_MASTER | PCI_COMMAND_PARITY)) + != (PCI_COMMAND_MASTER | PCI_COMMAND_PARITY)) { + printk(NAME53C8XX ": setting%s%s...(fix-up)\n", + (command & PCI_COMMAND_MASTER) ? "" : " PCI_COMMAND_MASTER", + (command & PCI_COMMAND_PARITY) ? "" : " PCI_COMMAND_PARITY"); + command |= (PCI_COMMAND_MASTER | PCI_COMMAND_PARITY); + pcibios_write_config_word(bus, device_fn, PCI_COMMAND, command); + } + + /* + ** Fix some features according to driver setup. + */ + if (!(driver_setup.special_features & 1)) + chip->features &= ~FE_SPECIAL_SET; + else { + if (driver_setup.special_features & 2) + chip->features &= ~FE_WRIE; + if (driver_setup.special_features & 4) + chip->features &= ~FE_NOPM; + } + if (driver_setup.ultra_scsi < 2 && (chip->features & FE_ULTRA2)) { + chip->features |= FE_ULTRA; + chip->features &= ~FE_ULTRA2; + } + if (driver_setup.ultra_scsi < 1) + chip->features &= ~FE_ULTRA; + if (!driver_setup.max_wide) + chip->features &= ~FE_WIDE; + +#ifdef SCSI_NCR_PCI_FIX_UP_SUPPORT + /* + ** Try to fix up PCI config according to wished features. + */ + if ((driver_setup.pci_fix_up & 1) && (chip->features & FE_CLSE) && + !cache_line_size && suggested_cache_line_size) { + cache_line_size = suggested_cache_line_size; + pcibios_write_config_byte(bus, device_fn, + PCI_CACHE_LINE_SIZE, cache_line_size); + printk(NAME53C8XX ": PCI_CACHE_LINE_SIZE set to %d (fix-up).\n", + cache_line_size); + } + + if ((driver_setup.pci_fix_up & 2) && cache_line_size && + (chip->features & FE_WRIE) && !(command & PCI_COMMAND_INVALIDATE)) { + printk(NAME53C8XX": setting PCI_COMMAND_INVALIDATE (fix-up)\n"); + command |= PCI_COMMAND_INVALIDATE; + pcibios_write_config_word(bus, device_fn, PCI_COMMAND, command); + } + + /* + ** Tune PCI LATENCY TIMER according to burst max length transfer. + ** (latency timer >= burst length + 6, we add 10 to be quite sure) + */ + + if ((driver_setup.pci_fix_up & 4) && chip->burst_max) { + uchar lt = (1 << chip->burst_max) + 6 + 10; + if (latency_timer < lt) { + latency_timer = lt; + printk(NAME53C8XX + ": setting PCI_LATENCY_TIMER to %d (fix-up).\n", + latency_timer); + pcibios_write_config_byte(bus, device_fn, + PCI_LATENCY_TIMER, latency_timer); + } + } + +#endif /* SCSI_NCR_PCI_FIX_UP_SUPPORT */ + + /* + ** Initialise ncr_device structure with items required by ncr_attach. + */ + device->slot.bus = bus; + device->slot.device_fn = device_fn; + device->slot.base = base; + device->slot.base_2 = base_2; + device->slot.io_port = io_port; + device->slot.irq = irq; + device->attach_done = 0; + + return 0; +} + + +/*=================================================================== +** Detect and try to read SYMBIOS and TEKRAM NVRAM. +** +** Data can be used to order booting of boards. +** +** Data is saved in ncr_device structure if NVRAM found. This +** is then used to find drive boot order for ncr_attach(). +** +** NVRAM data is passed to Scsi_Host_Template later during +** ncr_attach() for any device set up. +*=================================================================== +*/ +#ifdef SCSI_NCR_NVRAM_SUPPORT +__initfunc(static void ncr_get_nvram(ncr_device *devp, ncr_nvram *nvp)) +{ + devp->nvram = nvp; + if (!nvp) + return; + /* + ** Get access to chip IO registers + */ +#ifdef NCR_IOMAPPED + request_region(devp->slot.io_port, 128, NAME53C8XX); + devp->slot.base_io = devp->slot.io_port; +#else + devp->slot.reg = (struct ncr_reg *) remap_pci_mem(devp->slot.base, 128); + if (!devp->slot.reg) + return; +#endif + + /* + ** Try to read SYMBIOS nvram. + ** Try to read TEKRAM nvram if Symbios nvram not found. + */ + if (!ncr_get_Symbios_nvram(&devp->slot, &nvp->data.Symbios)) + nvp->type = SCSI_NCR_SYMBIOS_NVRAM; + else if (!ncr_get_Tekram_nvram(&devp->slot, &nvp->data.Tekram)) + nvp->type = SCSI_NCR_TEKRAM_NVRAM; + else { + nvp->type = 0; + devp->nvram = 0; + } + + /* + ** Release access to chip IO registers + */ +#ifdef NCR_IOMAPPED + release_region(devp->slot.base_io, 128); +#else + unmap_pci_mem((u_long) devp->slot.reg, 128ul); +#endif + +} +#endif /* SCSI_NCR_NVRAM_SUPPORT */ + +/* +** Linux select queue depths function +*/ + +#define DEF_DEPTH (driver_setup.default_tags) +#define ALL_TARGETS -2 +#define NO_TARGET -1 +#define ALL_LUNS -2 +#define NO_LUN -1 + +static int device_queue_depth(ncb_p np, int target, int lun) +{ + int c, h, t, u, v; + char *p = driver_setup.tag_ctrl; + char *ep; + + h = -1; + t = NO_TARGET; + u = NO_LUN; + while ((c = *p++) != 0) { + v = simple_strtoul(p, &ep, 0); + switch(c) { + case '/': + ++h; + t = ALL_TARGETS; + u = ALL_LUNS; + break; + case 't': + if (t != target) + t = (target == v) ? v : NO_TARGET; + u = ALL_LUNS; + break; + case 'u': + if (u != lun) + u = (lun == v) ? v : NO_LUN; + break; + case 'q': + if (h == np->unit && + (t == ALL_TARGETS || t == target) && + (u == ALL_LUNS || u == lun)) + return v; + break; + case '-': + t = ALL_TARGETS; + u = ALL_LUNS; + break; + default: + break; + } + p = ep; + } + return DEF_DEPTH; +} + +static void sym53c8xx_select_queue_depths(struct Scsi_Host *host, struct scsi_device *devlist) +{ + struct scsi_device *device; + + for (device = devlist; device; device = device->next) { + ncb_p np; + tcb_p tp; + lcb_p lp; + int numtags; + + if (device->host != host) + continue; + + np = ((struct host_data *) host->hostdata)->ncb; + tp = &np->target[device->id]; + lp = tp->lp[device->lun]; + + /* + ** Select queue depth from driver setup. + ** Donnot use more than configured by user. + ** Use at least 2. + ** Donnot use more than our maximum. + */ + numtags = device_queue_depth(np, device->id, device->lun); + if (numtags > tp->usrtags) + numtags = tp->usrtags; + if (!device->tagged_supported) + numtags = 1; + device->queue_depth = numtags; + if (device->queue_depth < 2) + device->queue_depth = 2; + if (device->queue_depth > SCSI_NCR_MAX_TAGS) + device->queue_depth = SCSI_NCR_MAX_TAGS; + + /* + ** Since the queue depth is not tunable under Linux, + ** we need to know this value in order not to + ** announce stupid things to user. + */ + if (lp) { + lp->numtags = lp->maxtags = numtags; + lp->scdev_depth = device->queue_depth; + } + ncr_setup_tags (np, device->id, device->lun); + +#ifdef DEBUG_SYM53C8XX +printk("sym53c8xx_select_queue_depth: host=%d, id=%d, lun=%d, depth=%d\n", + np->unit, device->id, device->lun, device->queue_depth); +#endif + } +} + +/* +** Linux entry point for info() function +*/ +const char *sym53c8xx_info (struct Scsi_Host *host) +{ + return SCSI_NCR_DRIVER_NAME; +} + +/* +** Linux entry point of queuecommand() function +*/ + +int sym53c8xx_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)) +{ + ncb_p np = ((struct host_data *) cmd->host->hostdata)->ncb; + unsigned long flags; + int sts; + +#ifdef DEBUG_SYM53C8XX +printk("sym53c8xx_queue_command\n"); +#endif + + cmd->scsi_done = done; + cmd->host_scribble = NULL; + cmd->SCp.ptr = NULL; + cmd->SCp.buffer = NULL; + + NCR_LOCK_NCB(np, flags); + + if ((sts = ncr_queue_command(np, cmd)) != DID_OK) { + SetScsiResult(cmd, sts, 0); +#ifdef DEBUG_SYM53C8XX +printk("sym53c8xx : command not queued - result=%d\n", sts); +#endif + } +#ifdef DEBUG_SYM53C8XX + else +printk("sym53c8xx : command successfully queued\n"); +#endif + + NCR_UNLOCK_NCB(np, flags); + + if (sts != DID_OK) + done(cmd); + + return sts; +} + +/* +** Linux entry point of the interrupt handler. +** Since linux versions > 1.3.70, we trust the kernel for +** passing the internal host descriptor as 'dev_id'. +** Otherwise, we scan the host list and call the interrupt +** routine for each host that uses this IRQ. +*/ + +static void sym53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs) +{ + unsigned long flags; + ncb_p np = (ncb_p) dev_id; + Scsi_Cmnd *done_list; + +#ifdef DEBUG_SYM53C8XX + printk("sym53c8xx : interrupt received\n"); +#endif + + if (DEBUG_FLAGS & DEBUG_TINY) printk ("["); + + NCR_LOCK_NCB(np, flags); + ncr_exception(np); + done_list = np->done_list; + np->done_list = 0; + NCR_UNLOCK_NCB(np, flags); + + if (DEBUG_FLAGS & DEBUG_TINY) printk ("]\n"); + + if (done_list) { + NCR_LOCK_SCSI_DONE(np, flags); + ncr_flush_done_cmds(done_list); + NCR_UNLOCK_SCSI_DONE(np, flags); + } +} + +/* +** Linux entry point of the timer handler +*/ + +static void sym53c8xx_timeout(unsigned long npref) +{ + ncb_p np = (ncb_p) npref; + unsigned long flags; + Scsi_Cmnd *done_list; + + NCR_LOCK_NCB(np, flags); + ncr_timeout((ncb_p) np); + done_list = np->done_list; + np->done_list = 0; + NCR_UNLOCK_NCB(np, flags); + + if (done_list) { + NCR_LOCK_SCSI_DONE(np, flags); + ncr_flush_done_cmds(done_list); + NCR_UNLOCK_SCSI_DONE(np, flags); + } +} + +/* +** Linux entry point of reset() function +*/ + +#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS +int sym53c8xx_reset(Scsi_Cmnd *cmd, unsigned int reset_flags) +#else +int sym53c8xx_reset(Scsi_Cmnd *cmd) +#endif +{ + ncb_p np = ((struct host_data *) cmd->host->hostdata)->ncb; + int sts; + unsigned long flags; + Scsi_Cmnd *done_list; + +#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS + printk("sym53c8xx_reset: pid=%lu reset_flags=%x serial_number=%ld serial_number_at_timeout=%ld\n", + cmd->pid, reset_flags, cmd->serial_number, cmd->serial_number_at_timeout); +#else + printk("sym53c8xx_reset: command pid %lu\n", cmd->pid); +#endif + + NCR_LOCK_NCB(np, flags); + + /* + * We have to just ignore reset requests in some situations. + */ +#if defined SCSI_RESET_NOT_RUNNING + if (cmd->serial_number != cmd->serial_number_at_timeout) { + sts = SCSI_RESET_NOT_RUNNING; + goto out; + } +#endif + /* + * If the mid-level driver told us reset is synchronous, it seems + * that we must call the done() callback for the involved command, + * even if this command was not queued to the low-level driver, + * before returning SCSI_RESET_SUCCESS. + */ + +#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS + sts = ncr_reset_bus(np, cmd, + (reset_flags & (SCSI_RESET_SYNCHRONOUS | SCSI_RESET_ASYNCHRONOUS)) == SCSI_RESET_SYNCHRONOUS); +#else + sts = ncr_reset_bus(np, cmd, 0); +#endif + + /* + * Since we always reset the controller, when we return success, + * we add this information to the return code. + */ +#if defined SCSI_RESET_HOST_RESET + if (sts == SCSI_RESET_SUCCESS) + sts |= SCSI_RESET_HOST_RESET; +#endif + +out: + done_list = np->done_list; + np->done_list = 0; + NCR_UNLOCK_NCB(np, flags); + + ncr_flush_done_cmds(done_list); + + return sts; +} + +/* +** Linux entry point of abort() function +*/ + +int sym53c8xx_abort(Scsi_Cmnd *cmd) +{ + ncb_p np = ((struct host_data *) cmd->host->hostdata)->ncb; + int sts; + unsigned long flags; + Scsi_Cmnd *done_list; + +#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS + printk("sym53c8xx_abort: pid=%lu serial_number=%ld serial_number_at_timeout=%ld\n", + cmd->pid, cmd->serial_number, cmd->serial_number_at_timeout); +#else + printk("sym53c8xx_abort: command pid %lu\n", cmd->pid); +#endif + + NCR_LOCK_NCB(np, flags); + +#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS + /* + * We have to just ignore abort requests in some situations. + */ + if (cmd->serial_number != cmd->serial_number_at_timeout) { + sts = SCSI_ABORT_NOT_RUNNING; + goto out; + } +#endif + + sts = ncr_abort_command(np, cmd); +out: + done_list = np->done_list; + np->done_list = 0; + NCR_UNLOCK_NCB(np, flags); + + ncr_flush_done_cmds(done_list); + + return sts; +} + + +#ifdef MODULE +int sym53c8xx_release(struct Scsi_Host *host) +{ +#ifdef DEBUG_SYM53C8XX +printk("sym53c8xx : release\n"); +#endif + ncr_detach(((struct host_data *) host->hostdata)->ncb); + + return 1; +} +#endif + + +/* +** Scsi command waiting list management. +** +** It may happen that we cannot insert a scsi command into the start queue, +** in the following circumstances. +** Too few preallocated ccb(s), +** maxtags < cmd_per_lun of the Linux host control block, +** etc... +** Such scsi commands are inserted into a waiting list. +** When a scsi command complete, we try to requeue the commands of the +** waiting list. +*/ + +#define next_wcmd host_scribble + +static void insert_into_waiting_list(ncb_p np, Scsi_Cmnd *cmd) +{ + Scsi_Cmnd *wcmd; + +#ifdef DEBUG_WAITING_LIST + printk("%s: cmd %lx inserted into waiting list\n", ncr_name(np), (u_long) cmd); +#endif + cmd->next_wcmd = 0; + if (!(wcmd = np->waiting_list)) np->waiting_list = cmd; + else { + while ((wcmd->next_wcmd) != 0) + wcmd = (Scsi_Cmnd *) wcmd->next_wcmd; + wcmd->next_wcmd = (char *) cmd; + } +} + +static Scsi_Cmnd *retrieve_from_waiting_list(int to_remove, ncb_p np, Scsi_Cmnd *cmd) +{ + Scsi_Cmnd **pcmd = &np->waiting_list; + + while (*pcmd) { + if (cmd == *pcmd) { + if (to_remove) { + *pcmd = (Scsi_Cmnd *) cmd->next_wcmd; + cmd->next_wcmd = 0; + } +#ifdef DEBUG_WAITING_LIST + printk("%s: cmd %lx retrieved from waiting list\n", ncr_name(np), (u_long) cmd); +#endif + return cmd; + } + pcmd = (Scsi_Cmnd **) &(*pcmd)->next_wcmd; + } + return 0; +} + +static void process_waiting_list(ncb_p np, int sts) +{ + Scsi_Cmnd *waiting_list, *wcmd; + + waiting_list = np->waiting_list; + np->waiting_list = 0; + +#ifdef DEBUG_WAITING_LIST + if (waiting_list) printk("%s: waiting_list=%lx processing sts=%d\n", ncr_name(np), (u_long) waiting_list, sts); +#endif + while ((wcmd = waiting_list) != 0) { + waiting_list = (Scsi_Cmnd *) wcmd->next_wcmd; + wcmd->next_wcmd = 0; + if (sts == DID_OK) { +#ifdef DEBUG_WAITING_LIST + printk("%s: cmd %lx trying to requeue\n", ncr_name(np), (u_long) wcmd); +#endif + sts = ncr_queue_command(np, wcmd); + } + if (sts != DID_OK) { +#ifdef DEBUG_WAITING_LIST + printk("%s: cmd %lx done forced sts=%d\n", ncr_name(np), (u_long) wcmd, sts); +#endif + SetScsiResult(wcmd, sts, 0); + ncr_queue_done_cmd(np, wcmd); + } + } +} + +#undef next_wcmd + +#ifdef SCSI_NCR_PROC_INFO_SUPPORT + +/*========================================================================= +** Proc file system stuff +** +** A read operation returns profile information. +** A write operation is a control command. +** The string is parsed in the driver code and the command is passed +** to the ncr_usercmd() function. +**========================================================================= +*/ + +#ifdef SCSI_NCR_USER_COMMAND_SUPPORT + +#define is_digit(c) ((c) >= '0' && (c) <= '9') +#define digit_to_bin(c) ((c) - '0') +#define is_space(c) ((c) == ' ' || (c) == '\t') + +static int skip_spaces(char *ptr, int len) +{ + int cnt, c; + + for (cnt = len; cnt > 0 && (c = *ptr++) && is_space(c); cnt--); + + return (len - cnt); +} + +static int get_int_arg(char *ptr, int len, u_long *pv) +{ + int cnt, c; + u_long v; + + for (v = 0, cnt = len; cnt > 0 && (c = *ptr++) && is_digit(c); cnt--) { + v = (v * 10) + digit_to_bin(c); + } + + if (pv) + *pv = v; + + return (len - cnt); +} + +static int is_keyword(char *ptr, int len, char *verb) +{ + int verb_len = strlen(verb); + + if (len >= strlen(verb) && !memcmp(verb, ptr, verb_len)) + return verb_len; + else + return 0; + +} + +#define SKIP_SPACES(min_spaces) \ + if ((arg_len = skip_spaces(ptr, len)) < (min_spaces)) \ + return -EINVAL; \ + ptr += arg_len; len -= arg_len; + +#define GET_INT_ARG(v) \ + if (!(arg_len = get_int_arg(ptr, len, &(v)))) \ + return -EINVAL; \ + ptr += arg_len; len -= arg_len; + + +/* +** Parse a control command +*/ + +static int ncr_user_command(ncb_p np, char *buffer, int length) +{ + char *ptr = buffer; + int len = length; + struct usrcmd *uc = &np->user; + int arg_len; + u_long target; + + bzero(uc, sizeof(*uc)); + + if (len > 0 && ptr[len-1] == '\n') + --len; + + if ((arg_len = is_keyword(ptr, len, "setsync")) != 0) + uc->cmd = UC_SETSYNC; + else if ((arg_len = is_keyword(ptr, len, "settags")) != 0) + uc->cmd = UC_SETTAGS; + else if ((arg_len = is_keyword(ptr, len, "setorder")) != 0) + uc->cmd = UC_SETORDER; + else if ((arg_len = is_keyword(ptr, len, "setverbose")) != 0) + uc->cmd = UC_SETVERBOSE; + else if ((arg_len = is_keyword(ptr, len, "setwide")) != 0) + uc->cmd = UC_SETWIDE; + else if ((arg_len = is_keyword(ptr, len, "setdebug")) != 0) + uc->cmd = UC_SETDEBUG; + else if ((arg_len = is_keyword(ptr, len, "setflag")) != 0) + uc->cmd = UC_SETFLAG; + else if ((arg_len = is_keyword(ptr, len, "clearprof")) != 0) + uc->cmd = UC_CLEARPROF; + else + arg_len = 0; + +#ifdef DEBUG_PROC_INFO +printk("ncr_user_command: arg_len=%d, cmd=%ld\n", arg_len, uc->cmd); +#endif + + if (!arg_len) + return -EINVAL; + ptr += arg_len; len -= arg_len; + + switch(uc->cmd) { + case UC_SETSYNC: + case UC_SETTAGS: + case UC_SETWIDE: + case UC_SETFLAG: + SKIP_SPACES(1); + if ((arg_len = is_keyword(ptr, len, "all")) != 0) { + ptr += arg_len; len -= arg_len; + uc->target = ~0; + } else { + GET_INT_ARG(target); + uc->target = (1<cmd) { + case UC_SETVERBOSE: + case UC_SETSYNC: + case UC_SETTAGS: + case UC_SETWIDE: + SKIP_SPACES(1); + GET_INT_ARG(uc->data); +#ifdef DEBUG_PROC_INFO +printk("ncr_user_command: data=%ld\n", uc->data); +#endif + break; + case UC_SETORDER: + SKIP_SPACES(1); + if ((arg_len = is_keyword(ptr, len, "simple"))) + uc->data = M_SIMPLE_TAG; + else if ((arg_len = is_keyword(ptr, len, "ordered"))) + uc->data = M_ORDERED_TAG; + else if ((arg_len = is_keyword(ptr, len, "default"))) + uc->data = 0; + else + return -EINVAL; + break; + case UC_SETDEBUG: + while (len > 0) { + SKIP_SPACES(1); + if ((arg_len = is_keyword(ptr, len, "alloc"))) + uc->data |= DEBUG_ALLOC; + else if ((arg_len = is_keyword(ptr, len, "phase"))) + uc->data |= DEBUG_PHASE; + else if ((arg_len = is_keyword(ptr, len, "poll"))) + uc->data |= DEBUG_POLL; + else if ((arg_len = is_keyword(ptr, len, "queue"))) + uc->data |= DEBUG_QUEUE; + else if ((arg_len = is_keyword(ptr, len, "result"))) + uc->data |= DEBUG_RESULT; + else if ((arg_len = is_keyword(ptr, len, "scatter"))) + uc->data |= DEBUG_SCATTER; + else if ((arg_len = is_keyword(ptr, len, "script"))) + uc->data |= DEBUG_SCRIPT; + else if ((arg_len = is_keyword(ptr, len, "tiny"))) + uc->data |= DEBUG_TINY; + else if ((arg_len = is_keyword(ptr, len, "timing"))) + uc->data |= DEBUG_TIMING; + else if ((arg_len = is_keyword(ptr, len, "nego"))) + uc->data |= DEBUG_NEGO; + else if ((arg_len = is_keyword(ptr, len, "tags"))) + uc->data |= DEBUG_TAGS; + else if ((arg_len = is_keyword(ptr, len, "freeze"))) + uc->data |= DEBUG_FREEZE; + else if ((arg_len = is_keyword(ptr, len, "restart"))) + uc->data |= DEBUG_RESTART; + else + return -EINVAL; + ptr += arg_len; len -= arg_len; + } +#ifdef DEBUG_PROC_INFO +printk("ncr_user_command: data=%ld\n", uc->data); +#endif + break; + case UC_SETFLAG: + while (len > 0) { + SKIP_SPACES(1); + if ((arg_len = is_keyword(ptr, len, "trace"))) + uc->data |= UF_TRACE; + else if ((arg_len = is_keyword(ptr, len, "no_disc"))) + uc->data |= UF_NODISC; + else + return -EINVAL; + ptr += arg_len; len -= arg_len; + } + break; + default: + break; + } + + if (len) + return -EINVAL; + else { + long flags; + + NCR_LOCK_NCB(np, flags); + ncr_usercmd (np); + NCR_UNLOCK_NCB(np, flags); + } + return length; +} + +#endif /* SCSI_NCR_USER_COMMAND_SUPPORT */ + +#ifdef SCSI_NCR_USER_INFO_SUPPORT + +struct info_str +{ + char *buffer; + int length; + int offset; + int pos; +}; + +static void copy_mem_info(struct info_str *info, char *data, int len) +{ + if (info->pos + len > info->length) + len = info->length - info->pos; + + if (info->pos + len < info->offset) { + info->pos += len; + return; + } + if (info->pos < info->offset) { + data += (info->offset - info->pos); + len -= (info->offset - info->pos); + } + + if (len > 0) { + memcpy(info->buffer + info->pos, data, len); + info->pos += len; + } +} + +static int copy_info(struct info_str *info, char *fmt, ...) +{ + va_list args; + char buf[81]; + int len; + + va_start(args, fmt); + len = vsprintf(buf, fmt, args); + va_end(args); + + copy_mem_info(info, buf, len); + return len; +} + +/* +** Copy formatted profile information into the input buffer. +*/ + +#define to_ms(t) ((t) * 1000 / HZ) + +static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len) +{ + struct info_str info; + + info.buffer = ptr; + info.length = len; + info.offset = offset; + info.pos = 0; + + copy_info(&info, "General information:\n"); + copy_info(&info, " Chip " NAME53C "%s, ", np->chip_name); + copy_info(&info, "device id 0x%x, ", np->device_id); + copy_info(&info, "revision id 0x%x\n", np->revision_id); + + copy_info(&info, " IO port address 0x%lx, ", (u_long) np->base_io); + copy_info(&info, "IRQ number %d\n", (int) np->irq); + +#ifndef NCR_IOMAPPED + if (np->reg) + copy_info(&info, " Using memory mapped IO at virtual address 0x%lx\n", + (u_long) np->reg); +#endif + copy_info(&info, " Synchronous period factor %d, ", (int) np->minsync); + copy_info(&info, "max commands per lun %d\n", SCSI_NCR_MAX_TAGS); + + if (driver_setup.debug || driver_setup.verbose > 1) { + copy_info(&info, " Debug flags 0x%x, ", driver_setup.debug); + copy_info(&info, "verbosity level %d\n", driver_setup.verbose); + } + +#ifdef SCSI_NCR_PROFILE_SUPPORT + copy_info(&info, "Profiling information:\n"); + copy_info(&info, " %-12s = %lu\n", "num_fly", np->profile.num_fly); + copy_info(&info, " %-12s = %lu\n", "num_trans",np->profile.num_trans); + copy_info(&info, " %-12s = %lu\n", "num_disc", np->profile.num_disc); + copy_info(&info, " %-12s = %lu\n", "num_disc0",np->profile.num_disc0); + copy_info(&info, " %-12s = %lu\n", "num_break",np->profile.num_break); +#if 000 + copy_info(&info, " %-12s = %lu\n", "num_br1k",np->profile.num_br1k); + copy_info(&info, " %-12s = %lu\n", "num_br2k",np->profile.num_br2k); + copy_info(&info, " %-12s = %lu\n", "num_br4k",np->profile.num_br4k); + copy_info(&info, " %-12s = %lu\n", "num_br8k",np->profile.num_br8k); + copy_info(&info, " %-12s = %lu\n", "num_brnk",np->profile.num_brnk); +#endif + copy_info(&info, " %-12s = %lu\n", "num_int", np->profile.num_int); + copy_info(&info, " %-12s = %lu\n","num_kbytes",np->profile.num_kbytes); +#endif + + return info.pos > info.offset? info.pos - info.offset : 0; +} + +#endif /* SCSI_NCR_USER_INFO_SUPPORT */ + +/* +** Entry point of the scsi proc fs of the driver. +** - func = 0 means read (returns profile data) +** - func = 1 means write (parse user control command) +*/ + +static int sym53c8xx_proc_info(char *buffer, char **start, off_t offset, + int length, int hostno, int func) +{ + struct Scsi_Host *host; + struct host_data *host_data; + ncb_p ncb = 0; + int retv; + +#ifdef DEBUG_PROC_INFO +printk("sym53c8xx_proc_info: hostno=%d, func=%d\n", hostno, func); +#endif + + for (host = first_host; host; host = host->next) { + if (host->hostt != first_host->hostt) + continue; + if (host->host_no == hostno) { + host_data = (struct host_data *) host->hostdata; + ncb = host_data->ncb; + break; + } + } + + if (!ncb) + return -EINVAL; + + if (func) { +#ifdef SCSI_NCR_USER_COMMAND_SUPPORT + retv = ncr_user_command(ncb, buffer, length); +#else + retv = -EINVAL; +#endif + } + else { + if (start) + *start = buffer; +#ifdef SCSI_NCR_USER_INFO_SUPPORT + retv = ncr_host_info(ncb, buffer, offset, length); +#else + retv = -EINVAL; +#endif + } + + return retv; +} + + +/*========================================================================= +** End of proc file system stuff +**========================================================================= +*/ +#endif + + +#ifdef SCSI_NCR_NVRAM_SUPPORT + +/* --------------------------------------------------------------------- +** +** Try reading Symbios format nvram +** +** --------------------------------------------------------------------- +** +** GPOI0 - data in/data out +** GPIO1 - clock +** +** return 0 if NVRAM data OK, 1 if NVRAM data not OK +** --------------------------------------------------------------------- +*/ + +#define SET_BIT 0 +#define CLR_BIT 1 +#define SET_CLK 2 +#define CLR_CLK 3 + +static u_short nvram_read_data(ncr_slot *np, u_char *data, int len, u_char *gpreg, u_char *gpcntl); +static void nvram_start(ncr_slot *np, u_char *gpreg); +static void nvram_write_byte(ncr_slot *np, u_char *ack_data, u_char write_data, u_char *gpreg, u_char *gpcntl); +static void nvram_read_byte(ncr_slot *np, u_char *read_data, u_char ack_data, u_char *gpreg, u_char *gpcntl); +static void nvram_readAck(ncr_slot *np, u_char *read_bit, u_char *gpreg, u_char *gpcntl); +static void nvram_writeAck(ncr_slot *np, u_char write_bit, u_char *gpreg, u_char *gpcntl); +static void nvram_doBit(ncr_slot *np, u_char *read_bit, u_char write_bit, u_char *gpreg); +static void nvram_stop(ncr_slot *np, u_char *gpreg); +static void nvram_setBit(ncr_slot *np, u_char write_bit, u_char *gpreg, int bit_mode); + +__initfunc( +static int ncr_get_Symbios_nvram (ncr_slot *np, Symbios_nvram *nvram) +) +{ + static u_char Symbios_trailer[6] = {0xfe, 0xfe, 0, 0, 0, 0}; + u_char gpcntl, gpreg; + u_char old_gpcntl, old_gpreg; + u_short csum; + u_char ack_data; + int retv = 1; + + /* save current state of GPCNTL and GPREG */ + old_gpreg = INB (nc_gpreg); + old_gpcntl = INB (nc_gpcntl); + gpcntl = old_gpcntl & 0xfc; + + /* set up GPREG & GPCNTL to set GPIO0 and GPIO1 in to known state */ + OUTB (nc_gpreg, old_gpreg); + OUTB (nc_gpcntl, gpcntl); + + /* this is to set NVRAM into a known state with GPIO0/1 both low */ + gpreg = old_gpreg; + nvram_setBit(np, 0, &gpreg, CLR_CLK); + nvram_setBit(np, 0, &gpreg, CLR_BIT); + + /* now set NVRAM inactive with GPIO0/1 both high */ + nvram_stop(np, &gpreg); + + /* activate NVRAM */ + nvram_start(np, &gpreg); + + /* write device code and random address MSB */ + nvram_write_byte(np, &ack_data, + 0xa0 | ((SYMBIOS_NVRAM_ADDRESS >> 7) & 0x0e), &gpreg, &gpcntl); + if (ack_data & 0x01) + goto out; + + /* write random address LSB */ + nvram_write_byte(np, &ack_data, + (SYMBIOS_NVRAM_ADDRESS & 0x7f) << 1, &gpreg, &gpcntl); + if (ack_data & 0x01) + goto out; + + /* regenerate START state to set up for reading */ + nvram_start(np, &gpreg); + + /* rewrite device code and address MSB with read bit set (lsb = 0x01) */ + nvram_write_byte(np, &ack_data, + 0xa1 | ((SYMBIOS_NVRAM_ADDRESS >> 7) & 0x0e), &gpreg, &gpcntl); + if (ack_data & 0x01) + goto out; + + /* now set up GPIO0 for inputting data */ + gpcntl |= 0x01; + OUTB (nc_gpcntl, gpcntl); + + /* input all active data - only part of total NVRAM */ + csum = nvram_read_data(np, + (u_char *) nvram, sizeof(*nvram), &gpreg, &gpcntl); + + /* finally put NVRAM back in inactive mode */ + gpcntl &= 0xfe; + OUTB (nc_gpcntl, gpcntl); + nvram_stop(np, &gpreg); + +#ifdef SCSI_NCR_DEBUG_NVRAM +printk("sym53c8xx: NvRAM marker=%x trailer=%x %x %x %x %x %x byte_count=%d/%d checksum=%x/%x\n", + nvram->start_marker, + nvram->trailer[0], nvram->trailer[1], nvram->trailer[2], + nvram->trailer[3], nvram->trailer[4], nvram->trailer[5], + nvram->byte_count, sizeof(*nvram) - 12, + nvram->checksum, csum); +#endif + + /* check valid NVRAM signature, verify byte count and checksum */ + if (nvram->type == 0 && + !memcmp(nvram->trailer, Symbios_trailer, 6) && + nvram->byte_count == sizeof(*nvram) - 12 && + csum == nvram->checksum) + retv = 0; +out: + /* return GPIO0/1 to original states after having accessed NVRAM */ + OUTB (nc_gpcntl, old_gpcntl); + OUTB (nc_gpreg, old_gpreg); + + return retv; +} + +/* + * Read Symbios NvRAM data and compute checksum. + */ +__initfunc( +static u_short nvram_read_data(ncr_slot *np, u_char *data, int len, u_char *gpreg, u_char *gpcntl) +) +{ + int x; + u_short csum; + + for (x = 0; x < len; x++) + nvram_read_byte(np, &data[x], (x == (len - 1)), gpreg, gpcntl); + + for (x = 6, csum = 0; x < len - 6; x++) + csum += data[x]; + + return csum; +} + +/* + * Send START condition to NVRAM to wake it up. + */ +__initfunc( +static void nvram_start(ncr_slot *np, u_char *gpreg) +) +{ + nvram_setBit(np, 1, gpreg, SET_BIT); + nvram_setBit(np, 0, gpreg, SET_CLK); + nvram_setBit(np, 0, gpreg, CLR_BIT); + nvram_setBit(np, 0, gpreg, CLR_CLK); +} + +/* + * WRITE a byte to the NVRAM and then get an ACK to see it was accepted OK, + * GPIO0 must already be set as an output + */ +__initfunc( +static void nvram_write_byte(ncr_slot *np, u_char *ack_data, u_char write_data, u_char *gpreg, u_char *gpcntl) +) +{ + int x; + + for (x = 0; x < 8; x++) + nvram_doBit(np, 0, (write_data >> (7 - x)) & 0x01, gpreg); + + nvram_readAck(np, ack_data, gpreg, gpcntl); +} + +/* + * READ a byte from the NVRAM and then send an ACK to say we have got it, + * GPIO0 must already be set as an input + */ +__initfunc( +static void nvram_read_byte(ncr_slot *np, u_char *read_data, u_char ack_data, u_char *gpreg, u_char *gpcntl) +) +{ + int x; + u_char read_bit; + + *read_data = 0; + for (x = 0; x < 8; x++) { + nvram_doBit(np, &read_bit, 1, gpreg); + *read_data |= ((read_bit & 0x01) << (7 - x)); + } + + nvram_writeAck(np, ack_data, gpreg, gpcntl); +} + +/* + * Output an ACK to the NVRAM after reading, + * change GPIO0 to output and when done back to an input + */ +__initfunc( +static void nvram_writeAck(ncr_slot *np, u_char write_bit, u_char *gpreg, u_char *gpcntl) +) +{ + OUTB (nc_gpcntl, *gpcntl & 0xfe); + nvram_doBit(np, 0, write_bit, gpreg); + OUTB (nc_gpcntl, *gpcntl); +} + +/* + * Input an ACK from NVRAM after writing, + * change GPIO0 to input and when done back to an output + */ +__initfunc( +static void nvram_readAck(ncr_slot *np, u_char *read_bit, u_char *gpreg, u_char *gpcntl) +) +{ + OUTB (nc_gpcntl, *gpcntl | 0x01); + nvram_doBit(np, read_bit, 1, gpreg); + OUTB (nc_gpcntl, *gpcntl); +} + +/* + * Read or write a bit to the NVRAM, + * read if GPIO0 input else write if GPIO0 output + */ +__initfunc( +static void nvram_doBit(ncr_slot *np, u_char *read_bit, u_char write_bit, u_char *gpreg) +) +{ + nvram_setBit(np, write_bit, gpreg, SET_BIT); + nvram_setBit(np, 0, gpreg, SET_CLK); + if (read_bit) + *read_bit = INB (nc_gpreg); + nvram_setBit(np, 0, gpreg, CLR_CLK); + nvram_setBit(np, 0, gpreg, CLR_BIT); +} + +/* + * Send STOP condition to NVRAM - puts NVRAM to sleep... ZZzzzz!! + */ +__initfunc( +static void nvram_stop(ncr_slot *np, u_char *gpreg) +) +{ + nvram_setBit(np, 0, gpreg, SET_CLK); + nvram_setBit(np, 1, gpreg, SET_BIT); +} + +/* + * Set/clear data/clock bit in GPIO0 + */ +__initfunc( +static void nvram_setBit(ncr_slot *np, u_char write_bit, u_char *gpreg, int bit_mode) +) +{ + UDELAY (5); + switch (bit_mode){ + case SET_BIT: + *gpreg |= write_bit; + break; + case CLR_BIT: + *gpreg &= 0xfe; + break; + case SET_CLK: + *gpreg |= 0x02; + break; + case CLR_CLK: + *gpreg &= 0xfd; + break; + + } + OUTB (nc_gpreg, *gpreg); + UDELAY (5); +} + +#undef SET_BIT 0 +#undef CLR_BIT 1 +#undef SET_CLK 2 +#undef CLR_CLK 3 + + +/* --------------------------------------------------------------------- +** +** Try reading Tekram format nvram +** +** --------------------------------------------------------------------- +** +** GPOI0 - data in +** GPIO1 - data out +** GPIO2 - clock +** GPIO4 - chip select +** +** return 0 if NVRAM data OK, 1 if NVRAM data not OK +** --------------------------------------------------------------------- +*/ + +static u_short Tnvram_read_data(ncr_slot *np, u_short *data, int len, u_char *gpreg); +static void Tnvram_Send_Command(ncr_slot *np, u_short write_data, u_char *read_bit, u_char *gpreg); +static void Tnvram_Read_Word(ncr_slot *np, u_short *nvram_data, u_char *gpreg); +static void Tnvram_Read_Bit(ncr_slot *np, u_char *read_bit, u_char *gpreg); +static void Tnvram_Write_Bit(ncr_slot *np, u_char write_bit, u_char *gpreg); +static void Tnvram_Stop(ncr_slot *np, u_char *gpreg); +static void Tnvram_Clk(ncr_slot *np, u_char *gpreg); + +__initfunc( +static int ncr_get_Tekram_nvram (ncr_slot *np, Tekram_nvram *nvram) +) +{ + u_char gpcntl, gpreg; + u_char old_gpcntl, old_gpreg; + u_short csum; + + /* save current state of GPCNTL and GPREG */ + old_gpreg = INB (nc_gpreg); + old_gpcntl = INB (nc_gpcntl); + + /* set up GPREG & GPCNTL to set GPIO0/1/2/4 in to known state, 0 in, + 1/2/4 out */ + gpreg = old_gpreg & 0xe9; + OUTB (nc_gpreg, gpreg); + gpcntl = (old_gpcntl & 0xe9) | 0x09; + OUTB (nc_gpcntl, gpcntl); + + /* input all of NVRAM, 64 words */ + csum = Tnvram_read_data(np, (u_short *) nvram, + sizeof(*nvram) / sizeof(short), &gpreg); + + /* return GPIO0/1/2/4 to original states after having accessed NVRAM */ + OUTB (nc_gpcntl, old_gpcntl); + OUTB (nc_gpreg, old_gpreg); + + /* check data valid */ + if (csum != 0x1234) + return 1; + + return 0; +} + +/* + * Read Tekram NvRAM data and compute checksum. + */ +__initfunc( +static u_short Tnvram_read_data(ncr_slot *np, u_short *data, int len, u_char *gpreg) +) +{ + u_char read_bit; + u_short csum; + int x; + + for (x = 0, csum = 0; x < len; x++) { + + /* output read command and address */ + Tnvram_Send_Command(np, 0x180 | x, &read_bit, gpreg); + if (read_bit & 0x01) + return 0; /* Force bad checksum */ + + Tnvram_Read_Word(np, &data[x], gpreg); + csum += data[x]; + + Tnvram_Stop(np, gpreg); + } + + return csum; +} + +/* + * Send read command and address to NVRAM + */ +__initfunc( +static void Tnvram_Send_Command(ncr_slot *np, u_short write_data, u_char *read_bit, u_char *gpreg) +) +{ + int x; + + /* send 9 bits, start bit (1), command (2), address (6) */ + for (x = 0; x < 9; x++) + Tnvram_Write_Bit(np, (u_char) (write_data >> (8 - x)), gpreg); + + *read_bit = INB (nc_gpreg); +} + +/* + * READ a byte from the NVRAM + */ +__initfunc( +static void Tnvram_Read_Word(ncr_slot *np, u_short *nvram_data, u_char *gpreg) +) +{ + int x; + u_char read_bit; + + *nvram_data = 0; + for (x = 0; x < 16; x++) { + Tnvram_Read_Bit(np, &read_bit, gpreg); + + if (read_bit & 0x01) + *nvram_data |= (0x01 << (15 - x)); + else + *nvram_data &= ~(0x01 << (15 - x)); + } +} + +/* + * Read bit from NVRAM + */ +__initfunc( +static void Tnvram_Read_Bit(ncr_slot *np, u_char *read_bit, u_char *gpreg) +) +{ + UDELAY (2); + Tnvram_Clk(np, gpreg); + *read_bit = INB (nc_gpreg); +} + +/* + * Write bit to GPIO0 + */ +__initfunc( +static void Tnvram_Write_Bit(ncr_slot *np, u_char write_bit, u_char *gpreg) +) +{ + if (write_bit & 0x01) + *gpreg |= 0x02; + else + *gpreg &= 0xfd; + + *gpreg |= 0x10; + + OUTB (nc_gpreg, *gpreg); + UDELAY (2); + + Tnvram_Clk(np, gpreg); +} + +/* + * Send STOP condition to NVRAM - puts NVRAM to sleep... ZZZzzz!! + */ +__initfunc( +static void Tnvram_Stop(ncr_slot *np, u_char *gpreg) +) +{ + *gpreg &= 0xef; + OUTB (nc_gpreg, *gpreg); + UDELAY (2); + + Tnvram_Clk(np, gpreg); +} + +/* + * Pulse clock bit in GPIO0 + */ +__initfunc( +static void Tnvram_Clk(ncr_slot *np, u_char *gpreg) +) +{ + OUTB (nc_gpreg, *gpreg | 0x04); + UDELAY (2); + OUTB (nc_gpreg, *gpreg); +} + +#endif /* SCSI_NCR_NVRAM_SUPPORT */ + +/* +** Module stuff +*/ + +#ifdef MODULE +Scsi_Host_Template driver_template = SYM53C8XX; +#include "scsi_module.c" +#endif diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/sym53c8xx.h linux/drivers/scsi/sym53c8xx.h --- v2.2.5/linux/drivers/scsi/sym53c8xx.h Wed Dec 31 16:00:00 1969 +++ linux/drivers/scsi/sym53c8xx.h Fri Apr 16 14:28:54 1999 @@ -0,0 +1,116 @@ +/****************************************************************************** +** High Performance device driver for the Symbios 53C896 controller. +** +** Copyright (C) 1998 Gerard Roudier +** +** This driver also supports all the Symbios 53C8XX controller family, +** except 53C810 revisions < 16, 53C825 revisions < 16 and all +** revisions of 53C815 controllers. +** +** This driver is based on the Linux port of the FreeBSD ncr driver. +** +** Copyright (C) 1994 Wolfgang Stanglmeier +** +**----------------------------------------------------------------------------- +** +** 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., 675 Mass Ave, Cambridge, MA 02139, USA. +** +**----------------------------------------------------------------------------- +** +** The Linux port of the FreeBSD ncr driver has been achieved in +** november 1995 by: +** +** Gerard Roudier +** +** Being given that this driver originates from the FreeBSD version, and +** in order to keep synergy on both, any suggested enhancements and corrections +** received on Linux are automatically a potential candidate for the FreeBSD +** version. +** +** The original driver has been written for 386bsd and FreeBSD by +** Wolfgang Stanglmeier +** Stefan Esser +** +**----------------------------------------------------------------------------- +** +** Major contributions: +** -------------------- +** +** NVRAM detection and reading. +** Copyright (C) 1997 Richard Waltham +** +******************************************************************************* +*/ + +#ifndef SYM53C8XX_H +#define SYM53C8XX_H + +#include "sym53c8xx_defs.h" + +/* +** Define Scsi_Host_Template parameters +** +** Used by hosts.c and sym53c8xx.c with module configuration. +*/ + +#if defined(HOSTS_C) || defined(MODULE) + +#include + +int sym53c8xx_abort(Scsi_Cmnd *); +int sym53c8xx_detect(Scsi_Host_Template *tpnt); +const char *sym53c8xx_info(struct Scsi_Host *host); +int sym53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); +int sym53c8xx_reset(Scsi_Cmnd *, unsigned int); + +#ifdef MODULE +int sym53c8xx_release(struct Scsi_Host *); +#else +#define sym53c8xx_release NULL +#endif + + +#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,75) + +#define SYM53C8XX { name: "", \ + detect: sym53c8xx_detect, \ + release: sym53c8xx_release, \ + info: sym53c8xx_info, \ + queuecommand: sym53c8xx_queue_command,\ + abort: sym53c8xx_abort, \ + reset: sym53c8xx_reset, \ + bios_param: scsicam_bios_param, \ + can_queue: SCSI_NCR_CAN_QUEUE, \ + this_id: 7, \ + sg_tablesize: SCSI_NCR_SG_TABLESIZE, \ + cmd_per_lun: SCSI_NCR_CMD_PER_LUN, \ + use_clustering: DISABLE_CLUSTERING} + +#else + +#define SYM53C8XX { NULL, NULL, NULL, NULL, \ + NULL, sym53c8xx_detect, \ + sym53c8xx_release, sym53c8xx_info, NULL, \ + sym53c8xx_queue_command,sym53c8xx_abort, \ + sym53c8xx_reset, NULL, scsicam_bios_param, \ + SCSI_NCR_CAN_QUEUE, 7, \ + SCSI_NCR_SG_TABLESIZE, SCSI_NCR_CMD_PER_LUN, \ + 0, 0, DISABLE_CLUSTERING} + +#endif /* LINUX_VERSION_CODE */ + +#endif /* defined(HOSTS_C) || defined(MODULE) */ + +#endif /* SYM53C8XX_H */ diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/sym53c8xx_defs.h linux/drivers/scsi/sym53c8xx_defs.h --- v2.2.5/linux/drivers/scsi/sym53c8xx_defs.h Wed Dec 31 16:00:00 1969 +++ linux/drivers/scsi/sym53c8xx_defs.h Fri Apr 16 14:28:48 1999 @@ -0,0 +1,1195 @@ +/****************************************************************************** +** High Performance device driver for the Symbios 53C896 controller. +** +** Copyright (C) 1998 Gerard Roudier +** +** This driver also supports all the Symbios 53C8XX controller family, +** except 53C810 revisions < 16, 53C825 revisions < 16 and all +** revisions of 53C815 controllers. +** +** This driver is based on the Linux port of the FreeBSD ncr driver. +** +** Copyright (C) 1994 Wolfgang Stanglmeier +** +**----------------------------------------------------------------------------- +** +** 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., 675 Mass Ave, Cambridge, MA 02139, USA. +** +**----------------------------------------------------------------------------- +** +** The Linux port of the FreeBSD ncr driver has been achieved in +** november 1995 by: +** +** Gerard Roudier +** +** Being given that this driver originates from the FreeBSD version, and +** in order to keep synergy on both, any suggested enhancements and corrections +** received on Linux are automatically a potential candidate for the FreeBSD +** version. +** +** The original driver has been written for 386bsd and FreeBSD by +** Wolfgang Stanglmeier +** Stefan Esser +** +**----------------------------------------------------------------------------- +** +** Major contributions: +** -------------------- +** +** NVRAM detection and reading. +** Copyright (C) 1997 Richard Waltham +** +******************************************************************************* +*/ + +#ifndef SYM53C8XX_DEFS_H +#define SYM53C8XX_DEFS_H + +/* +** Check supported Linux versions +*/ + +#if !defined(LINUX_VERSION_CODE) +#include +#endif +#include + +#define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s)) + +/* + * NCR PQS/PDS special device support. + */ +#ifdef CONFIG_SCSI_NCR53C8XX_PQS_PDS +#define SCSI_NCR_PQS_PDS_SUPPORT +#endif + +/* + * No more an option, enabled by default. + */ +#ifndef CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT +#define CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT +#endif + +/* +** These options are not tunable from 'make config' +*/ +#define SCSI_NCR_PROC_INFO_SUPPORT + +/* +** If you want a driver as small as possible, donnot define the +** following options. +*/ +#define SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT +#define SCSI_NCR_DEBUG_INFO_SUPPORT +#define SCSI_NCR_PCI_FIX_UP_SUPPORT +#ifdef SCSI_NCR_PROC_INFO_SUPPORT +# ifdef CONFIG_SCSI_NCR53C8XX_PROFILE +# define SCSI_NCR_PROFILE_SUPPORT +# endif +# define SCSI_NCR_USER_COMMAND_SUPPORT +# define SCSI_NCR_USER_INFO_SUPPORT +#endif + +/*========================================================== +** +** nvram settings - #define SCSI_NCR_NVRAM_SUPPORT to enable +** +**========================================================== +*/ + +#ifdef CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT +#define SCSI_NCR_NVRAM_SUPPORT +/* #define SCSI_NCR_DEBUG_NVRAM */ +#endif + +/* --------------------------------------------------------------------- +** Take into account kernel configured parameters. +** Most of these options can be overridden at startup by a command line. +** --------------------------------------------------------------------- +*/ + +/* + * For Ultra2 SCSI support option, use special features and allow 40Mhz + * synchronous data transfers. + * + * Value 5 (default) means: + * bit 0 : all features enabled, except: + * bit 1 : PCI Write And Invalidate. + * bit 2 : Data Phase Mismatch handling from SCRIPTS. + * + * Use boot options ncr53c8xx=specf:1 if you want all chip features to be + * enabled by the driver. + */ +#define SCSI_NCR_SETUP_SPECIAL_FEATURES (3) +#define SCSI_NCR_SETUP_ULTRA_SCSI (2) +#define SCSI_NCR_MAX_SYNC (40) + +/* + * Allow tags from 2 to 64, default 8 + */ +#ifdef CONFIG_SCSI_NCR53C8XX_MAX_TAGS +#if CONFIG_SCSI_NCR53C8XX_MAX_TAGS < 2 +#define SCSI_NCR_MAX_TAGS (2) +#elif CONFIG_SCSI_NCR53C8XX_MAX_TAGS > 64 +#define SCSI_NCR_MAX_TAGS (64) +#else +#define SCSI_NCR_MAX_TAGS CONFIG_SCSI_NCR53C8XX_MAX_TAGS +#endif +#else +#define SCSI_NCR_MAX_TAGS (8) +#endif + +/* + * Allow tagged command queuing support if configured with default number + * of tags set to max (see above). + */ +#ifdef CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS +#define SCSI_NCR_SETUP_DEFAULT_TAGS CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS +#elif defined CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE +#define SCSI_NCR_SETUP_DEFAULT_TAGS SCSI_NCR_MAX_TAGS +#else +#define SCSI_NCR_SETUP_DEFAULT_TAGS (0) +#endif + +/* + * Use normal IO if configured. Forced for alpha and ppc. + */ +#if defined(CONFIG_SCSI_NCR53C8XX_IOMAPPED) +#define SCSI_NCR_IOMAPPED +#elif defined(__alpha__) || defined(__powerpc__) +#define SCSI_NCR_IOMAPPED +#elif defined(__sparc__) +#undef SCSI_NCR_IOMAPPED +#endif + +/* + * Sync transfer frequency at startup. + * Allow from 5Mhz to 40Mhz default 20 Mhz. + */ +#ifndef CONFIG_SCSI_NCR53C8XX_SYNC +#define CONFIG_SCSI_NCR53C8XX_SYNC (20) +#elif CONFIG_SCSI_NCR53C8XX_SYNC > SCSI_NCR_MAX_SYNC +#undef CONFIG_SCSI_NCR53C8XX_SYNC +#define CONFIG_SCSI_NCR53C8XX_SYNC SCSI_NCR_MAX_SYNC +#endif + +#if CONFIG_SCSI_NCR53C8XX_SYNC == 0 +#define SCSI_NCR_SETUP_DEFAULT_SYNC (255) +#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 5 +#define SCSI_NCR_SETUP_DEFAULT_SYNC (50) +#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 20 +#define SCSI_NCR_SETUP_DEFAULT_SYNC (250/(CONFIG_SCSI_NCR53C8XX_SYNC)) +#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 33 +#define SCSI_NCR_SETUP_DEFAULT_SYNC (11) +#else +#define SCSI_NCR_SETUP_DEFAULT_SYNC (10) +#endif + +/* + * Disallow disconnections at boot-up + */ +#ifdef CONFIG_SCSI_NCR53C8XX_NO_DISCONNECT +#define SCSI_NCR_SETUP_DISCONNECTION (0) +#else +#define SCSI_NCR_SETUP_DISCONNECTION (1) +#endif + +/* + * Force synchronous negotiation for all targets + */ +#ifdef CONFIG_SCSI_NCR53C8XX_FORCE_SYNC_NEGO +#define SCSI_NCR_SETUP_FORCE_SYNC_NEGO (1) +#else +#define SCSI_NCR_SETUP_FORCE_SYNC_NEGO (0) +#endif + +/* + * Disable master parity checking (flawed hardwares need that) + */ +#ifdef CONFIG_SCSI_NCR53C8XX_DISABLE_MPARITY_CHECK +#define SCSI_NCR_SETUP_MASTER_PARITY (0) +#else +#define SCSI_NCR_SETUP_MASTER_PARITY (1) +#endif + +/* + * Disable scsi parity checking (flawed devices may need that) + */ +#ifdef CONFIG_SCSI_NCR53C8XX_DISABLE_PARITY_CHECK +#define SCSI_NCR_SETUP_SCSI_PARITY (0) +#else +#define SCSI_NCR_SETUP_SCSI_PARITY (1) +#endif + +/* + * Vendor specific stuff + */ +#ifdef CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT +#define SCSI_NCR_SETUP_LED_PIN (1) +#define SCSI_NCR_SETUP_DIFF_SUPPORT (3) +#else +#define SCSI_NCR_SETUP_LED_PIN (0) +#define SCSI_NCR_SETUP_DIFF_SUPPORT (0) +#endif + +/* + * Settle time after reset at boot-up + */ +#define SCSI_NCR_SETUP_SETTLE_TIME (2) + +/* +** Other parameters not configurable with "make config" +** Avoid to change these constants, unless you know what you are doing. +*/ + +#define SCSI_NCR_ALWAYS_SIMPLE_TAG +#define SCSI_NCR_MAX_SCATTER (127) +#define SCSI_NCR_MAX_TARGET (16) + +/* No need to use a too large adapter queue */ +#if SCSI_NCR_MAX_TAGS <= 32 +#define SCSI_NCR_CAN_QUEUE (7*SCSI_NCR_MAX_TAGS) +#else +#define SCSI_NCR_CAN_QUEUE (250) +#endif + +#define SCSI_NCR_CMD_PER_LUN (SCSI_NCR_MAX_TAGS) +#define SCSI_NCR_SG_TABLESIZE (SCSI_NCR_MAX_SCATTER) + +#define SCSI_NCR_TIMER_INTERVAL (HZ) + +#if 1 /* defined CONFIG_SCSI_MULTI_LUN */ +#define SCSI_NCR_MAX_LUN (8) +#else +#define SCSI_NCR_MAX_LUN (1) +#endif + +#ifndef HOSTS_C + +/* +** IO functions definition for big/little endian support. +** For now, the NCR is only supported in little endian addressing mode, +** and big endian byte ordering is only supported for the PPC. +** MMIO is not used on PPC. +*/ + +#ifdef __BIG_ENDIAN + +#if LINUX_VERSION_CODE < LinuxVersionCode(2,1,0) +#error "BIG ENDIAN byte ordering needs kernel version >= 2.1.0" +#endif + +#if defined(__powerpc__) +#define inw_l2b inw +#define inl_l2b inl +#define outw_b2l outw +#define outl_b2l outl +#elif defined(__sparc__) +#define readw_l2b readw +#define readl_l2b readl +#define writew_b2l writew +#define writel_b2l writel +#else +#error "Support for BIG ENDIAN is only available for PowerPC and SPARC" +#endif + +#else /* little endian */ + +#if defined(__i386__) /* i386 implements full FLAT memory/MMIO model */ +#define inw_raw inw +#define inl_raw inl +#define outw_raw outw +#define outl_raw outl +#define readb_raw(a) (*(volatile unsigned char *) (a)) +#define readw_raw(a) (*(volatile unsigned short *) (a)) +#define readl_raw(a) (*(volatile unsigned int *) (a)) +#define writeb_raw(b,a) ((*(volatile unsigned char *) (a)) = (b)) +#define writew_raw(b,a) ((*(volatile unsigned short *) (a)) = (b)) +#define writel_raw(b,a) ((*(volatile unsigned int *) (a)) = (b)) + +#else /* Other little-endian (for now alpha) */ +#define inw_raw inw +#define inl_raw inl +#define outw_raw outw +#define outl_raw outl +#define readw_raw readw +#define readl_raw readl +#define writew_raw writew +#define writel_raw writel + +#endif +#endif + +#ifdef SCSI_NCR_BIG_ENDIAN +#error "The NCR in BIG ENDIAN addressing mode is not (yet) supported" +#endif + +/* +** NCR53C8XX Device Ids +*/ + +#ifndef PCI_DEVICE_ID_NCR_53C810 +#define PCI_DEVICE_ID_NCR_53C810 1 +#endif + +#ifndef PCI_DEVICE_ID_NCR_53C810AP +#define PCI_DEVICE_ID_NCR_53C810AP 5 +#endif + +#ifndef PCI_DEVICE_ID_NCR_53C815 +#define PCI_DEVICE_ID_NCR_53C815 4 +#endif + +#ifndef PCI_DEVICE_ID_NCR_53C820 +#define PCI_DEVICE_ID_NCR_53C820 2 +#endif + +#ifndef PCI_DEVICE_ID_NCR_53C825 +#define PCI_DEVICE_ID_NCR_53C825 3 +#endif + +#ifndef PCI_DEVICE_ID_NCR_53C860 +#define PCI_DEVICE_ID_NCR_53C860 6 +#endif + +#ifndef PCI_DEVICE_ID_NCR_53C875 +#define PCI_DEVICE_ID_NCR_53C875 0xf +#endif + +#ifndef PCI_DEVICE_ID_NCR_53C875J +#define PCI_DEVICE_ID_NCR_53C875J 0x8f +#endif + +#ifndef PCI_DEVICE_ID_NCR_53C885 +#define PCI_DEVICE_ID_NCR_53C885 0xd +#endif + +#ifndef PCI_DEVICE_ID_NCR_53C895 +#define PCI_DEVICE_ID_NCR_53C895 0xc +#endif + +#ifndef PCI_DEVICE_ID_NCR_53C896 +#define PCI_DEVICE_ID_NCR_53C896 0xb +#endif + +/* +** NCR53C8XX devices features table. +*/ +typedef struct { + unsigned short device_id; + unsigned short revision_id; + char *name; + unsigned char burst_max; + unsigned char offset_max; + unsigned char nr_divisor; + unsigned int features; +#define FE_LED0 (1<<0) +#define FE_WIDE (1<<1) +#define FE_ULTRA (1<<2) +#define FE_ULTRA2 (1<<3) +#define FE_DBLR (1<<4) +#define FE_QUAD (1<<5) +#define FE_ERL (1<<6) +#define FE_CLSE (1<<7) +#define FE_WRIE (1<<8) +#define FE_ERMP (1<<9) +#define FE_BOF (1<<10) +#define FE_DFS (1<<11) +#define FE_PFEN (1<<12) +#define FE_LDSTR (1<<13) +#define FE_RAM (1<<14) +#define FE_CLK80 (1<<15) +#define FE_RAM8K (1<<16) +#define FE_64BIT (1<<17) +#define FE_IO256 (1<<18) +#define FE_NOPM (1<<19) +#define FE_LEDC (1<<20) +#define FE_CACHE_SET (FE_ERL|FE_CLSE|FE_WRIE|FE_ERMP) +#define FE_SCSI_SET (FE_WIDE|FE_ULTRA|FE_ULTRA2|FE_DBLR|FE_QUAD|F_CLK80) +#define FE_SPECIAL_SET (FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM) +} ncr_chip; + +/* +** DEL 397 - 53C875 Rev 3 - Part Number 609-0392410 - ITEM 3. +** Memory Read transaction terminated by a retry followed by +** Memory Read Line command. +*/ +#define FE_CACHE0_SET (FE_CACHE_SET & ~FE_ERL) + +/* +** DEL 397 - 53C875 Rev 3 - Part Number 609-0392410 - ITEM 5. +** On paper, this errata is harmless. But it is a good reason for +** using a shorter programmed burst length (64 DWORDS instead of 128). +*/ + +#define SCSI_NCR_CHIP_TABLE \ +{ \ + {PCI_DEVICE_ID_NCR_53C810, 0x0f, "810", 4, 8, 4, \ + FE_ERL} \ + , \ + {PCI_DEVICE_ID_NCR_53C810, 0xff, "810a", 4, 8, 4, \ + FE_CACHE_SET|FE_LDSTR|FE_PFEN|FE_BOF} \ + , \ + {PCI_DEVICE_ID_NCR_53C815, 0xff, "815", 4, 8, 4, \ + FE_ERL|FE_BOF} \ + , \ + {PCI_DEVICE_ID_NCR_53C820, 0xff, "820", 4, 8, 4, \ + FE_WIDE|FE_ERL} \ + , \ + {PCI_DEVICE_ID_NCR_53C825, 0x0f, "825", 4, 8, 4, \ + FE_WIDE|FE_ERL|FE_BOF} \ + , \ + {PCI_DEVICE_ID_NCR_53C825, 0xff, "825a", 6, 8, 4, \ + FE_WIDE|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM} \ + , \ + {PCI_DEVICE_ID_NCR_53C860, 0xff, "860", 4, 8, 5, \ + FE_ULTRA|FE_CLK80|FE_CACHE_SET|FE_BOF|FE_LDSTR|FE_PFEN} \ + , \ + {PCI_DEVICE_ID_NCR_53C875, 0x01, "875", 6, 16, 5, \ + FE_WIDE|FE_ULTRA|FE_CLK80|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ + , \ + {PCI_DEVICE_ID_NCR_53C875, 0x0f, "875", 6, 16, 5, \ + FE_WIDE|FE_ULTRA|FE_DBLR|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ + , \ + {PCI_DEVICE_ID_NCR_53C875, 0xff, "876", 6, 16, 5, \ + FE_WIDE|FE_ULTRA|FE_DBLR|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ + , \ + {PCI_DEVICE_ID_NCR_53C875J,0xff, "875J", 6, 16, 5, \ + FE_WIDE|FE_ULTRA|FE_DBLR|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ + , \ + {PCI_DEVICE_ID_NCR_53C885, 0xff, "885", 6, 16, 5, \ + FE_WIDE|FE_ULTRA|FE_DBLR|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ + , \ + {PCI_DEVICE_ID_NCR_53C895, 0xff, "895", 6, 31, 7, \ + FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\ + , \ + {PCI_DEVICE_ID_NCR_53C896, 0xff, "896", 7, 31, 7, \ + FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM|\ + FE_RAM8K|FE_64BIT|FE_IO256|FE_NOPM|FE_LEDC}\ +} + +/* + * List of supported NCR chip ids + */ +#define SCSI_NCR_CHIP_IDS \ +{ \ + PCI_DEVICE_ID_NCR_53C810, \ + PCI_DEVICE_ID_NCR_53C815, \ + PCI_DEVICE_ID_NCR_53C820, \ + PCI_DEVICE_ID_NCR_53C825, \ + PCI_DEVICE_ID_NCR_53C860, \ + PCI_DEVICE_ID_NCR_53C875, \ + PCI_DEVICE_ID_NCR_53C875J, \ + PCI_DEVICE_ID_NCR_53C885, \ + PCI_DEVICE_ID_NCR_53C895, \ + PCI_DEVICE_ID_NCR_53C896 \ +} + +/* +** Initial setup. +** Can be overriden at startup by a command line. +*/ +#define SCSI_NCR_DRIVER_SETUP \ +{ \ + SCSI_NCR_SETUP_MASTER_PARITY, \ + SCSI_NCR_SETUP_SCSI_PARITY, \ + SCSI_NCR_SETUP_DISCONNECTION, \ + SCSI_NCR_SETUP_SPECIAL_FEATURES, \ + SCSI_NCR_SETUP_ULTRA_SCSI, \ + SCSI_NCR_SETUP_FORCE_SYNC_NEGO, \ + 0, \ + 0, \ + 1, \ + 1, \ + SCSI_NCR_SETUP_DEFAULT_TAGS, \ + SCSI_NCR_SETUP_DEFAULT_SYNC, \ + 0x00, \ + 7, \ + SCSI_NCR_SETUP_LED_PIN, \ + 1, \ + SCSI_NCR_SETUP_SETTLE_TIME, \ + SCSI_NCR_SETUP_DIFF_SUPPORT, \ + 0, \ + 1, \ + 0, \ + 0 \ +} + +/* +** Boot fail safe setup. +** Override initial setup from boot command line: +** ncr53c8xx=safe:y +*/ +#define SCSI_NCR_DRIVER_SAFE_SETUP \ +{ \ + 0, \ + 1, \ + 0, \ + 0, \ + 0, \ + 0, \ + 0, \ + 0, \ + 1, \ + 2, \ + 0, \ + 255, \ + 0x00, \ + 255, \ + 0, \ + 0, \ + 10, \ + 1, \ + 1, \ + 1, \ + 0, \ + 0 \ +} + +/**************** ORIGINAL CONTENT of ncrreg.h from FreeBSD ******************/ + +/*----------------------------------------------------------------- +** +** The ncr 53c810 register structure. +** +**----------------------------------------------------------------- +*/ + +struct ncr_reg { +/*00*/ u_char nc_scntl0; /* full arb., ena parity, par->ATN */ + +/*01*/ u_char nc_scntl1; /* no reset */ + #define ISCON 0x10 /* connected to scsi */ + #define CRST 0x08 /* force reset */ + +/*02*/ u_char nc_scntl2; /* no disconnect expected */ + #define SDU 0x80 /* cmd: disconnect will raise error */ + #define CHM 0x40 /* sta: chained mode */ + #define WSS 0x08 /* sta: wide scsi send [W]*/ + #define WSR 0x01 /* sta: wide scsi received [W]*/ + +/*03*/ u_char nc_scntl3; /* cnf system clock dependent */ + #define EWS 0x08 /* cmd: enable wide scsi [W]*/ + #define ULTRA 0x80 /* cmd: ULTRA enable */ + +/*04*/ u_char nc_scid; /* cnf host adapter scsi address */ + #define RRE 0x40 /* r/w:e enable response to resel. */ + #define SRE 0x20 /* r/w:e enable response to select */ + +/*05*/ u_char nc_sxfer; /* ### Sync speed and count */ + +/*06*/ u_char nc_sdid; /* ### Destination-ID */ + +/*07*/ u_char nc_gpreg; /* ??? IO-Pins */ + +/*08*/ u_char nc_sfbr; /* ### First byte in phase */ + +/*09*/ u_char nc_socl; + #define CREQ 0x80 /* r/w: SCSI-REQ */ + #define CACK 0x40 /* r/w: SCSI-ACK */ + #define CBSY 0x20 /* r/w: SCSI-BSY */ + #define CSEL 0x10 /* r/w: SCSI-SEL */ + #define CATN 0x08 /* r/w: SCSI-ATN */ + #define CMSG 0x04 /* r/w: SCSI-MSG */ + #define CC_D 0x02 /* r/w: SCSI-C_D */ + #define CI_O 0x01 /* r/w: SCSI-I_O */ + +/*0a*/ u_char nc_ssid; + +/*0b*/ u_char nc_sbcl; + +/*0c*/ u_char nc_dstat; + #define DFE 0x80 /* sta: dma fifo empty */ + #define MDPE 0x40 /* int: master data parity error */ + #define BF 0x20 /* int: script: bus fault */ + #define ABRT 0x10 /* int: script: command aborted */ + #define SSI 0x08 /* int: script: single step */ + #define SIR 0x04 /* int: script: interrupt instruct. */ + #define IID 0x01 /* int: script: illegal instruct. */ + +/*0d*/ u_char nc_sstat0; + #define ILF 0x80 /* sta: data in SIDL register lsb */ + #define ORF 0x40 /* sta: data in SODR register lsb */ + #define OLF 0x20 /* sta: data in SODL register lsb */ + #define AIP 0x10 /* sta: arbitration in progress */ + #define LOA 0x08 /* sta: arbitration lost */ + #define WOA 0x04 /* sta: arbitration won */ + #define IRST 0x02 /* sta: scsi reset signal */ + #define SDP 0x01 /* sta: scsi parity signal */ + +/*0e*/ u_char nc_sstat1; + #define FF3210 0xf0 /* sta: bytes in the scsi fifo */ + +/*0f*/ u_char nc_sstat2; + #define ILF1 0x80 /* sta: data in SIDL register msb[W]*/ + #define ORF1 0x40 /* sta: data in SODR register msb[W]*/ + #define OLF1 0x20 /* sta: data in SODL register msb[W]*/ + #define DM 0x04 /* sta: DIFFSENS mismatch (895/6 only) */ + #define LDSC 0x02 /* sta: disconnect & reconnect */ + +/*10*/ u_int32 nc_dsa; /* --> Base page */ + +/*14*/ u_char nc_istat; /* --> Main Command and status */ + #define CABRT 0x80 /* cmd: abort current operation */ + #define SRST 0x40 /* mod: reset chip */ + #define SIGP 0x20 /* r/w: message from host to ncr */ + #define SEM 0x10 /* r/w: message between host + ncr */ + #define CON 0x08 /* sta: connected to scsi */ + #define INTF 0x04 /* sta: int on the fly (reset by wr)*/ + #define SIP 0x02 /* sta: scsi-interrupt */ + #define DIP 0x01 /* sta: host/script interrupt */ + +/*15*/ u_char nc_istat1; /* 896 only */ +/*16*/ u_char nc_mbox0; /* 896 only */ +/*17*/ u_char nc_mbox1; /* 896 only */ + +/*18*/ u_char nc_ctest0; +/*19*/ u_char nc_ctest1; + +/*1a*/ u_char nc_ctest2; + #define CSIGP 0x40 + +/*1b*/ u_char nc_ctest3; + #define FLF 0x08 /* cmd: flush dma fifo */ + #define CLF 0x04 /* cmd: clear dma fifo */ + #define FM 0x02 /* mod: fetch pin mode */ + #define WRIE 0x01 /* mod: write and invalidate enable */ + +/*1c*/ u_int32 nc_temp; /* ### Temporary stack */ + +/*20*/ u_char nc_dfifo; +/*21*/ u_char nc_ctest4; + #define BDIS 0x80 /* mod: burst disable */ + #define MPEE 0x08 /* mod: master parity error enable */ + +/*22*/ u_char nc_ctest5; + #define DFS 0x20 /* mod: dma fifo size */ +/*23*/ u_char nc_ctest6; + +/*24*/ u_int32 nc_dbc; /* ### Byte count and command */ +/*28*/ u_int32 nc_dnad; /* ### Next command register */ +/*2c*/ u_int32 nc_dsp; /* --> Script Pointer */ +/*30*/ u_int32 nc_dsps; /* --> Script pointer save/opcode#2 */ + +/*34*/ u_char nc_scratcha; /* Temporary register a */ +/*35*/ u_char nc_scratcha1; +/*36*/ u_char nc_scratcha2; +/*37*/ u_char nc_scratcha3; + +/*38*/ u_char nc_dmode; + #define BL_2 0x80 /* mod: burst length shift value +2 */ + #define BL_1 0x40 /* mod: burst length shift value +1 */ + #define ERL 0x08 /* mod: enable read line */ + #define ERMP 0x04 /* mod: enable read multiple */ + #define BOF 0x02 /* mod: burst op code fetch */ + +/*39*/ u_char nc_dien; +/*3a*/ u_char nc_dwt; + +/*3b*/ u_char nc_dcntl; /* --> Script execution control */ + #define CLSE 0x80 /* mod: cache line size enable */ + #define PFF 0x40 /* cmd: pre-fetch flush */ + #define PFEN 0x20 /* mod: pre-fetch enable */ + #define SSM 0x10 /* mod: single step mode */ + #define IRQM 0x08 /* mod: irq mode (1 = totem pole !) */ + #define STD 0x04 /* cmd: start dma mode */ + #define IRQD 0x02 /* mod: irq disable */ + #define NOCOM 0x01 /* cmd: protect sfbr while reselect */ + +/*3c*/ u_int32 nc_adder; + +/*40*/ u_short nc_sien; /* -->: interrupt enable */ +/*42*/ u_short nc_sist; /* <--: interrupt status */ + #define SBMC 0x1000/* sta: SCSI Bus Mode Change (895/6 only) */ + #define STO 0x0400/* sta: timeout (select) */ + #define GEN 0x0200/* sta: timeout (general) */ + #define HTH 0x0100/* sta: timeout (handshake) */ + #define MA 0x80 /* sta: phase mismatch */ + #define CMP 0x40 /* sta: arbitration complete */ + #define SEL 0x20 /* sta: selected by another device */ + #define RSL 0x10 /* sta: reselected by another device*/ + #define SGE 0x08 /* sta: gross error (over/underflow)*/ + #define UDC 0x04 /* sta: unexpected disconnect */ + #define RST 0x02 /* sta: scsi bus reset detected */ + #define PAR 0x01 /* sta: scsi parity error */ + +/*44*/ u_char nc_slpar; +/*45*/ u_char nc_swide; +/*46*/ u_char nc_macntl; +/*47*/ u_char nc_gpcntl; +/*48*/ u_char nc_stime0; /* cmd: timeout for select&handshake*/ +/*49*/ u_char nc_stime1; /* cmd: timeout user defined */ +/*4a*/ u_short nc_respid; /* sta: Reselect-IDs */ + +/*4c*/ u_char nc_stest0; + +/*4d*/ u_char nc_stest1; + #define DBLEN 0x08 /* clock doubler running */ + #define DBLSEL 0x04 /* clock doubler selected */ + + +/*4e*/ u_char nc_stest2; + #define ROF 0x40 /* reset scsi offset (after gross error!) */ + #define EXT 0x02 /* extended filtering */ + +/*4f*/ u_char nc_stest3; + #define TE 0x80 /* c: tolerAnt enable */ + #define HSC 0x20 /* c: Halt SCSI Clock */ + #define CSF 0x02 /* c: clear scsi fifo */ + +/*50*/ u_short nc_sidl; /* Lowlevel: latched from scsi data */ +/*52*/ u_char nc_stest4; + #define SMODE 0xc0 /* SCSI bus mode (895/6 only) */ + #define SMODE_HVD 0x40 /* High Voltage Differential */ + #define SMODE_SE 0x80 /* Single Ended */ + #define SMODE_LVD 0xc0 /* Low Voltage Differential */ + #define LCKFRQ 0x20 /* Frequency Lock (895/6 only) */ + +/*53*/ u_char nc_53_; +/*54*/ u_short nc_sodl; /* Lowlevel: data out to scsi data */ +/*56*/ u_char nc_ccntl0; /* Chip Control 0 (896) */ + #define ENPMJ 0x80 /* Enable Phase Mismatch Jump */ + #define PMJCTL 0x40 /* Phase Mismatch Jump Control */ + #define ENNDJ 0x20 /* Enable Non Data PM Jump */ + #define DISFC 0x10 /* Disable Auto FIFO Clear */ + #define DILS 0x02 /* Disable Internal Load/Store */ + #define DPR 0x01 /* Disable Pipe Req */ + +/*57*/ u_char nc_ccntl1; /* Chip Control 1 (896) */ + #define ZMOD 0x80 /* High Impedance Mode */ + #define DDAC 0x08 /* Disable Dual Address Cycle */ + #define XTIMOD 0x04 /* 64-bit Table Ind. Indexing Mode */ + #define EXTIBMV 0x02 /* Enable 64-bit Table Ind. BMOV */ + #define EXDBMV 0x01 /* Enable 64-bit Direct BMOV */ + +/*58*/ u_short nc_sbdl; /* Lowlevel: data from scsi data */ +/*5a*/ u_short nc_5a_; + +/*5c*/ u_char nc_scr0; /* Working register B */ +/*5d*/ u_char nc_scr1; /* */ +/*5e*/ u_char nc_scr2; /* */ +/*5f*/ u_char nc_scr3; /* */ + +/*60*/ u_char nc_scrx[64]; /* Working register C-R */ +/*a0*/ u_int32 nc_mmrs; /* Memory Move Read Selector */ +/*a4*/ u_int32 nc_mmws; /* Memory Move Write Selector */ +/*a8*/ u_int32 nc_sfs; /* Script Fetch Selector */ +/*ac*/ u_int32 nc_drs; /* DSA Relative Selector */ +/*b0*/ u_int32 nc_sbms; /* Static Block Move Selector */ +/*b4*/ u_int32 nc_dbms; /* Dynamic Block Move Selector */ +/*b8*/ u_int32 nc_dnad64; /* DMA Next Address 64 */ +/*bc*/ u_int32 nc_bc_; + +/*c0*/ u_int32 nc_pmjad1; /* Phase Mismatch Jump Address 1 */ +/*c4*/ u_int32 nc_pmjad2; /* Phase Mismatch Jump Address 2 */ +/*c8*/ u_int32 nc_rbc; /* Remaining Byte Count */ +/*cc*/ u_int32 nc_ua; /* Updated Address */ +/*d0*/ u_int32 nc_esa; /* Entry Storage Address */ +/*d4*/ u_char nc_ia; /* Instruction Address */ +/*d5*/ u_char nc_ia1; +/*d6*/ u_char nc_ia2; +/*d7*/ u_char nc_ia3; +/*d8*/ u_int32 nc_sbc; /* SCSI Byte Count (3 bytes only) */ +/*dc*/ u_int32 nc_csbc; /* Cumulative SCSI Byte Count */ +}; + +/*----------------------------------------------------------- +** +** Utility macros for the script. +** +**----------------------------------------------------------- +*/ + +#define REGJ(p,r) (offsetof(struct ncr_reg, p ## r)) +#define REG(r) REGJ (nc_, r) + +#ifndef TARGET_MODE +#define TARGET_MODE 0 +#endif + +typedef u_int32 ncrcmd; + +/*----------------------------------------------------------- +** +** SCSI phases +** +**----------------------------------------------------------- +*/ + +#define SCR_DATA_OUT 0x00000000 +#define SCR_DATA_IN 0x01000000 +#define SCR_COMMAND 0x02000000 +#define SCR_STATUS 0x03000000 +#define SCR_ILG_OUT 0x04000000 +#define SCR_ILG_IN 0x05000000 +#define SCR_MSG_OUT 0x06000000 +#define SCR_MSG_IN 0x07000000 + +/*----------------------------------------------------------- +** +** Data transfer via SCSI. +** +**----------------------------------------------------------- +** +** MOVE_ABS (LEN) +** <> +** +** MOVE_IND (LEN) +** <> +** +** MOVE_TBL +** <> +** +**----------------------------------------------------------- +*/ + +#define SCR_MOVE_ABS(l) ((0x08000000 ^ (TARGET_MODE << 1ul)) | (l)) +#define SCR_MOVE_IND(l) ((0x28000000 ^ (TARGET_MODE << 1ul)) | (l)) +#define SCR_MOVE_TBL (0x18000000 ^ (TARGET_MODE << 1ul)) + +struct scr_tblmove { + u_int32 size; + u_int32 addr; +}; + +/*----------------------------------------------------------- +** +** Selection +** +**----------------------------------------------------------- +** +** SEL_ABS | SCR_ID (0..7) [ | REL_JMP] +** <> +** +** SEL_TBL | << dnad_offset>> [ | REL_JMP] +** <> +** +**----------------------------------------------------------- +*/ + +#define SCR_SEL_ABS 0x40000000 +#define SCR_SEL_ABS_ATN 0x41000000 +#define SCR_SEL_TBL 0x42000000 +#define SCR_SEL_TBL_ATN 0x43000000 + +struct scr_tblsel { + u_char sel_0; + u_char sel_sxfer; + u_char sel_id; + u_char sel_scntl3; +}; + +#define SCR_JMP_REL 0x04000000 +#define SCR_ID(id) (((u_int32)(id)) << 16) + +/*----------------------------------------------------------- +** +** Waiting for Disconnect or Reselect +** +**----------------------------------------------------------- +** +** WAIT_DISC +** dummy: <> +** +** WAIT_RESEL +** <> +** +**----------------------------------------------------------- +*/ + +#define SCR_WAIT_DISC 0x48000000 +#define SCR_WAIT_RESEL 0x50000000 + +/*----------------------------------------------------------- +** +** Bit Set / Reset +** +**----------------------------------------------------------- +** +** SET (flags {|.. }) +** +** CLR (flags {|.. }) +** +**----------------------------------------------------------- +*/ + +#define SCR_SET(f) (0x58000000 | (f)) +#define SCR_CLR(f) (0x60000000 | (f)) + +#define SCR_CARRY 0x00000400 +#define SCR_TRG 0x00000200 +#define SCR_ACK 0x00000040 +#define SCR_ATN 0x00000008 + + + + +/*----------------------------------------------------------- +** +** Memory to memory move +** +**----------------------------------------------------------- +** +** COPY (bytecount) +** << source_address >> +** << destination_address >> +** +** SCR_COPY sets the NO FLUSH option by default. +** SCR_COPY_F does not set this option. +** +** For chips which do not support this option, +** ncr_copy_and_bind() will remove this bit. +**----------------------------------------------------------- +*/ + +#define SCR_NO_FLUSH 0x01000000 + +#define SCR_COPY(n) (0xc0000000 | SCR_NO_FLUSH | (n)) +#define SCR_COPY_F(n) (0xc0000000 | (n)) + +/*----------------------------------------------------------- +** +** Register move and binary operations +** +**----------------------------------------------------------- +** +** SFBR_REG (reg, op, data) reg = SFBR op data +** << 0 >> +** +** REG_SFBR (reg, op, data) SFBR = reg op data +** << 0 >> +** +** REG_REG (reg, op, data) reg = reg op data +** << 0 >> +** +**----------------------------------------------------------- +** On 810A, 860, 825A, 875, 895 and 896 chips the content +** of SFBR register can be used as data (SCR_SFBR_DATA). +** The 896 has additionnal IO registers starting at +** offset 0x80. Bit 7 of register offset is stored in +** bit 7 of the SCRIPTS instruction first DWORD. +**----------------------------------------------------------- +*/ + +#define SCR_REG_OFS(ofs) ((((ofs) & 0x7f) << 16ul) + ((ofs) & 0x80)) + +#define SCR_SFBR_REG(reg,op,data) \ + (0x68000000 | (SCR_REG_OFS(REG(reg))) | (op) | (((data)&0xff)<<8ul)) + +#define SCR_REG_SFBR(reg,op,data) \ + (0x70000000 | (SCR_REG_OFS(REG(reg))) | (op) | (((data)&0xff)<<8ul)) + +#define SCR_REG_REG(reg,op,data) \ + (0x78000000 | (SCR_REG_OFS(REG(reg))) | (op) | (((data)&0xff)<<8ul)) + + +#define SCR_LOAD 0x00000000 +#define SCR_SHL 0x01000000 +#define SCR_OR 0x02000000 +#define SCR_XOR 0x03000000 +#define SCR_AND 0x04000000 +#define SCR_SHR 0x05000000 +#define SCR_ADD 0x06000000 +#define SCR_ADDC 0x07000000 + +#define SCR_SFBR_DATA (0x00800000>>8ul) /* Use SFBR as data */ + +/*----------------------------------------------------------- +** +** FROM_REG (reg) SFBR = reg +** << 0 >> +** +** TO_REG (reg) reg = SFBR +** << 0 >> +** +** LOAD_REG (reg, data) reg = +** << 0 >> +** +** LOAD_SFBR(data) SFBR = +** << 0 >> +** +**----------------------------------------------------------- +*/ + +#define SCR_FROM_REG(reg) \ + SCR_REG_SFBR(reg,SCR_OR,0) + +#define SCR_TO_REG(reg) \ + SCR_SFBR_REG(reg,SCR_OR,0) + +#define SCR_LOAD_REG(reg,data) \ + SCR_REG_REG(reg,SCR_LOAD,data) + +#define SCR_LOAD_SFBR(data) \ + (SCR_REG_SFBR (gpreg, SCR_LOAD, data)) + +/*----------------------------------------------------------- +** +** LOAD from memory to register. +** STORE from register to memory. +** +** Only supported by 810A, 860, 825A, 875, 895 and 896. +** +**----------------------------------------------------------- +** +** LOAD_ABS (LEN) +** <> +** +** LOAD_REL (LEN) (DSA relative) +** <> +** +**----------------------------------------------------------- +*/ + +#define SCR_REG_OFS2(ofs) (((ofs) & 0xff) << 16ul) +#define SCR_NO_FLUSH2 0x02000000 +#define SCR_DSA_REL2 0x10000000 + +#define SCR_LOAD_R(reg, how, n) \ + (0xe1000000 | how | (SCR_REG_OFS2(REG(reg))) | (n)) + +#define SCR_STORE_R(reg, how, n) \ + (0xe0000000 | how | (SCR_REG_OFS2(REG(reg))) | (n)) + +#define SCR_LOAD_ABS(reg, n) SCR_LOAD_R(reg, SCR_NO_FLUSH2, n) +#define SCR_LOAD_REL(reg, n) SCR_LOAD_R(reg, SCR_NO_FLUSH2|SCR_DSA_REL2, n) +#define SCR_LOAD_ABS_F(reg, n) SCR_LOAD_R(reg, 0, n) +#define SCR_LOAD_REL_F(reg, n) SCR_LOAD_R(reg, SCR_DSA_REL2, n) + +#define SCR_STORE_ABS(reg, n) SCR_STORE_R(reg, SCR_NO_FLUSH2, n) +#define SCR_STORE_REL(reg, n) SCR_STORE_R(reg, SCR_NO_FLUSH2|SCR_DSA_REL2,n) +#define SCR_STORE_ABS_F(reg, n) SCR_STORE_R(reg, 0, n) +#define SCR_STORE_REL_F(reg, n) SCR_STORE_R(reg, SCR_DSA_REL2, n) + + +/*----------------------------------------------------------- +** +** Waiting for Disconnect or Reselect +** +**----------------------------------------------------------- +** +** JUMP [ | IFTRUE/IFFALSE ( ... ) ] +** <
> +** +** JUMPR [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** CALL [ | IFTRUE/IFFALSE ( ... ) ] +** <
> +** +** CALLR [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** RETURN [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** INT [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** INT_FLY [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** Conditions: +** WHEN (phase) +** IF (phase) +** CARRY +** DATA (data, mask) +** +**----------------------------------------------------------- +*/ + +#define SCR_NO_OP 0x80000000 +#define SCR_JUMP 0x80080000 +#define SCR_JUMP64 0x80480000 +#define SCR_JUMPR 0x80880000 +#define SCR_CALL 0x88080000 +#define SCR_CALLR 0x88880000 +#define SCR_RETURN 0x90080000 +#define SCR_INT 0x98080000 +#define SCR_INT_FLY 0x98180000 + +#define IFFALSE(arg) (0x00080000 | (arg)) +#define IFTRUE(arg) (0x00000000 | (arg)) + +#define WHEN(phase) (0x00030000 | (phase)) +#define IF(phase) (0x00020000 | (phase)) + +#define DATA(D) (0x00040000 | ((D) & 0xff)) +#define MASK(D,M) (0x00040000 | (((M ^ 0xff) & 0xff) << 8ul)|((D) & 0xff)) + +#define CARRYSET (0x00200000) + +/*----------------------------------------------------------- +** +** SCSI constants. +** +**----------------------------------------------------------- +*/ + +/* +** Messages +*/ + +#define M_COMPLETE (0x00) +#define M_EXTENDED (0x01) +#define M_SAVE_DP (0x02) +#define M_RESTORE_DP (0x03) +#define M_DISCONNECT (0x04) +#define M_ID_ERROR (0x05) +#define M_ABORT (0x06) +#define M_REJECT (0x07) +#define M_NOOP (0x08) +#define M_PARITY (0x09) +#define M_LCOMPLETE (0x0a) +#define M_FCOMPLETE (0x0b) +#define M_RESET (0x0c) +#define M_ABORT_TAG (0x0d) +#define M_CLEAR_QUEUE (0x0e) +#define M_INIT_REC (0x0f) +#define M_REL_REC (0x10) +#define M_TERMINATE (0x11) +#define M_SIMPLE_TAG (0x20) +#define M_HEAD_TAG (0x21) +#define M_ORDERED_TAG (0x22) +#define M_IGN_RESIDUE (0x23) +#define M_IDENTIFY (0x80) + +#define M_X_MODIFY_DP (0x00) +#define M_X_SYNC_REQ (0x01) +#define M_X_WIDE_REQ (0x03) + +/* +** Status +*/ + +#define S_GOOD (0x00) +#define S_CHECK_COND (0x02) +#define S_COND_MET (0x04) +#define S_BUSY (0x08) +#define S_INT (0x10) +#define S_INT_COND_MET (0x14) +#define S_CONFLICT (0x18) +#define S_TERMINATED (0x20) +#define S_QUEUE_FULL (0x28) +#define S_ILLEGAL (0xff) +#define S_SENSE (0x80) + +/* + * End of ncrreg from FreeBSD + */ + +#endif /* !defined HOSTS_C */ + +#endif /* defined SYM53C8XX_DEFS_H */ diff -u --recursive --new-file v2.2.5/linux/drivers/scsi/wd33c93.c linux/drivers/scsi/wd33c93.c --- v2.2.5/linux/drivers/scsi/wd33c93.c Thu May 14 19:47:41 1998 +++ linux/drivers/scsi/wd33c93.c Mon Apr 12 16:18:26 1999 @@ -1457,6 +1457,8 @@ if (tmp == cmd) { if (prev) prev->host_scribble = cmd->host_scribble; + else + hostdata->input_Q = (Scsi_Cmnd *)cmd->host_scribble; cmd->host_scribble = NULL; cmd->result = DID_ABORT << 16; printk("scsi%d: Abort - removing command %ld from input_Q. ", diff -u --recursive --new-file v2.2.5/linux/drivers/sound/ad1848.c linux/drivers/sound/ad1848.c --- v2.2.5/linux/drivers/sound/ad1848.c Wed Mar 10 15:29:47 1999 +++ linux/drivers/sound/ad1848.c Mon Apr 12 16:18:27 1999 @@ -137,6 +137,21 @@ #define io_Status(d) ((d)->base+2) #define io_Polled_IO(d) ((d)->base+3) +static struct { + unsigned char flags; +#define CAP_F_TIMER 0x01 +} capabilities [9 /*devc->model */ ] = { + {0} + ,{0} /* MD_1848 */ + ,{CAP_F_TIMER} /* MD_4231 */ + ,{CAP_F_TIMER} /* MD_4231A */ + ,{CAP_F_TIMER} /* MD_1845 */ + ,{CAP_F_TIMER} /* MD_4232 */ + ,{0} /* MD_C930 */ + ,{CAP_F_TIMER} /* MD_IWAVE */ + ,{0} /* MD_4235 */ +}; + static int ad1848_open(int dev, int mode); static void ad1848_close(int dev); static void ad1848_output_block(int dev, unsigned long buf, int count, int intrflag); @@ -1894,7 +1909,7 @@ /* Don't free it either then.. */ devc->irq = 0; } - if (devc->model != MD_1848 && devc->model != MD_C930) + if (capabilities[devc->model].flags & CAP_F_TIMER) { #ifndef __SMP__ int x; @@ -1927,8 +1942,8 @@ irq2dev[-irq] = devc->dev_no = my_dev; #if defined(CONFIG_SEQUENCER) && !defined(EXCLUDE_TIMERS) - if (devc->model != MD_1848 && - devc->model != MD_C930 && devc->irq_ok) + if ((capabilities[devc->model].flags & CAP_F_TIMER) && + devc->irq_ok) ad1848_tmr_install(my_dev); #endif diff -u --recursive --new-file v2.2.5/linux/drivers/sound/audio.c linux/drivers/sound/audio.c --- v2.2.5/linux/drivers/sound/audio.c Tue Dec 22 14:16:56 1998 +++ linux/drivers/sound/audio.c Mon Apr 12 16:18:27 1999 @@ -60,7 +60,10 @@ else return audio_devs[dev]->local_format; - return audio_devs[dev]->local_format; + if (audio_devs[dev]->local_conversion) + return audio_devs[dev]->local_conversion; + else + return audio_devs[dev]->local_format; } int audio_open(int dev, struct file *file) @@ -387,7 +390,7 @@ return 0; case SNDCTL_DSP_GETFMTS: - val = audio_devs[dev]->format_mask; + val = audio_devs[dev]->format_mask | AFMT_MU_LAW; break; case SNDCTL_DSP_SETFMT: diff -u --recursive --new-file v2.2.5/linux/drivers/sound/dev_table.c linux/drivers/sound/dev_table.c --- v2.2.5/linux/drivers/sound/dev_table.c Thu Jan 7 15:11:37 1999 +++ linux/drivers/sound/dev_table.c Mon Apr 12 16:18:27 1999 @@ -437,6 +437,7 @@ memset((char *) op, 0, sizeof(struct audio_operations)); init_waitqueue(&op->in_sleeper); init_waitqueue(&op->out_sleeper); + init_waitqueue(&op->poll_sleeper); if (driver_size < sizeof(struct audio_driver)) memset((char *) d, 0, sizeof(struct audio_driver)); diff -u --recursive --new-file v2.2.5/linux/drivers/sound/dev_table.h linux/drivers/sound/dev_table.h --- v2.2.5/linux/drivers/sound/dev_table.h Fri Jan 8 22:36:10 1999 +++ linux/drivers/sound/dev_table.h Mon Apr 12 16:18:27 1999 @@ -236,6 +236,7 @@ /* fields formerly in dmabuf.c */ struct wait_queue *in_sleeper; struct wait_queue *out_sleeper; + struct wait_queue *poll_sleeper; /* fields formerly in audio.c */ int audio_mode; diff -u --recursive --new-file v2.2.5/linux/drivers/sound/dmabuf.c linux/drivers/sound/dmabuf.c --- v2.2.5/linux/drivers/sound/dmabuf.c Tue Dec 22 14:16:56 1998 +++ linux/drivers/sound/dmabuf.c Mon Apr 12 16:18:27 1999 @@ -935,6 +935,7 @@ if (dmap->audio_callback != NULL) dmap->audio_callback(dev, dmap->callback_parm); wake_up(&adev->out_sleeper); + wake_up(&adev->poll_sleeper); } static void do_outputintr(int dev, int dummy) @@ -1103,7 +1104,10 @@ } dmap->flags |= DMA_ACTIVE; if (dmap->qlen > 0) + { wake_up(&adev->in_sleeper); + wake_up(&adev->poll_sleeper); + } } void DMAbuf_inputintr(int dev) @@ -1217,7 +1221,6 @@ if (!(adev->open_mode & OPEN_READ)) return 0; if (dmap->mapping_flags & DMA_MAP_MAPPED) { - poll_wait(file, &adev->in_sleeper, wait); if (dmap->qlen) return POLLIN | POLLRDNORM; return 0; @@ -1228,7 +1231,6 @@ !dmap->qlen && adev->go) { unsigned long flags; - poll_wait(file, &adev->in_sleeper, wait); save_flags(flags); cli(); DMAbuf_activate_recording(dev, dmap); @@ -1236,7 +1238,6 @@ } return 0; } - poll_wait(file, &adev->in_sleeper, wait); if (!dmap->qlen) return 0; return POLLIN | POLLRDNORM; @@ -1250,14 +1251,12 @@ if (!(adev->open_mode & OPEN_WRITE)) return 0; if (dmap->mapping_flags & DMA_MAP_MAPPED) { - poll_wait(file, &adev->out_sleeper, wait); if (dmap->qlen) return POLLOUT | POLLWRNORM; return 0; } if (dmap->dma_mode == DMODE_INPUT) return 0; - poll_wait(file, &adev->out_sleeper, wait); if (dmap->dma_mode == DMODE_NONE) return POLLOUT | POLLWRNORM; if (!DMAbuf_space_in_queue(dev)) @@ -1267,6 +1266,8 @@ unsigned int DMAbuf_poll(struct file * file, int dev, poll_table *wait) { + struct audio_operations *adev = audio_devs[dev]; + poll_wait(file, &adev->poll_sleeper, wait); return poll_input(file, dev, wait) | poll_output(file, dev, wait); } diff -u --recursive --new-file v2.2.5/linux/drivers/sound/es1370.c linux/drivers/sound/es1370.c --- v2.2.5/linux/drivers/sound/es1370.c Mon Mar 29 11:09:11 1999 +++ linux/drivers/sound/es1370.c Mon Apr 12 16:18:27 1999 @@ -3,7 +3,7 @@ /* * es1370.c -- Ensoniq ES1370/Asahi Kasei AK4531 audio driver. * - * Copyright (C) 1998 Thomas Sailer (sailer@ife.ee.ethz.ch) + * Copyright (C) 1998-1999 Thomas Sailer (sailer@ife.ee.ethz.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 @@ -87,6 +87,11 @@ * reported by Johan Maes * 22.03.99 0.19 return EAGAIN instead of EBUSY when O_NONBLOCK * read/write cannot be executed + * 07.04.99 0.20 implemented the following ioctl's: SOUND_PCM_READ_RATE, + * SOUND_PCM_READ_CHANNELS, SOUND_PCM_READ_BITS; + * Alpha fixes reported by Peter Jones + * Note: joystick address handling might still be wrong on archs + * other than i386 * * some important things missing in Ensoniq documentation: * @@ -287,7 +292,8 @@ int dev_midi; /* hardware resources */ - unsigned int io, irq; + unsigned long io; /* long for SPARC */ + unsigned int irq; /* mixer registers; there is no HW readback */ struct { @@ -1526,11 +1532,19 @@ s->dma_dac2.subdivision = val; return 0; - case SOUND_PCM_WRITE_FILTER: - case SNDCTL_DSP_SETSYNCRO: case SOUND_PCM_READ_RATE: + return put_user(DAC2_DIVTOSR((s->ctrl & CTRL_PCLKDIV) >> CTRL_SH_PCLKDIV), (int *)arg); + case SOUND_PCM_READ_CHANNELS: + return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SMB : SCTRL_P2SMB)) ? + 2 : 1, (int *)arg); + case SOUND_PCM_READ_BITS: + return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SEB : SCTRL_P2SEB)) ? + 16 : 8, (int *)arg); + + case SOUND_PCM_WRITE_FILTER: + case SNDCTL_DSP_SETSYNCRO: case SOUND_PCM_READ_FILTER: return -EINVAL; @@ -1903,11 +1917,17 @@ s->dma_dac1.subdivision = val; return 0; - case SOUND_PCM_WRITE_FILTER: - case SNDCTL_DSP_SETSYNCRO: case SOUND_PCM_READ_RATE: + return put_user(dac1_samplerate[(s->ctrl & CTRL_WTSRSEL) >> CTRL_SH_WTSRSEL], (int *)arg); + case SOUND_PCM_READ_CHANNELS: + return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, (int *)arg); + case SOUND_PCM_READ_BITS: + return put_user((s->sctrl & SCTRL_P1SEB) ? 16 : 8, (int *)arg); + + case SOUND_PCM_WRITE_FILTER: + case SNDCTL_DSP_SETSYNCRO: case SOUND_PCM_READ_FILTER: return -EINVAL; @@ -2275,7 +2295,7 @@ if (!pci_present()) /* No PCI bus in this machine! */ return -ENODEV; - printk(KERN_INFO "es1370: version v0.19 time " __TIME__ " " __DATE__ "\n"); + printk(KERN_INFO "es1370: version v0.20 time " __TIME__ " " __DATE__ "\n"); while (index < NR_DEVICE && (pcidev = pci_find_device(PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_ES1370, pcidev))) { if (pcidev->base_address[0] == 0 || @@ -2299,7 +2319,7 @@ s->io = pcidev->base_address[0] & PCI_BASE_ADDRESS_IO_MASK; s->irq = pcidev->irq; if (check_region(s->io, ES1370_EXTENT)) { - printk(KERN_ERR "es1370: io ports %#x-%#x in use\n", s->io, s->io+ES1370_EXTENT-1); + printk(KERN_ERR "es1370: io ports %#lx-%#lx in use\n", s->io, s->io+ES1370_EXTENT-1); goto err_region; } request_region(s->io, ES1370_EXTENT, "es1370"); @@ -2320,7 +2340,7 @@ if (micz[index]) s->ctrl |= CTRL_XCTL1; s->sctrl = 0; - printk(KERN_INFO "es1370: found adapter at io %#06x irq %u\n" + printk(KERN_INFO "es1370: found adapter at io %#lx irq %u\n" KERN_INFO "es1370: features: joystick %s, line %s, mic impedance %s\n", s->io, s->irq, (s->ctrl & CTRL_JYSTK_EN) ? "on" : "off", (s->ctrl & CTRL_XCTL0) ? "out" : "in", diff -u --recursive --new-file v2.2.5/linux/drivers/sound/es1371.c linux/drivers/sound/es1371.c --- v2.2.5/linux/drivers/sound/es1371.c Mon Mar 29 11:09:11 1999 +++ linux/drivers/sound/es1371.c Mon Apr 12 16:18:27 1999 @@ -58,6 +58,13 @@ * reported by Johan Maes * 22.03.99 0.10 return EAGAIN instead of EBUSY when O_NONBLOCK * read/write cannot be executed + * 07.04.99 0.11 implemented the following ioctl's: SOUND_PCM_READ_RATE, + * SOUND_PCM_READ_CHANNELS, SOUND_PCM_READ_BITS; + * Alpha fixes reported by Peter Jones + * Another Alpha fix (wait_src_ready in init routine) + * reported by "Ivan N. Kokshaysky" + * Note: joystick address handling might still be wrong on archs + * other than i386 * */ @@ -334,7 +341,8 @@ int dev_midi; /* hardware resources */ - unsigned int io, irq; + unsigned long io; /* long for SPARC */ + unsigned int irq; /* mixer registers; there is no HW readback */ struct { @@ -1968,11 +1976,17 @@ s->dma_dac2.subdivision = val; return 0; - case SOUND_PCM_WRITE_FILTER: - case SNDCTL_DSP_SETSYNCRO: case SOUND_PCM_READ_RATE: + return put_user((file->f_mode & FMODE_READ) ? s->adcrate : s->dac2rate, (int *)arg); + case SOUND_PCM_READ_CHANNELS: + return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SMB : SCTRL_P2SMB)) ? 2 : 1, (int *)arg); + case SOUND_PCM_READ_BITS: + return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SEB : SCTRL_P2SEB)) ? 16 : 8, (int *)arg); + + case SOUND_PCM_WRITE_FILTER: + case SNDCTL_DSP_SETSYNCRO: case SOUND_PCM_READ_FILTER: return -EINVAL; @@ -2338,11 +2352,17 @@ s->dma_dac1.subdivision = val; return 0; - case SOUND_PCM_WRITE_FILTER: - case SNDCTL_DSP_SETSYNCRO: case SOUND_PCM_READ_RATE: + return put_user(s->dac1rate, (int *)arg); + case SOUND_PCM_READ_CHANNELS: + return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, (int *)arg); + case SOUND_PCM_READ_BITS: + return put_user((s->sctrl & SCTRL_P1SEB) ? 16 : 8, (int *)arg); + + case SOUND_PCM_WRITE_FILTER: + case SNDCTL_DSP_SETSYNCRO: case SOUND_PCM_READ_FILTER: return -EINVAL; @@ -2712,7 +2732,7 @@ if (!pci_present()) /* No PCI bus in this machine! */ return -ENODEV; - printk(KERN_INFO "es1371: version v0.10 time " __TIME__ " " __DATE__ "\n"); + printk(KERN_INFO "es1371: version v0.11 time " __TIME__ " " __DATE__ "\n"); while (index < NR_DEVICE && (pcidev = pci_find_device(PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_ES1371, pcidev))) { if (pcidev->base_address[0] == 0 || @@ -2736,7 +2756,7 @@ s->io = pcidev->base_address[0] & PCI_BASE_ADDRESS_IO_MASK; s->irq = pcidev->irq; if (check_region(s->io, ES1371_EXTENT)) { - printk(KERN_ERR "es1371: io ports %#x-%#x in use\n", s->io, s->io+ES1371_EXTENT-1); + printk(KERN_ERR "es1371: io ports %#lx-%#lx in use\n", s->io, s->io+ES1371_EXTENT-1); goto err_region; } request_region(s->io, ES1371_EXTENT, "es1371"); @@ -2744,7 +2764,7 @@ printk(KERN_ERR "es1371: irq %u in use\n", s->irq); goto err_irq; } - printk(KERN_INFO "es1371: found adapter at io %#06x irq %u\n" + printk(KERN_INFO "es1371: found adapter at io %#lx irq %u\n" KERN_INFO "es1371: features: joystick 0x%x\n", s->io, s->irq, joystick[index]); /* register devices */ if ((s->dev_audio = register_sound_dsp(&es1371_audio_fops, -1)) < 0) @@ -2796,6 +2816,7 @@ * be stuck high, and I've found no way to rectify this other than * power cycle) */ + wait_src_ready(s); outl(0, s->io+ES1371_REG_SRCONV); /* codec init */ wrcodec(s, 0x00, 0); /* reset codec */ diff -u --recursive --new-file v2.2.5/linux/drivers/sound/sb.h linux/drivers/sound/sb.h --- v2.2.5/linux/drivers/sound/sb.h Wed Mar 10 15:29:47 1999 +++ linux/drivers/sound/sb.h Mon Apr 12 16:18:27 1999 @@ -48,6 +48,7 @@ #define MDL_ES1868MIDI 14 /* MIDI port of ESS1868 */ #define MDL_AEDSP 15 /* Audio Excel DSP 16 */ #define MDL_ESSPCI 16 /* ESS PCI card */ +#define MDL_YMPCI 17 /* Yamaha PCI sb in emulation */ #define SUBMDL_ALS007 42 /* ALS-007 differs from SB16 only in mixer */ /* register assignment */ diff -u --recursive --new-file v2.2.5/linux/drivers/sound/sb_card.c linux/drivers/sound/sb_card.c --- v2.2.5/linux/drivers/sound/sb_card.c Wed Mar 10 15:29:47 1999 +++ linux/drivers/sound/sb_card.c Mon Apr 12 16:18:27 1999 @@ -222,5 +222,8 @@ EXPORT_SYMBOL(probe_sb); EXPORT_SYMBOL(unload_sb); EXPORT_SYMBOL(sb_be_quiet); +EXPORT_SYMBOL(attach_sbmpu); +EXPORT_SYMBOL(probe_sbmpu); +EXPORT_SYMBOL(unload_sbmpu); #endif diff -u --recursive --new-file v2.2.5/linux/drivers/sound/sb_common.c linux/drivers/sound/sb_common.c --- v2.2.5/linux/drivers/sound/sb_common.c Wed Mar 10 15:29:47 1999 +++ linux/drivers/sound/sb_common.c Mon Apr 12 16:18:27 1999 @@ -261,7 +261,7 @@ } } } - DDB(printk("DSP version %d.%d\n", devc->major, devc->minor)); + DDB(printk("DSP version %d.%02d\n", devc->major, devc->minor)); restore_flags(flags); } @@ -532,8 +532,12 @@ if(pci == SB_PCI_YAMAHA) { + devc->model = MDL_YMPCI; devc->caps |= SB_PCI_IRQ; hw_config->driver_use_1 |= SB_PCI_IRQ; + hw_config->card_subtype = MDL_YMPCI; + + printk("Yamaha PCI mode.\n"); } if (acer) @@ -600,6 +604,12 @@ if(devc->type == MDL_ESSPCI) devc->model = MDL_ESSPCI; + if(devc->type == MDL_YMPCI) + { + printk("YMPCI selected\n"); + devc->model = MDL_YMPCI; + } + /* * Save device information for sb_dsp_init() */ @@ -612,7 +622,7 @@ return 0; } memcpy((char *) detected_devc, (char *) devc, sizeof(sb_devc)); - MDB(printk(KERN_INFO "SB %d.%d detected OK (%x)\n", devc->major, devc->minor, hw_config->io_base)); + MDB(printk(KERN_INFO "SB %d.%02d detected OK (%x)\n", devc->major, devc->minor, hw_config->io_base)); return 1; } @@ -648,7 +658,7 @@ devc->caps = hw_config->driver_use_1; - if (!(devc->caps & SB_NO_AUDIO && devc->caps & SB_NO_MIDI) && hw_config->irq > 0) + if (!((devc->caps & SB_NO_AUDIO) && (devc->caps & SB_NO_MIDI)) && hw_config->irq > 0) { /* IRQ setup */ /* @@ -807,7 +817,7 @@ if (hw_config->name == NULL) hw_config->name = "Sound Blaster (8 BIT/MONO ONLY)"; - sprintf(name, "%s (%d.%d)", hw_config->name, devc->major, devc->minor); + sprintf(name, "%s (%d.%02d)", hw_config->name, devc->major, devc->minor); conf_printf(name, hw_config); /* @@ -828,7 +838,7 @@ } else if (!sb_be_quiet && devc->model == MDL_SBPRO) { - printk(KERN_INFO "SB DSP version is just %d.%d which means that your card is\n", devc->major, devc->minor); + printk(KERN_INFO "SB DSP version is just %d.%02d which means that your card is\n", devc->major, devc->minor); printk(KERN_INFO "several years old (8 bit only device) or alternatively the sound driver\n"); printk(KERN_INFO "is incorrectly configured.\n"); } @@ -1233,6 +1243,10 @@ return 0; break; + case MDL_YMPCI: + hw_config->name = "Yamaha PCI Legacy"; + printk("Yamaha PCI legacy UART401 check.\n"); + break; default: return 0; } diff -u --recursive --new-file v2.2.5/linux/drivers/sound/sb_mixer.c linux/drivers/sound/sb_mixer.c --- v2.2.5/linux/drivers/sound/sb_mixer.c Wed Mar 10 15:29:47 1999 +++ linux/drivers/sound/sb_mixer.c Mon Apr 12 16:18:27 1999 @@ -674,6 +674,7 @@ switch (devc->model) { case MDL_ESSPCI: + case MDL_YMPCI: case MDL_SBPRO: case MDL_AZTECH: case MDL_JAZZ: diff -u --recursive --new-file v2.2.5/linux/drivers/sound/sonicvibes.c linux/drivers/sound/sonicvibes.c --- v2.2.5/linux/drivers/sound/sonicvibes.c Mon Mar 29 11:09:11 1999 +++ linux/drivers/sound/sonicvibes.c Mon Apr 12 16:18:27 1999 @@ -3,7 +3,7 @@ /* * sonicvibes.c -- S3 Sonic Vibes audio driver. * - * Copyright (C) 1998 Thomas Sailer (sailer@ife.ee.ethz.ch) + * Copyright (C) 1998-1999 Thomas Sailer (sailer@ife.ee.ethz.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 @@ -55,6 +55,19 @@ * reported by Johan Maes * 22.03.99 0.12 return EAGAIN instead of EBUSY when O_NONBLOCK * read/write cannot be executed + * 05.04.99 0.13 added code to sv_read and sv_write which should detect + * lockups of the sound chip and revive it. This is basically + * an ugly hack, but at least applications using this driver + * won't hang forever. I don't know why these lockups happen, + * it might well be the motherboard chipset (an early 486 PCI + * board with ALI chipset), since every busmastering 100MB + * ethernet card I've tried (Realtek 8139 and Macronix tulip clone) + * exhibit similar behaviour (they work for a couple of packets + * and then lock up and can be revived by ifconfig down/up). + * 07.04.99 0.14 implemented the following ioctl's: SOUND_PCM_READ_RATE, + * SOUND_PCM_READ_CHANNELS, SOUND_PCM_READ_BITS; + * Alpha fixes reported by Peter Jones + * Note: dmaio hack might still be wrong on archs other than i386 * */ @@ -255,7 +268,8 @@ int dev_dmfm; /* hardware resources */ - unsigned int iosb, ioenh, iosynth, iomidi, iogame, iodmaa, iodmac, irq; + unsigned long iosb, ioenh, iosynth, iomidi, iogame; /* long for SPARC */ + unsigned int iodmaa, iodmac, irq; /* mixer stuff */ struct { @@ -1298,7 +1312,19 @@ start_adc(s); if (file->f_flags & O_NONBLOCK) return ret ? ret : -EAGAIN; - interruptible_sleep_on(&s->dma_adc.wait); + if (!interruptible_sleep_on_timeout(&s->dma_adc.wait, HZ)) { + printk(KERN_DEBUG "sv: read: chip lockup? dmasz %u fragsz %u count %i hwptr %u swptr %u\n", + s->dma_adc.dmasize, s->dma_adc.fragsize, s->dma_adc.count, + s->dma_adc.hwptr, s->dma_adc.swptr); + stop_adc(s); + spin_lock_irqsave(&s->lock, flags); + set_dmac(s, virt_to_bus(s->dma_adc.rawbuf), s->dma_adc.numfrag << s->dma_adc.fragshift); + /* program enhanced mode registers */ + wrindir(s, SV_CIDMACBASECOUNT1, (s->dma_adc.fragsamples-1) >> 8); + wrindir(s, SV_CIDMACBASECOUNT0, s->dma_adc.fragsamples-1); + s->dma_adc.count = s->dma_adc.hwptr = s->dma_adc.swptr = 0; + spin_unlock_irqrestore(&s->lock, flags); + } if (signal_pending(current)) return ret ? ret : -ERESTARTSYS; continue; @@ -1358,7 +1384,19 @@ start_dac(s); if (file->f_flags & O_NONBLOCK) return ret ? ret : -EAGAIN; - interruptible_sleep_on(&s->dma_dac.wait); + if (!interruptible_sleep_on_timeout(&s->dma_dac.wait, HZ)) { + printk(KERN_DEBUG "sv: write: chip lockup? dmasz %u fragsz %u count %i hwptr %u swptr %u\n", + s->dma_dac.dmasize, s->dma_dac.fragsize, s->dma_dac.count, + s->dma_dac.hwptr, s->dma_dac.swptr); + stop_dac(s); + spin_lock_irqsave(&s->lock, flags); + set_dmaa(s, virt_to_bus(s->dma_dac.rawbuf), s->dma_dac.numfrag << s->dma_dac.fragshift); + /* program enhanced mode registers */ + wrindir(s, SV_CIDMAABASECOUNT1, (s->dma_dac.fragsamples-1) >> 8); + wrindir(s, SV_CIDMAABASECOUNT0, s->dma_dac.fragsamples-1); + s->dma_dac.count = s->dma_dac.hwptr = s->dma_dac.swptr = 0; + spin_unlock_irqrestore(&s->lock, flags); + } if (signal_pending(current)) return ret ? ret : -ERESTARTSYS; continue; @@ -1717,11 +1755,19 @@ s->dma_dac.subdivision = val; return 0; - case SOUND_PCM_WRITE_FILTER: - case SNDCTL_DSP_SETSYNCRO: case SOUND_PCM_READ_RATE: + return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, (int *)arg); + case SOUND_PCM_READ_CHANNELS: + return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (SV_CFMT_STEREO << SV_CFMT_CSHIFT) + : (SV_CFMT_STEREO << SV_CFMT_ASHIFT))) ? 2 : 1, (int *)arg); + case SOUND_PCM_READ_BITS: + return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (SV_CFMT_16BIT << SV_CFMT_CSHIFT) + : (SV_CFMT_16BIT << SV_CFMT_ASHIFT))) ? 16 : 8, (int *)arg); + + case SOUND_PCM_WRITE_FILTER: + case SNDCTL_DSP_SETSYNCRO: case SOUND_PCM_READ_FILTER: return -EINVAL; @@ -2275,7 +2321,7 @@ if (!pci_present()) /* No PCI bus in this machine! */ return -ENODEV; - printk(KERN_INFO "sv: version v0.12 time " __TIME__ " " __DATE__ "\n"); + printk(KERN_INFO "sv: version v0.14 time " __TIME__ " " __DATE__ "\n"); #if 0 if (!(wavetable_mem = __get_free_pages(GFP_KERNEL, 20-PAGE_SHIFT))) printk(KERN_INFO "sv: cannot allocate 1MB of contiguous nonpageable memory for wavetable data\n"); @@ -2329,7 +2375,7 @@ } pci_write_config_dword(pcidev, 0x40, s->iodmaa | 9); /* enable and use extended mode */ pci_write_config_dword(pcidev, 0x48, s->iodmac | 9); /* enable */ - printk(KERN_DEBUG "sv: io ports: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", + printk(KERN_DEBUG "sv: io ports: %#lx %#lx %#lx %#lx %#lx %#x %#x\n", s->iosb, s->ioenh, s->iosynth, s->iomidi, s->iogame, s->iodmaa, s->iodmac); if (s->ioenh == 0 || s->iodmaa == 0 || s->iodmac == 0) continue; @@ -2339,7 +2385,7 @@ pci_write_config_dword(pcidev, 0x60, wavetable_mem >> 12); /* wavetable base address */ if (check_region(s->ioenh, SV_EXTENT_ENH)) { - printk(KERN_ERR "sv: io ports %#x-%#x in use\n", s->ioenh, s->ioenh+SV_EXTENT_ENH-1); + printk(KERN_ERR "sv: io ports %#lx-%#lx in use\n", s->ioenh, s->ioenh+SV_EXTENT_ENH-1); goto err_region5; } request_region(s->ioenh, SV_EXTENT_ENH, "S3 SonicVibes PCM"); @@ -2354,12 +2400,12 @@ } request_region(s->iodmac, SV_EXTENT_DMA, "S3 SonicVibes DMAC"); if (check_region(s->iomidi, SV_EXTENT_MIDI)) { - printk(KERN_ERR "sv: io ports %#x-%#x in use\n", s->iomidi, s->iomidi+SV_EXTENT_MIDI-1); + printk(KERN_ERR "sv: io ports %#lx-%#lx in use\n", s->iomidi, s->iomidi+SV_EXTENT_MIDI-1); goto err_region2; } request_region(s->iomidi, SV_EXTENT_MIDI, "S3 SonicVibes Midi"); if (check_region(s->iosynth, SV_EXTENT_SYNTH)) { - printk(KERN_ERR "sv: io ports %#x-%#x in use\n", s->iosynth, s->iosynth+SV_EXTENT_SYNTH-1); + printk(KERN_ERR "sv: io ports %#lx-%#lx in use\n", s->iosynth, s->iosynth+SV_EXTENT_SYNTH-1); goto err_region1; } request_region(s->iosynth, SV_EXTENT_SYNTH, "S3 SonicVibes Synth"); @@ -2390,7 +2436,7 @@ printk(KERN_ERR "sv: irq %u in use\n", s->irq); goto err_irq; } - printk(KERN_INFO "sv: found adapter at io %#06x irq %u dmaa %#06x dmac %#06x revision %u\n", + printk(KERN_INFO "sv: found adapter at io %#lx irq %u dmaa %#06x dmac %#06x revision %u\n", s->ioenh, s->irq, s->iodmaa, s->iodmac, rdindir(s, SV_CIREVISION)); /* register devices */ if ((s->dev_audio = register_sound_dsp(&sv_audio_fops, -1)) < 0) diff -u --recursive --new-file v2.2.5/linux/drivers/sound/sscape.c linux/drivers/sound/sscape.c --- v2.2.5/linux/drivers/sound/sscape.c Sun Nov 8 14:03:04 1998 +++ linux/drivers/sound/sscape.c Mon Apr 12 16:18:27 1999 @@ -943,7 +943,9 @@ mpu_config.irq = mpu_irq; mpu_config.io_base = mpu_io; - + /* WEH - Try to get right dma channel */ + mpu_config.dma = dma; + if(spea != -1) { old_hardware = spea; diff -u --recursive --new-file v2.2.5/linux/drivers/video/promcon.c linux/drivers/video/promcon.c --- v2.2.5/linux/drivers/video/promcon.c Tue Mar 23 14:35:48 1999 +++ linux/drivers/video/promcon.c Fri Apr 16 08:20:23 1999 @@ -5,6 +5,7 @@ * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) */ +#include #include #include #include diff -u --recursive --new-file v2.2.5/linux/drivers/video/sgivwfb.c linux/drivers/video/sgivwfb.c --- v2.2.5/linux/drivers/video/sgivwfb.c Tue Mar 23 14:35:48 1999 +++ linux/drivers/video/sgivwfb.c Fri Apr 16 08:20:23 1999 @@ -9,6 +9,7 @@ * more details. */ +#include #include #include #include diff -u --recursive --new-file v2.2.5/linux/drivers/video/vesafb.c linux/drivers/video/vesafb.c --- v2.2.5/linux/drivers/video/vesafb.c Wed Mar 10 15:29:48 1999 +++ linux/drivers/video/vesafb.c Mon Apr 12 09:57:34 1999 @@ -93,6 +93,7 @@ } fbcon_cmap; static int inverse = 0; +static int mtrr = 0; static int currcon = 0; static int pmi_setpal = 0; /* pmi for palette changes ??? */ @@ -495,6 +496,8 @@ pmi_setpal=0; else if (! strcmp(this_opt, "pmipal")) pmi_setpal=1; + else if (! strcmp(this_opt, "mtrr")) + mtrr=1; else if (!strncmp(this_opt, "font:", 5)) strcpy(fb_info.fontname, this_opt+5); } @@ -633,7 +636,8 @@ } request_region(0x3c0, 32, "vga+"); #ifdef CONFIG_MTRR - mtrr_add((unsigned long)video_base, video_size, MTRR_TYPE_WRCOMB, 1); + if (mtrr) + mtrr_add((unsigned long)video_base, video_size, MTRR_TYPE_WRCOMB, 1); #endif strcpy(fb_info.modename, "VESA VGA"); diff -u --recursive --new-file v2.2.5/linux/fs/affs/namei.c linux/fs/affs/namei.c --- v2.2.5/linux/fs/affs/namei.c Tue Dec 22 14:16:57 1998 +++ linux/fs/affs/namei.c Mon Apr 12 10:03:45 1999 @@ -548,32 +548,14 @@ "No inode for entry found (key=%lu)\n",new_ino); goto end_rename; } - if (new_inode == old_inode) { - if (old_ino == new_ino) { /* Filename might have changed case */ - retval = new_dentry->d_name.len < 31 ? new_dentry->d_name.len : 30; - strncpy(DIR_END(old_bh->b_data,old_inode)->dir_name + 1, - new_dentry->d_name.name,retval); - DIR_END(old_bh->b_data,old_inode)->dir_name[0] = retval; - goto new_checksum; - } - retval = 0; - goto end_rename; - } if (S_ISDIR(old_inode->i_mode)) { - retval = -EINVAL; - if (is_subdir(new_dentry, old_dentry)) - goto end_rename; if (new_inode) { - if (new_dentry->d_count > 1) - shrink_dcache_parent(new_dentry); - retval = -EBUSY; - if (new_dentry->d_count > 1) - goto end_rename; retval = -ENOTEMPTY; if (!empty_dir(new_bh,AFFS_I2HSIZE(new_inode))) goto end_rename; } + retval = -ENOENT; if (affs_parent_ino(old_inode) != old_dir->i_ino) goto end_rename; } @@ -593,7 +575,6 @@ affs_copy_name(FILE_END(old_bh->b_data,old_inode)->file_name,new_dentry->d_name.name); if ((retval = affs_insert_hash(new_dir->i_ino,old_bh,new_dir))) goto end_rename; -new_checksum: affs_fix_checksum(AFFS_I2BSIZE(new_dir),old_bh->b_data,5); new_dir->i_ctime = new_dir->i_mtime = old_dir->i_ctime @@ -604,7 +585,6 @@ mark_inode_dirty(new_dir); mark_inode_dirty(old_dir); mark_buffer_dirty(old_bh,1); - d_move(old_dentry,new_dentry); end_rename: affs_brelse(old_bh); diff -u --recursive --new-file v2.2.5/linux/fs/coda/dir.c linux/fs/coda/dir.c --- v2.2.5/linux/fs/coda/dir.c Mon Jan 25 17:44:34 1999 +++ linux/fs/coda/dir.c Mon Apr 12 10:03:45 1999 @@ -246,12 +246,6 @@ dircnp = ITOC(dir); - if ( length > CODA_MAXNAMLEN ) { - printk("name too long: create, %s(%s)\n", - coda_f2s(&dircnp->c_fid), name); - return -ENAMETOOLONG; - } - error = venus_create(dir->i_sb, &(dircnp->c_fid), name, length, 0, mode, 0, &newfid, &attrs); @@ -302,12 +296,6 @@ dircnp = ITOC(dir); - if ( length > CODA_MAXNAMLEN ) { - printk("name too long: mknod, %s(%s)\n", - coda_f2s(&dircnp->c_fid), name); - return -ENAMETOOLONG; - } - error = venus_create(dir->i_sb, &(dircnp->c_fid), name, length, 0, mode, rdev, &newfid, &attrs); @@ -349,9 +337,6 @@ return -ENOENT; } - if ( len > CODA_MAXNAMLEN ) - return -ENAMETOOLONG; - if (coda_isroot(dir) && coda_iscontrol(name, len)) return -EPERM; @@ -409,11 +394,6 @@ CDEBUG(D_INODE, "old: fid: %s\n", coda_f2s(&(cnp->c_fid))); CDEBUG(D_INODE, "directory: %s\n", coda_f2s(&(dir_cnp->c_fid))); - if ( len > CODA_MAXNAMLEN ) { - printk("coda_link: name too long. \n"); - return -ENAMETOOLONG; - } - error = venus_link(dir_inode->i_sb,&(cnp->c_fid), &(dir_cnp->c_fid), (const char *)name, len); @@ -448,9 +428,6 @@ if (coda_isroot(dir_inode) && coda_iscontrol(name, len)) return -EPERM; - if ( len > CODA_MAXNAMLEN ) - return -ENAMETOOLONG; - symlen = strlen(symname); if ( symlen > CODA_MAXPATHLEN ) return -ENAMETOOLONG; @@ -519,9 +496,6 @@ } dircnp = ITOC(dir); - if (len > CODA_MAXNAMLEN) - return -ENAMETOOLONG; - if (!list_empty(&de->d_hash)) return -EBUSY; error = venus_rmdir(dir->i_sb, &(dircnp->c_fid), name, len); @@ -545,7 +519,6 @@ const char *new_name = new_dentry->d_name.name; int old_length = old_dentry->d_name.len; int new_length = new_dentry->d_name.len; - struct inode *old_inode = old_dentry->d_inode; struct inode *new_inode = new_dentry->d_inode; struct coda_inode_info *new_cnp, *old_cnp; int error; @@ -553,10 +526,6 @@ ENTRY; coda_vfs_stat.rename++; - if ( (old_length > CODA_MAXNAMLEN) || new_length > CODA_MAXNAMLEN ) { - return -ENAMETOOLONG; - } - old_cnp = ITOC(old_dir); new_cnp = ITOC(new_dir); @@ -565,21 +534,6 @@ old_name, old_length, strlen(old_name), new_name, new_length, strlen(new_name),old_dentry->d_count, new_dentry->d_count); - if (new_inode == old_inode) - return 0; - - /* make sure target is not in use */ - if (new_inode && S_ISDIR(new_inode->i_mode)) { - /* - * Prune any children before testing for busy. - */ - if (new_dentry->d_count > 1) - shrink_dcache_parent(new_dentry); - - if (new_dentry->d_count > 1) - return -EBUSY; - } - /* the C library will do unlink/create etc */ if ( coda_crossvol_rename == 0 && old_cnp->c_fid.Volume != new_cnp->c_fid.Volume ) @@ -599,7 +553,6 @@ coda_flag_inode(new_dir, C_VATTR); CDEBUG(D_INODE, "result %d\n", error); - d_move(old_dentry, new_dentry); EXIT; return 0; @@ -637,7 +590,9 @@ result = coda_venus_readdir(&open_file, dirent, filldir); } else { /* potemkin case: we are handed a directory inode */ + down(&cnp->c_ovp->i_sem); result = open_file.f_op->readdir(&open_file, dirent, filldir); + up(&cnp->c_ovp->i_sem); } coda_restore_codafile(inode, file, cnp->c_ovp, &open_file); EXIT; diff -u --recursive --new-file v2.2.5/linux/fs/ext2/namei.c linux/fs/ext2/namei.c --- v2.2.5/linux/fs/ext2/namei.c Tue Dec 22 14:16:57 1998 +++ linux/fs/ext2/namei.c Mon Apr 12 10:03:45 1999 @@ -218,12 +218,6 @@ return NULL; sb = dir->i_sb; - if (namelen > EXT2_NAME_LEN) - { - *err = -ENAMETOOLONG; - return NULL; - } - if (!namelen) return NULL; /* @@ -409,10 +403,6 @@ struct ext2_dir_entry_2 * de; int err = -EIO; - err = -ENAMETOOLONG; - if (dentry->d_name.len > EXT2_NAME_LEN) - goto out; - inode = ext2_new_inode (dir, mode, &err); if (!inode) goto out; @@ -474,10 +464,6 @@ struct ext2_dir_entry_2 * de; int err; - err = -ENAMETOOLONG; - if (dentry->d_name.len > EXT2_NAME_LEN) - goto out; - err = -EMLINK; if (dir->i_nlink >= EXT2_LINK_MAX) goto out; @@ -618,10 +604,6 @@ struct buffer_head * bh; struct ext2_dir_entry_2 * de; - retval = -ENAMETOOLONG; - if (dentry->d_name.len > EXT2_NAME_LEN) - goto out; - retval = -ENOENT; bh = ext2_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &de); if (!bh) @@ -634,14 +616,12 @@ if (le32_to_cpu(de->inode) != inode->i_ino) goto end_rmdir; + retval = -ENOTEMPTY; if (!empty_dir (inode)) - retval = -ENOTEMPTY; - else if (le32_to_cpu(de->inode) != inode->i_ino) - retval = -ENOENT; - else { - retval = ext2_delete_entry (de, bh); - dir->i_version = ++event; - } + goto end_rmdir; + + retval = ext2_delete_entry (de, bh); + dir->i_version = ++event; if (retval) goto end_rmdir; mark_buffer_dirty(bh, 1); @@ -665,7 +645,6 @@ end_rmdir: brelse (bh); -out: return retval; } @@ -676,10 +655,6 @@ struct buffer_head * bh; struct ext2_dir_entry_2 * de; - retval = -ENAMETOOLONG; - if (dentry->d_name.len > EXT2_NAME_LEN) - goto out; - retval = -ENOENT; bh = ext2_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &de); if (!bh) @@ -718,7 +693,6 @@ end_unlink: brelse (bh); -out: return retval; } @@ -805,9 +779,6 @@ if (S_ISDIR(inode->i_mode)) return -EPERM; - if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) - return -EPERM; - if (inode->i_nlink >= EXT2_LINK_MAX) return -EMLINK; @@ -851,17 +822,10 @@ le16_to_cpu(((struct ext2_dir_entry_2 *) buffer)->rec_len)))->inode /* - * rename uses retrying to avoid race-conditions: at least they should be - * minimal. - * it tries to allocate all the blocks, then sanity-checks, and if the sanity- - * checks fail, it tries to restart itself again. Very practical - no changes - * are done until we know everything works ok.. and then all the changes can be - * done in one fell swoop when we have claimed all the buffers needed. - * * Anybody can rename anything with this: the permission checks are left to the * higher-level routines. */ -static int do_ext2_rename (struct inode * old_dir, struct dentry *old_dentry, +int ext2_rename (struct inode * old_dir, struct dentry *old_dentry, struct inode * new_dir,struct dentry *new_dentry) { struct inode * old_inode, * new_inode; @@ -870,9 +834,6 @@ int retval; old_bh = new_bh = dir_bh = NULL; - retval = -ENAMETOOLONG; - if (old_dentry->d_name.len > EXT2_NAME_LEN) - goto end_rename; old_bh = ext2_find_entry (old_dir, old_dentry->d_name.name, old_dentry->d_name.len, &old_de); /* @@ -897,24 +858,13 @@ DQUOT_INIT(new_inode); } } - retval = 0; - if (new_inode == old_inode) - goto end_rename; if (S_ISDIR(old_inode->i_mode)) { - retval = -EINVAL; - if (is_subdir(new_dentry, old_dentry)) - goto end_rename; if (new_inode) { - /* Prune any children before testing for busy */ - if (new_dentry->d_count > 1) - shrink_dcache_parent(new_dentry); - retval = -EBUSY; - if (new_dentry->d_count > 1) - goto end_rename; retval = -ENOTEMPTY; if (!empty_dir (new_inode)) goto end_rename; } + retval = -EIO; dir_bh = ext2_bread (old_inode, 0, 0, &retval); if (!dir_bh) goto end_rename; @@ -977,8 +927,6 @@ wait_on_buffer (new_bh); } - /* Update the dcache */ - d_move(old_dentry, new_dentry); retval = 0; end_rename: @@ -986,31 +934,4 @@ brelse (old_bh); brelse (new_bh); return retval; -} - -/* - * Ok, rename also locks out other renames, as they can change the parent of - * a directory, and we don't want any races. Other races are checked for by - * "do_rename()", which restarts if there are inconsistencies. - * - * Note that there is no race between different filesystems: it's only within - * the same device that races occur: many renames can happen at once, as long - * as they are on different partitions. - * - * In the second extended file system, we use a lock flag stored in the memory - * super-block. This way, we really lock other renames only if they occur - * on the same file system - */ -int ext2_rename (struct inode * old_dir, struct dentry *old_dentry, - struct inode * new_dir, struct dentry *new_dentry) -{ - int result; - - while (old_dir->i_sb->u.ext2_sb.s_rename_lock) - sleep_on (&old_dir->i_sb->u.ext2_sb.s_rename_wait); - old_dir->i_sb->u.ext2_sb.s_rename_lock = 1; - result = do_ext2_rename (old_dir, old_dentry, new_dir, new_dentry); - old_dir->i_sb->u.ext2_sb.s_rename_lock = 0; - wake_up (&old_dir->i_sb->u.ext2_sb.s_rename_wait); - return result; } diff -u --recursive --new-file v2.2.5/linux/fs/ext2/super.c linux/fs/ext2/super.c --- v2.2.5/linux/fs/ext2/super.c Tue Mar 23 14:35:48 1999 +++ linux/fs/ext2/super.c Mon Apr 12 10:03:45 1999 @@ -543,8 +543,6 @@ else sb->u.ext2_sb.s_resgid = le16_to_cpu(es->s_def_resgid); sb->u.ext2_sb.s_mount_state = le16_to_cpu(es->s_state); - sb->u.ext2_sb.s_rename_lock = 0; - sb->u.ext2_sb.s_rename_wait = NULL; sb->u.ext2_sb.s_addr_per_block_bits = log2 (EXT2_ADDR_PER_BLOCK(sb)); sb->u.ext2_sb.s_desc_per_block_bits = diff -u --recursive --new-file v2.2.5/linux/fs/fat/inode.c linux/fs/fat/inode.c --- v2.2.5/linux/fs/fat/inode.c Thu Jan 7 15:11:38 1999 +++ linux/fs/fat/inode.c Thu Apr 15 06:07:21 1999 @@ -3,6 +3,10 @@ * * Written 1992,1993 by Werner Almesberger * VFAT extensions by Gordon Chaffee, merged with msdos fs by Henrik Storner + * + * Fixes: + * + * Max Cohan: Fixed invalid FSINFO offset when info_sector is 0 */ #include @@ -362,8 +366,16 @@ fat32 = 1; MSDOS_SB(sb)->fat_length= CF_LE_W(b->fat32_length)*sector_mult; MSDOS_SB(sb)->root_cluster = CF_LE_L(b->root_cluster); - MSDOS_SB(sb)->fsinfo_offset = - CF_LE_W(b->info_sector) * logical_sector_size + 0x1e0; + + /* MC - if info_sector is 0, don't multiply by 0 */ + if(CF_LE_W(b->info_sector) == 0) { + MSDOS_SB(sb)->fsinfo_offset = + logical_sector_size + 0x1e0; + } else { + MSDOS_SB(sb)->fsinfo_offset = + (CF_LE_W(b->info_sector) * logical_sector_size) + + 0x1e0; + } if (MSDOS_SB(sb)->fsinfo_offset + sizeof(struct fat_boot_fsinfo) > sb->s_blocksize) { printk("fat_read_super: Bad fsinfo_offset\n"); fat_brelse(sb, bh); diff -u --recursive --new-file v2.2.5/linux/fs/hfs/dir.c linux/fs/hfs/dir.c --- v2.2.5/linux/fs/hfs/dir.c Tue Dec 22 14:16:57 1998 +++ linux/fs/hfs/dir.c Mon Apr 12 10:03:45 1999 @@ -430,8 +430,6 @@ update_dirs_plus(new_parent, is_dir); } - /* update dcache */ - d_move(old_dentry, new_dentry); } hfs_rename_put: diff -u --recursive --new-file v2.2.5/linux/fs/inode.c linux/fs/inode.c --- v2.2.5/linux/fs/inode.c Tue Mar 23 14:35:48 1999 +++ linux/fs/inode.c Thu Apr 15 05:42:49 1999 @@ -529,15 +529,6 @@ } /* - * This gets called with I_LOCK held: it needs - * to read the inode and then unlock it - */ -static inline void read_inode(struct inode *inode, struct super_block *sb) -{ - sb->s_op->read_inode(inode); -} - -/* * This is called by things like the networking layer * etc that want to get an inode without any inode * number, or filesystems that allocate new inodes with @@ -606,7 +597,7 @@ spin_unlock(&inode_lock); clean_inode(inode); - read_inode(inode, sb); + sb->s_op->read_inode(inode); /* * This is special! We do not need the spinlock diff -u --recursive --new-file v2.2.5/linux/fs/minix/inode.c linux/fs/minix/inode.c --- v2.2.5/linux/fs/minix/inode.c Fri Nov 27 13:09:28 1998 +++ linux/fs/minix/inode.c Tue Apr 13 07:54:02 1999 @@ -195,8 +195,8 @@ s->u.minix_sb.s_ms = ms; s->u.minix_sb.s_sbh = bh; s->u.minix_sb.s_mount_state = ms->s_state; - s->s_blocksize = 1024; - s->s_blocksize_bits = 10; + s->s_blocksize = BLOCK_SIZE; + s->s_blocksize_bits = BLOCK_SIZE_BITS; s->u.minix_sb.s_ninodes = ms->s_ninodes; s->u.minix_sb.s_nzones = ms->s_nzones; s->u.minix_sb.s_imap_blocks = ms->s_imap_blocks; diff -u --recursive --new-file v2.2.5/linux/fs/minix/namei.c linux/fs/minix/namei.c --- v2.2.5/linux/fs/minix/namei.c Tue Dec 22 14:16:57 1998 +++ linux/fs/minix/namei.c Mon Apr 12 10:03:45 1999 @@ -604,7 +604,7 @@ * Anybody can rename anything with this: the permission checks are left to the * higher-level routines. */ -static int do_minix_rename(struct inode * old_dir, struct dentry *old_dentry, +int minix_rename(struct inode * old_dir, struct dentry *old_dentry, struct inode * new_dir, struct dentry *new_dentry) { struct inode * old_inode, * new_inode; @@ -640,24 +640,11 @@ new_bh = NULL; } } - if (new_inode == old_inode) { - retval = 0; - goto end_rename; - } if (S_ISDIR(old_inode->i_mode)) { - retval = -EINVAL; - if (is_subdir(new_dentry, old_dentry)) - goto end_rename; if (new_inode) { - /* Prune any children before testing for busy */ - if (new_dentry->d_count > 1) - shrink_dcache_parent(new_dentry); - retval = -EBUSY; - if (new_dentry->d_count > 1) retval = -ENOTEMPTY; if (!empty_dir(new_inode)) goto end_rename; - retval = -EBUSY; } retval = -EIO; dir_bh = minix_bread(old_inode,0,0); @@ -713,38 +700,10 @@ mark_inode_dirty(new_dir); } } - /* Update the dcache */ - d_move(old_dentry, new_dentry); retval = 0; end_rename: brelse(dir_bh); brelse(old_bh); brelse(new_bh); return retval; -} - -/* - * Ok, rename also locks out other renames, as they can change the parent of - * a directory, and we don't want any races. Other races are checked for by - * "do_rename()", which restarts if there are inconsistencies. - * - * Note that there is no race between different filesystems: it's only within - * the same device that races occur: many renames can happen at once, as long - * as they are on different partitions. - */ -int minix_rename(struct inode * old_dir, struct dentry *old_dentry, - struct inode * new_dir, struct dentry *new_dentry) -{ - static struct wait_queue * wait = NULL; - static int lock = 0; - int result; - - while (lock) - sleep_on(&wait); - lock = 1; - result = do_minix_rename(old_dir, old_dentry, - new_dir, new_dentry); - lock = 0; - wake_up(&wait); - return result; } diff -u --recursive --new-file v2.2.5/linux/fs/msdos/namei.c linux/fs/msdos/namei.c --- v2.2.5/linux/fs/msdos/namei.c Tue Dec 22 14:16:57 1998 +++ linux/fs/msdos/namei.c Mon Apr 12 10:03:45 1999 @@ -327,6 +327,7 @@ fat_date_unix2dos(dir->i_mtime,&de->time,&de->date); de->size = 0; fat_mark_buffer_dirty(sb, bh, 1); + if ((*result = iget(dir->i_sb,ino)) != NULL) msdos_read_inode(*result); fat_brelse(sb, bh); @@ -405,23 +406,22 @@ struct msdos_dir_entry *de; int result = 0; - if (MSDOS_I(dir)->i_start) { /* may be zero in mkdir */ - pos = 0; - bh = NULL; - while (fat_get_entry(dir,&pos,&bh,&de) > -1) { - /* Ignore vfat longname entries */ - if (de->attr == ATTR_EXT) - continue; - if (!IS_FREE(de->name) && - strncmp(de->name,MSDOS_DOT , MSDOS_NAME) && - strncmp(de->name,MSDOS_DOTDOT, MSDOS_NAME)) { - result = -ENOTEMPTY; - break; - } + pos = 0; + bh = NULL; + while (fat_get_entry(dir,&pos,&bh,&de) > -1) { + /* Ignore vfat longname entries */ + if (de->attr == ATTR_EXT) + continue; + if (!IS_FREE(de->name) && + strncmp(de->name,MSDOS_DOT , MSDOS_NAME) && + strncmp(de->name,MSDOS_DOTDOT, MSDOS_NAME)) { + result = -ENOTEMPTY; + break; } - if (bh) - fat_brelse(dir->i_sb, bh); } + if (bh) + fat_brelse(dir->i_sb, bh); + return result; } @@ -444,13 +444,8 @@ * whether it is empty. */ res = -EBUSY; - if (!list_empty(&dentry->d_hash)) { -#ifdef MSDOS_DEBUG -printk("msdos_rmdir: %s/%s busy, d_count=%d\n", -dentry->d_parent->d_name.name, dentry->d_name.name, dentry->d_count); -#endif + if (!list_empty(&dentry->d_hash)) goto rmdir_done; - } res = msdos_empty(inode); if (res) goto rmdir_done; @@ -503,14 +498,6 @@ dir->i_nlink++; inode->i_nlink = 2; /* no need to mark them dirty */ -#ifdef whatfor - /* - * He's dead, Jim. We don't d_instantiate anymore. Should do it - * from the very beginning, actually. - */ - MSDOS_I(inode)->i_busy = 1; /* prevent lookups */ -#endif - if ((res = fat_add_cluster(inode)) < 0) goto mkdir_error; if ((res = msdos_create_entry(inode,MSDOS_DOT,1,0,&dot)) < 0) @@ -529,9 +516,6 @@ MSDOS_I(dot)->i_logstart = MSDOS_I(dir)->i_logstart; dot->i_nlink = dir->i_nlink; mark_inode_dirty(dot); -#ifdef whatfor - MSDOS_I(inode)->i_busy = 0; -#endif iput(dot); d_instantiate(dentry, inode); res = 0; @@ -606,110 +590,9 @@ return msdos_unlinkx (dir,dentry,0); } -#define MSDOS_CHECK_BUSY 1 - -/***** Rename within a directory */ -static int msdos_rename_same(struct inode *old_dir,char *old_name, - struct dentry *old_dentry, - struct inode *new_dir,char *new_name,struct dentry *new_dentry, - struct buffer_head *old_bh, - struct msdos_dir_entry *old_de, int old_ino, int is_hid) -{ - struct super_block *sb = old_dir->i_sb; - struct buffer_head *new_bh; - struct msdos_dir_entry *new_de; - struct inode *new_inode,*old_inode; - int new_ino, exists, error; - - if (!strncmp(old_name, new_name, MSDOS_NAME)) - goto set_hid; - error = -ENOENT; - if (*(unsigned char *) old_de->name == DELETED_FLAG) - goto out; - - exists = fat_scan(new_dir,new_name,&new_bh,&new_de,&new_ino,SCAN_ANY) >= 0; - if (exists) { - error = -EIO; - new_inode = new_dentry->d_inode; - /* Make sure it really exists ... */ - if (!new_inode) { - printk(KERN_ERR - "msdos_rename_same: %s/%s inode NULL, ino=%d\n", - new_dentry->d_parent->d_name.name, - new_dentry->d_name.name, new_ino); - d_drop(new_dentry); - goto out_error; - } - error = S_ISDIR(new_inode->i_mode) - ? (old_de->attr & ATTR_DIR) - ? msdos_empty(new_inode) - : -EPERM - : (old_de->attr & ATTR_DIR) - ? -EPERM - : 0; - if (error) - goto out_error; - error = -EPERM; - if ((old_de->attr & ATTR_SYS)) - goto out_error; - - if (S_ISDIR(new_inode->i_mode)) { - /* make sure it's empty */ - error = msdos_empty(new_inode); - if (error) - goto out_error; -#ifdef MSDOS_CHECK_BUSY - /* check for a busy dentry */ - error = -EBUSY; - shrink_dcache_parent(new_dentry); - if (new_dentry->d_count > 1) { -printk("msdos_rename_same: %s/%s busy, count=%d\n", -new_dentry->d_parent->d_name.name, new_dentry->d_name.name, -new_dentry->d_count); - goto out_error; - } -#endif - new_dir->i_nlink--; - mark_inode_dirty(new_dir); - } - new_inode->i_nlink = 0; - MSDOS_I(new_inode)->i_busy = 1; - mark_inode_dirty(new_inode); - /* - * Make it negative if it's not busy; - * otherwise let d_move() drop it. - */ - if (new_dentry->d_count == 1) - d_delete(new_dentry); - - new_de->name[0] = DELETED_FLAG; - fat_mark_buffer_dirty(sb, new_bh, 1); - fat_brelse(sb, new_bh); - } - memcpy(old_de->name, new_name, MSDOS_NAME); - /* Update the dcache */ - d_move(old_dentry, new_dentry); -set_hid: - old_de->attr = is_hid - ? (old_de->attr | ATTR_HIDDEN) - : (old_de->attr &~ ATTR_HIDDEN); - fat_mark_buffer_dirty(sb, old_bh, 1); - /* update binary info for conversion, i_attrs */ - old_inode = old_dentry->d_inode; - MSDOS_I(old_inode)->i_attrs = is_hid - ? (MSDOS_I(old_inode)->i_attrs | ATTR_HIDDEN) - : (MSDOS_I(old_inode)->i_attrs &~ ATTR_HIDDEN); - error = 0; -out: - return error; - -out_error: - fat_brelse(sb, new_bh); - goto out; -} - +/* Now we could merge it with msdos_rename_same. Later */ /***** Rename across directories - a nonphysical move */ -static int msdos_rename_diff(struct inode *old_dir, char *old_name, +static int do_msdos_rename(struct inode *old_dir, char *old_name, struct dentry *old_dentry, struct inode *new_dir,char *new_name, struct dentry *new_dentry, struct buffer_head *old_bh, @@ -718,30 +601,27 @@ struct super_block *sb = old_dir->i_sb; struct buffer_head *new_bh,*free_bh,*dotdot_bh; struct msdos_dir_entry *new_de,*free_de,*dotdot_de; - struct inode *old_inode,*new_inode,*free_inode,*dotdot_inode; + struct inode *old_inode,*new_inode,*dotdot_inode; int new_ino,free_ino,dotdot_ino; int error, exists; - error = -EINVAL; - if (old_ino == new_dir->i_ino) - goto out; - /* prevent moving directory below itself */ - if (is_subdir(new_dentry, old_dentry)) - goto out; - + old_inode = old_dentry->d_inode; + if (old_dir==new_dir && !strncmp(old_name, new_name, MSDOS_NAME)) + goto set_hid; error = -ENOENT; if (*(unsigned char *) old_de->name == DELETED_FLAG) goto out; /* find free spot */ - while ((error = fat_scan(new_dir, NULL, &free_bh, &free_de, &free_ino, - SCAN_ANY)) < 0) { - if (error != -ENOENT) - goto out; - error = fat_add_cluster(new_dir); - if (error) - goto out; - } + if (new_dir!=old_dir) + while ((error = fat_scan(new_dir, NULL, &free_bh, &free_de, + &free_ino, SCAN_ANY)) < 0) { + if (error != -ENOENT) + goto out; + error = fat_add_cluster(new_dir); + if (error) + goto out; + } exists = fat_scan(new_dir,new_name,&new_bh,&new_de,&new_ino,SCAN_ANY) >= 0; if (exists) { /* Trash the old file! */ @@ -750,40 +630,17 @@ /* Make sure it really exists ... */ if (!new_inode) { printk(KERN_ERR - "msdos_rename_diff: %s/%s inode NULL, ino=%d\n", + "msdos_rename: %s/%s inode NULL, ino=%d\n", new_dentry->d_parent->d_name.name, new_dentry->d_name.name, new_ino); d_drop(new_dentry); goto out_new; } - error = S_ISDIR(new_inode->i_mode) - ? (old_de->attr & ATTR_DIR) - ? msdos_empty(new_inode) - : -EPERM - : (old_de->attr & ATTR_DIR) - ? -EPERM - : 0; - if (error) - goto out_new; error = -EPERM; if ((old_de->attr & ATTR_SYS)) goto out_new; -#ifdef MSDOS_CHECK_BUSY - /* check for a busy dentry */ - error = -EBUSY; - if (new_dentry->d_count > 1) { - shrink_dcache_parent(new_dentry); - if (new_dentry->d_count > 1) { -printk("msdos_rename_diff: target %s/%s busy, count=%d\n", -new_dentry->d_parent->d_name.name, new_dentry->d_name.name, -new_dentry->d_count); - goto out_new; - } - } -#endif if (S_ISDIR(new_inode->i_mode)) { - /* make sure it's empty */ error = msdos_empty(new_inode); if (error) goto out_new; @@ -793,18 +650,26 @@ new_inode->i_nlink = 0; MSDOS_I(new_inode)->i_busy = 1; mark_inode_dirty(new_inode); - /* - * Make it negative if it's not busy; - * otherwise let d_move() drop it. - */ - if (new_dentry->d_count == 1) - d_delete(new_dentry); + new_de->name[0] = DELETED_FLAG; fat_mark_buffer_dirty(sb, new_bh, 1); fat_brelse(sb, new_bh); } - old_inode = old_dentry->d_inode; + if (old_dir==new_dir) { + memcpy(old_de->name, new_name, MSDOS_NAME); +set_hid: + old_de->attr = is_hid + ? (old_de->attr | ATTR_HIDDEN) + : (old_de->attr &~ ATTR_HIDDEN); + fat_mark_buffer_dirty(sb, old_bh, 1); + MSDOS_I(old_inode)->i_attrs = is_hid + ? (MSDOS_I(old_inode)->i_attrs | ATTR_HIDDEN) + : (MSDOS_I(old_inode)->i_attrs &~ ATTR_HIDDEN); + error = 0; + goto out; + } + /* Get the dotdot inode if we'll need it ... */ dotdot_bh = NULL; dotdot_inode = NULL; @@ -824,73 +689,37 @@ goto out_dotdot; } - /* get an inode for the new name */ + /* + * Potential race here. It will go away when we'll switch to + * sane inumbers (along with a frigging lot of other races). + */ + + /* set new entry */ memcpy(free_de, old_de, sizeof(struct msdos_dir_entry)); memcpy(free_de->name, new_name, MSDOS_NAME); free_de->attr = is_hid ? (free_de->attr|ATTR_HIDDEN) : (free_de->attr&~ATTR_HIDDEN); - error = -EIO; - free_inode = iget(sb, free_ino); - if (!free_inode) - goto out_iput; - /* make sure it's not busy! */ - if (MSDOS_I(free_inode)->i_busy) - printk(KERN_ERR "msdos_rename_diff: new inode %ld busy!\n", - (ino_t) free_ino); - if (!list_empty(&free_inode->i_dentry)) - printk("msdos_rename_diff: free inode has aliases??\n"); - msdos_read_inode(free_inode); - /* - * Make sure the old dentry isn't busy, - * as we need to change inodes ... + * Now the tricky part. We need to change i_ino. icache ignores + * i_ino for unhashed inodes, so we'll remove inode from hash, + * change what we want to change and reinsert it back. NB: we + * don't have to invalidate FAT cache here - all we need is to + * flip i_ino in relevant cache entries. Later. */ - error = -EBUSY; - if (old_dentry->d_count > 1) { - shrink_dcache_parent(old_dentry); - if (old_dentry->d_count > 1) { -printk("msdos_rename_diff: source %s/%s busy, count=%d\n", -old_dentry->d_parent->d_name.name, old_dentry->d_name.name, -old_dentry->d_count); - goto out_iput; - } - } - - /* keep the inode for a bit ... */ - old_inode->i_count++; - d_delete(old_dentry); - - free_inode->i_mode = old_inode->i_mode; - free_inode->i_nlink = old_inode->i_nlink; - free_inode->i_size = old_inode->i_size; - free_inode->i_blocks = old_inode->i_blocks; - free_inode->i_mtime = old_inode->i_mtime; - free_inode->i_atime = old_inode->i_atime; - free_inode->i_ctime = old_inode->i_ctime; - MSDOS_I(free_inode)->i_ctime_ms = MSDOS_I(old_inode)->i_ctime_ms; - - MSDOS_I(free_inode)->i_start = MSDOS_I(old_inode)->i_start; - MSDOS_I(free_inode)->i_logstart = MSDOS_I(old_inode)->i_logstart; - MSDOS_I(free_inode)->i_attrs = MSDOS_I(old_inode)->i_attrs; - - /* release the old inode's resources */ - MSDOS_I(old_inode)->i_start = 0; - MSDOS_I(old_inode)->i_logstart = 0; - old_inode->i_nlink = 0; - - /* - * Install the new inode ... - */ - d_instantiate(old_dentry, free_inode); + remove_inode_hash(old_inode); - fat_mark_buffer_dirty(sb, free_bh, 1); fat_cache_inval_inode(old_inode); - mark_inode_dirty(old_inode); + old_inode->i_version = ++event; + MSDOS_I(old_inode)->i_binary = + is_binary(MSDOS_SB(sb)->options.conversion, free_de->ext); + old_inode->i_ino = free_ino; + fat_mark_buffer_dirty(sb, free_bh, 1); old_de->name[0] = DELETED_FLAG; fat_mark_buffer_dirty(sb, old_bh, 1); - iput(old_inode); + + insert_inode_hash(old_inode); /* a directory? */ if (dotdot_bh) { @@ -908,8 +737,6 @@ fat_brelse(sb, dotdot_bh); } - /* Update the dcache */ - d_move(old_dentry, new_dentry); error = 0; rename_done: @@ -917,14 +744,6 @@ out: return error; -out_iput: - free_de->name[0] = DELETED_FLAG; - /* - * Don't mark free_bh as dirty. Both states - * are supposed to be equivalent. - */ - iput(free_inode); /* may be NULL */ - iput(dotdot_inode); out_dotdot: fat_brelse(sb, dotdot_bh); goto rename_done; @@ -944,9 +763,6 @@ int is_hid,old_hid; /* if new file and old file are hidden */ char old_msdos_name[MSDOS_NAME], new_msdos_name[MSDOS_NAME]; - error = -EINVAL; - if (sb != new_dir->i_sb) - goto rename_done; error = msdos_format_name(MSDOS_SB(sb)->options.name_check, old_dentry->d_name.name, old_dentry->d_name.len, old_msdos_name, 1,MSDOS_SB(sb)->options.dotsOK); @@ -966,14 +782,9 @@ goto rename_done; fat_lock_creation(); - if (old_dir == new_dir) - error = msdos_rename_same(old_dir, old_msdos_name, old_dentry, - new_dir, new_msdos_name, new_dentry, - old_bh, old_de, (ino_t)old_ino, is_hid); - else - error = msdos_rename_diff(old_dir, old_msdos_name, old_dentry, - new_dir, new_msdos_name, new_dentry, - old_bh, old_de, (ino_t)old_ino, is_hid); + error = do_msdos_rename(old_dir, old_msdos_name, old_dentry, + new_dir, new_msdos_name, new_dentry, + old_bh, old_de, (ino_t)old_ino, is_hid); fat_unlock_creation(); fat_brelse(sb, old_bh); diff -u --recursive --new-file v2.2.5/linux/fs/namei.c linux/fs/namei.c --- v2.2.5/linux/fs/namei.c Mon Jan 25 17:44:34 1999 +++ linux/fs/namei.c Thu Apr 15 06:11:56 1999 @@ -279,7 +279,8 @@ { struct inode * inode = dentry->d_inode; - if (inode && inode->i_op && inode->i_op->follow_link) { + if ((follow & LOOKUP_FOLLOW) + && inode && inode->i_op && inode->i_op->follow_link) { if (current->link_count < 5) { struct dentry * result; @@ -403,9 +404,6 @@ /* Check mountpoints.. */ dentry = follow_mount(dentry); - if (!(flags & LOOKUP_FOLLOW)) - break; - base = do_follow_link(base, dentry, flags); if (IS_ERR(base)) goto return_base; @@ -1034,17 +1032,13 @@ int error; error = may_delete(dir, dentry, 0); - if (error) - goto exit_lock; - - if (!dir->i_op || !dir->i_op->unlink) - goto exit_lock; - - DQUOT_INIT(dir); - - error = dir->i_op->unlink(dir, dentry); - -exit_lock: + if (!error) { + error = -EPERM; + if (dir->i_op && dir->i_op->unlink) { + DQUOT_INIT(dir); + error = dir->i_op->unlink(dir, dentry); + } + } return error; } @@ -1231,15 +1225,16 @@ return error; } -int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, +int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry) { int error; - int isdir; + int need_rehash = 0; - isdir = S_ISDIR(old_dentry->d_inode->i_mode); + if (old_dentry->d_inode == new_dentry->d_inode) + return 0; - error = may_delete(old_dir, old_dentry, isdir); /* XXX */ + error = may_delete(old_dir, old_dentry, 1); if (error) return error; @@ -1249,18 +1244,89 @@ if (!new_dentry->d_inode) error = may_create(new_dir, new_dentry); else - error = may_delete(new_dir, new_dentry, isdir); + error = may_delete(new_dir, new_dentry, 1); if (error) return error; if (!old_dir->i_op || !old_dir->i_op->rename) return -EPERM; + /* + * If we are going to change the parent - check write permissions, + * we'll need to flip '..'. + */ + if (new_dir != old_dir) { + error = permission(old_dentry->d_inode, MAY_WRITE); + } + if (error) + return error; + DQUOT_INIT(old_dir); DQUOT_INIT(new_dir); + down(&old_dir->i_sb->s_vfs_rename_sem); + error = -EINVAL; + if (is_subdir(new_dentry, old_dentry)) + goto out_unlock; + if (new_dentry->d_inode) { + error = -EBUSY; + if (d_invalidate(new_dentry)<0) + goto out_unlock; + need_rehash = 1; + } error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry); - + if (need_rehash) + d_rehash(new_dentry); + if (!error) + d_move(old_dentry,new_dentry); +out_unlock: + up(&old_dir->i_sb->s_vfs_rename_sem); return error; +} + +int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, + struct inode *new_dir, struct dentry *new_dentry) +{ + int error; + + if (old_dentry->d_inode == new_dentry->d_inode) + return 0; + + error = may_delete(old_dir, old_dentry, 0); + if (error) + return error; + + if (new_dir->i_dev != old_dir->i_dev) + return -EXDEV; + + if (!new_dentry->d_inode) + error = may_create(new_dir, new_dentry); + else + error = may_delete(new_dir, new_dentry, 0); + if (error) + return error; + + if (!old_dir->i_op || !old_dir->i_op->rename) + return -EPERM; + + DQUOT_INIT(old_dir); + DQUOT_INIT(new_dir); + error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry); + if (error) + return error; + /* The following d_move() should become unconditional */ + if (!(old_dir->i_sb->s_flags & MS_ODD_RENAME)) { + d_move(old_dentry, new_dentry); + } + return 0; +} + +int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, + struct inode *new_dir, struct dentry *new_dentry) +{ + if (S_ISDIR(old_dentry->d_inode->i_mode)) + return vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry); + else + return vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry); } static inline int do_rename(const char * oldname, const char * newname) diff -u --recursive --new-file v2.2.5/linux/fs/ncpfs/dir.c linux/fs/ncpfs/dir.c --- v2.2.5/linux/fs/ncpfs/dir.c Wed Dec 16 10:32:55 1998 +++ linux/fs/ncpfs/dir.c Mon Apr 12 10:03:45 1999 @@ -303,6 +303,8 @@ memset(&ia,0,sizeof(struct iattr)); ia.ia_mode = old_dentry->d_inode->i_mode; + if (S_ISDIR(ia.ia_mode)) + goto leave_me; ia.ia_mode |= NCP_SERVER(old_dir)->m.file_mode & 0222; /* set write bits */ ia.ia_valid = ATTR_MODE; @@ -1125,7 +1127,8 @@ old_dentry->d_name.name,new_dentry->d_name.name); ncp_invalid_dir_cache(old_dir); ncp_invalid_dir_cache(new_dir); - d_move(old_dentry,new_dentry); + if (!S_ISDIR(old_dentry->d_inode->i_mode)) + d_move(old_dentry,new_dentry); } } else { if (error == 0x9E) diff -u --recursive --new-file v2.2.5/linux/fs/ncpfs/inode.c linux/fs/ncpfs/inode.c --- v2.2.5/linux/fs/ncpfs/inode.c Tue Mar 23 14:35:48 1999 +++ linux/fs/ncpfs/inode.c Mon Apr 12 10:03:45 1999 @@ -264,6 +264,8 @@ lock_super(sb); + sb->s_flags |= MS_ODD_RENAME; /* This should go away */ + sb->s_blocksize = 1024; /* Eh... Is this correct? */ sb->s_blocksize_bits = 10; sb->s_magic = NCP_SUPER_MAGIC; diff -u --recursive --new-file v2.2.5/linux/fs/nfs/dir.c linux/fs/nfs/dir.c --- v2.2.5/linux/fs/nfs/dir.c Wed Mar 10 15:29:49 1999 +++ linux/fs/nfs/dir.c Mon Apr 12 10:03:45 1999 @@ -624,10 +624,6 @@ dfprintk(VFS, "NFS: create(%x/%ld, %s\n", dir->i_dev, dir->i_ino, dentry->d_name.name); - error = -ENAMETOOLONG; - if (dentry->d_name.len > NFS_MAXNAMLEN) - goto out; - sattr.mode = mode; sattr.uid = sattr.gid = sattr.size = (unsigned) -1; sattr.atime.seconds = sattr.mtime.seconds = (unsigned) -1; @@ -642,7 +638,6 @@ error = nfs_instantiate(dentry, &fhandle, &fattr); if (error) d_drop(dentry); -out: return error; } @@ -659,9 +654,6 @@ dfprintk(VFS, "NFS: mknod(%x/%ld, %s\n", dir->i_dev, dir->i_ino, dentry->d_name.name); - if (dentry->d_name.len > NFS_MAXNAMLEN) - return -ENAMETOOLONG; - sattr.mode = mode; sattr.uid = sattr.gid = sattr.size = (unsigned) -1; if (S_ISCHR(mode) || S_ISBLK(mode)) @@ -691,10 +683,6 @@ dfprintk(VFS, "NFS: mkdir(%x/%ld, %s\n", dir->i_dev, dir->i_ino, dentry->d_name.name); - error = -ENAMETOOLONG; - if (dentry->d_name.len > NFS_MAXNAMLEN) - goto out; - sattr.mode = mode | S_IFDIR; sattr.uid = sattr.gid = sattr.size = (unsigned) -1; sattr.atime.seconds = sattr.mtime.seconds = (unsigned) -1; @@ -709,7 +697,6 @@ nfs_invalidate_dircache(dir); error = nfs_proc_mkdir(NFS_DSERVER(dentry), NFS_FH(dentry->d_parent), dentry->d_name.name, &sattr, &fhandle, &fattr); -out: return error; } @@ -720,10 +707,6 @@ dfprintk(VFS, "NFS: rmdir(%x/%ld, %s\n", dir->i_dev, dir->i_ino, dentry->d_name.name); - error = -ENAMETOOLONG; - if (dentry->d_name.len > NFS_MAXNAMLEN) - goto out; - #ifdef NFS_PARANOIA if (dentry->d_inode->i_count > 1) printk("nfs_rmdir: %s/%s inode busy?? i_count=%d, i_nlink=%d\n", @@ -742,7 +725,6 @@ dentry->d_inode->i_nlink --; } -out: return error; } @@ -952,10 +934,6 @@ dfprintk(VFS, "NFS: unlink(%x/%ld, %s)\n", dir->i_dev, dir->i_ino, dentry->d_name.name); - error = -ENAMETOOLONG; - if (dentry->d_name.len > NFS_MAXNAMLEN) - goto out; - error = nfs_sillyrename(dir, dentry); if (error && error != -EBUSY) { error = nfs_safe_remove(dentry); @@ -963,7 +941,6 @@ nfs_renew_times(dentry); } } -out: return error; } @@ -977,9 +954,6 @@ dir->i_dev, dir->i_ino, dentry->d_name.name, symname); error = -ENAMETOOLONG; - if (dentry->d_name.len > NFS_MAXNAMLEN) - goto out; - if (strlen(symname) > NFS_MAXPATHLEN) goto out; @@ -1026,10 +1000,6 @@ old_dentry->d_parent->d_name.name, old_dentry->d_name.name, dentry->d_parent->d_name.name, dentry->d_name.name); - error = -ENAMETOOLONG; - if (dentry->d_name.len > NFS_MAXNAMLEN) - goto out; - /* * Drop the dentry in advance to force a new lookup. * Since nfs_proc_link doesn't return a file handle, @@ -1046,7 +1016,6 @@ */ inode->i_nlink++; } -out: return error; } @@ -1087,11 +1056,6 @@ new_dentry->d_parent->d_name.name, new_dentry->d_name.name, new_dentry->d_count); - error = -ENAMETOOLONG; - if (old_dentry->d_name.len > NFS_MAXNAMLEN || - new_dentry->d_name.len > NFS_MAXNAMLEN) - goto out; - /* * First check whether the target is busy ... we can't * safely do _any_ rename if the target is in use. @@ -1100,28 +1064,24 @@ * silly-rename. If the silly-rename succeeds, the * copied dentry is hashed and becomes the new target. * - * For directories, prune any unused children. + * With directories check is done in VFS. */ error = -EBUSY; if (new_dentry->d_count > 1 && new_inode) { - if (S_ISREG(new_inode->i_mode)) { - int err; - /* copy the target dentry's name */ - dentry = d_alloc(new_dentry->d_parent, - &new_dentry->d_name); - if (!dentry) - goto out; - - /* silly-rename the existing target ... */ - err = nfs_sillyrename(new_dir, new_dentry); - if (!err) { - new_dentry = dentry; - new_inode = NULL; - /* hash the replacement target */ - d_add(new_dentry, NULL); - } - } else if (!list_empty(&new_dentry->d_subdirs)) { - shrink_dcache_parent(new_dentry); + int err; + /* copy the target dentry's name */ + dentry = d_alloc(new_dentry->d_parent, + &new_dentry->d_name); + if (!dentry) + goto out; + + /* silly-rename the existing target ... */ + err = nfs_sillyrename(new_dir, new_dentry); + if (!err) { + new_dentry = dentry; + new_inode = NULL; + /* hash the replacement target */ + d_add(new_dentry, NULL); } /* dentry still busy? */ @@ -1196,7 +1156,7 @@ error = nfs_proc_rename(NFS_DSERVER(old_dentry), NFS_FH(old_dentry->d_parent), old_dentry->d_name.name, NFS_FH(new_dentry->d_parent), new_dentry->d_name.name); - if (!error) { + if (!error && !S_ISDIR(old_inode->i_mode)) { /* Update the dcache if needed */ if (rehash) d_add(new_dentry, NULL); diff -u --recursive --new-file v2.2.5/linux/fs/nfs/inode.c linux/fs/nfs/inode.c --- v2.2.5/linux/fs/nfs/inode.c Wed Mar 10 15:29:49 1999 +++ linux/fs/nfs/inode.c Mon Apr 12 10:03:45 1999 @@ -224,6 +224,8 @@ lock_super(sb); + sb->s_flags |= MS_ODD_RENAME; /* This should go away */ + sb->s_magic = NFS_SUPER_MAGIC; sb->s_op = &nfs_sops; sb->s_blocksize = nfs_block_size(data->bsize, &sb->s_blocksize_bits); diff -u --recursive --new-file v2.2.5/linux/fs/nfs/symlink.c linux/fs/nfs/symlink.c --- v2.2.5/linux/fs/nfs/symlink.c Mon Sep 28 10:51:35 1998 +++ linux/fs/nfs/symlink.c Mon Apr 12 09:57:11 1999 @@ -54,13 +54,12 @@ dfprintk(VFS, "nfs: readlink(%s/%s)\n", dentry->d_parent->d_name.name, dentry->d_name.name); - if (buflen > NFS_MAXPATHLEN) - buflen = NFS_MAXPATHLEN; error = nfs_proc_readlink(NFS_DSERVER(dentry), NFS_FH(dentry), - &mem, &res, &len, buflen); + &mem, &res, &len, NFS_MAXPATHLEN); if (! error) { + if (len > buflen) + len = buflen; copy_to_user(buffer, res, len); - put_user('\0', buffer + len); error = len; kfree(mem); } diff -u --recursive --new-file v2.2.5/linux/fs/nfsd/nfs3proc.c linux/fs/nfsd/nfs3proc.c --- v2.2.5/linux/fs/nfsd/nfs3proc.c Mon Sep 1 12:26:04 1997 +++ linux/fs/nfsd/nfs3proc.c Mon Apr 12 10:07:36 1999 @@ -339,8 +339,10 @@ nfserr = nfsd_symlink(rqstp, &argp->ffh, argp->fname, argp->flen, argp->tname, argp->tlen, &newfh); - if (nfserr) + if (!nfserr) { + argp->attrs.ia_valid &= ~ATTR_SIZE; nfserr = nfsd_setattr(rqstp, &newfh, &argp->attrs); + } fh_put(&argp->ffh); fh_put(&newfh); @@ -362,6 +364,7 @@ SVCFH_INO(&argp->fh), argp->name); + argp->attrs.ia_valid &= ~ATTR_SIZE; nfserr = nfsd_create(rqstp, &argp->fh, argp->name, argp->len, &argp->attrs, S_IFDIR, 0, &resp->fh); fh_put(&argp->fh); diff -u --recursive --new-file v2.2.5/linux/fs/nfsd/nfsproc.c linux/fs/nfsd/nfsproc.c --- v2.2.5/linux/fs/nfsd/nfsproc.c Tue Feb 23 15:21:34 1999 +++ linux/fs/nfsd/nfsproc.c Mon Apr 12 10:08:18 1999 @@ -382,8 +382,10 @@ nfserr = nfsd_symlink(rqstp, &argp->ffh, argp->fname, argp->flen, argp->tname, argp->tlen, &newfh); - if (!nfserr) + if (!nfserr) { + argp->attrs.ia_valid &= ~ATTR_SIZE; nfserr = nfsd_setattr(rqstp, &newfh, &argp->attrs); + } fh_put(&argp->ffh); fh_put(&newfh); @@ -407,6 +409,7 @@ "nfsd_proc_mkdir: response already verified??\n"); } + argp->attrs.ia_valid &= ~ATTR_SIZE; nfserr = nfsd_create(rqstp, &argp->fh, argp->name, argp->len, &argp->attrs, S_IFDIR, 0, &resp->fh); fh_put(&argp->fh); diff -u --recursive --new-file v2.2.5/linux/fs/nfsd/vfs.c linux/fs/nfsd/vfs.c --- v2.2.5/linux/fs/nfsd/vfs.c Tue Mar 23 14:35:48 1999 +++ linux/fs/nfsd/vfs.c Mon Apr 12 10:03:45 1999 @@ -959,7 +959,7 @@ goto out_unlock; err = nfserr_perm; - if (IS_IMMUTABLE(dest) /* || IS_APPEND(dest) */ ) + if (IS_IMMUTABLE(dest) || IS_APPEND(dest)) goto out_unlock; if (!dirp->i_op || !dirp->i_op->link) goto out_unlock; diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/Makefile linux/fs/ntfs/Makefile --- v2.2.5/linux/fs/ntfs/Makefile Mon Jan 4 15:08:17 1999 +++ linux/fs/ntfs/Makefile Mon Apr 12 10:05:58 1999 @@ -3,7 +3,7 @@ O_TARGET := ntfs.o O_OBJS := fs.o sysctl.o support.o util.o inode.o dir.o super.o attr.o M_OBJS := $(O_TARGET) -EXTRA_CFLAGS = -DNTFS_IN_LINUX_KERNEL -DNTFS_VERSION=\"990102\" +EXTRA_CFLAGS = -DNTFS_IN_LINUX_KERNEL -DNTFS_VERSION=\"990411\" include $(TOPDIR)/Rules.make diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/attr.c linux/fs/ntfs/attr.c --- v2.2.5/linux/fs/ntfs/attr.c Mon Jan 4 15:08:17 1999 +++ linux/fs/ntfs/attr.c Mon Apr 12 10:05:58 1999 @@ -1,9 +1,10 @@ /* * attr.c * - * Copyright (C) 1996-1998 Martin von Löwis + * Copyright (C) 1996-1999 Martin von Löwis * Copyright (C) 1996-1997 Régis Duchesne * Copyright (C) 1998 Joseph Malicki + * Copyright (C) 1999 Steve Dodd */ #include "ntfstypes.h" @@ -11,6 +12,9 @@ #include "attr.h" #include +#ifdef HAVE_STRING_H +#include +#endif #include "macros.h" #include "support.h" #include "util.h" @@ -18,8 +22,9 @@ #include "inode.h" /* Look if an attribute already exists in the inode, and if not, create it */ -static int -new_attr(ntfs_inode *ino,int type,void *name,int namelen,int *pos, int *found) +int +ntfs_new_attr(ntfs_inode *ino,int type,void *name,int namelen,int *pos, + int *found, int do_search ) { int do_insert=0; int i; @@ -28,15 +33,17 @@ { int n=min(namelen,ino->attrs[i].namelen); int s=ntfs_uni_strncmp(ino->attrs[i].name,name,n); - /* - * We assume that each attribute can be uniquely - * identified by inode - * number, attribute type and attribute name. - */ - if(ino->attrs[i].type==type && ino->attrs[i].namelen==namelen && !s){ - *found=1; - *pos=i; - return 0; + if( do_search ) { + /* + * We assume that each attribute can be uniquely + * identified by inode + * number, attribute type and attribute name. + */ + if(ino->attrs[i].type==type && ino->attrs[i].namelen==namelen && !s){ + *found=1; + *pos=i; + return 0; + } } /* attributes are ordered by type, then by name */ if(ino->attrs[i].type>type || (ino->attrs[i].type==type && s==1)){ @@ -48,17 +55,21 @@ /* re-allocate space */ if(ino->attr_count % 8 ==0) { - ntfs_attribute* old=ino->attrs; - ino->attrs = (ntfs_attribute*)ntfs_malloc((ino->attr_count+8)* + ntfs_attribute* new; + new = (ntfs_attribute*)ntfs_malloc((ino->attr_count+8)* sizeof(ntfs_attribute)); - if(old){ - ntfs_memcpy(ino->attrs,old,ino->attr_count*sizeof(ntfs_attribute)); - ntfs_free(old); + if( !new ) + return ENOMEM; + if( ino->attrs ) { + ntfs_memcpy( new, ino->attrs, ino->attr_count*sizeof(ntfs_attribute) ); + ntfs_free( ino->attrs ); } + ino->attrs = new; } if(do_insert) ntfs_memmove(ino->attrs+i+1,ino->attrs+i,(ino->attr_count-i)* sizeof(ntfs_attribute)); + ino->attr_count++; ino->attrs[i].type=type; ino->attrs[i].namelen=namelen; @@ -81,19 +92,21 @@ } /* Store in the inode readable information about a run */ -static void +void ntfs_insert_run(ntfs_attribute *attr,int cnum,ntfs_cluster_t cluster,int len) { /* (re-)allocate space if necessary */ if(attr->d.r.len % 8 == 0) { - ntfs_runlist* old; - old=attr->d.r.runlist; - attr->d.r.runlist=ntfs_malloc((attr->d.r.len+8)*sizeof(ntfs_runlist)); - if(old) { - ntfs_memcpy(attr->d.r.runlist,old,attr->d.r.len + ntfs_runlist* new; + new = ntfs_malloc((attr->d.r.len+8)*sizeof(ntfs_runlist)); + if( !new ) + return; + if( attr->d.r.runlist ) { + ntfs_memcpy(new, attr->d.r.runlist, attr->d.r.len *sizeof(ntfs_runlist)); - ntfs_free(old); + ntfs_free( attr->d.r.runlist ); } + attr->d.r.runlist = new; } if(attr->d.r.len>cnum) ntfs_memmove(attr->d.r.runlist+cnum+1,attr->d.r.runlist+cnum, @@ -103,6 +116,13 @@ attr->d.r.len++; } +/* Extends an attribute. Another run will be added if necessary, + * but we try to extend the last run in the runlist first. + * FIXME: what if there isn't enough contiguous space, we don't create + * multiple runs? + * + * *len: the desired new length of the attr (_not_ the amount to extend by) + */ int ntfs_extend_attr(ntfs_inode *ino, ntfs_attribute *attr, int *len, int flags) { @@ -111,34 +131,46 @@ int rlen; ntfs_cluster_t cluster; int clen; + if(attr->compressed)return EOPNOTSUPP; if(ino->record_count>1)return EOPNOTSUPP; + if(attr->resident) { error = ntfs_make_attr_nonresident(ino,attr); if(error) return error; } + if( *len <= attr->allocated ) + return 0; /* truely stupid things do sometimes happen */ + rl=attr->d.r.runlist; rlen=attr->d.r.len-1; + if(rlen>=0) cluster=rl[rlen].cluster+rl[rlen].len; else /* no preference for allocation space */ cluster=0; - /* round up to multiple of cluster size */ - clen=(*len+ino->vol->clustersize-1)/ino->vol->clustersize; + + /* calculate the extra space we need, and round up to multiple of cluster + * size to get number of new clusters needed */ + + clen=( (*len - attr->allocated ) + ino->vol->clustersize - 1 ) / + ino->vol->clustersize; if(clen==0) return 0; + /* FIXME: try to allocate smaller pieces */ error=ntfs_allocate_clusters(ino->vol,&cluster,&clen, flags|ALLOC_REQUIRE_SIZE); if(error)return error; attr->allocated += clen*ino->vol->clustersize; - *len=clen*ino->vol->clustersize; + *len = attr->allocated; + /* contiguous chunk */ if(rlen>=0 && cluster==rl[rlen].cluster+rl[rlen].len){ - rl[rlen].len+=clen; + rl[rlen].len += clen; return 0; } ntfs_insert_run(attr,rlen+1,cluster,clen); @@ -208,8 +240,10 @@ v=attr->d.data; if(newsize){ attr->d.data=ntfs_malloc(newsize); - if(!attr->d.data) + if(!attr->d.data) { + ntfs_free(v); return ENOMEM; + } if(newsize>oldsize) ntfs_bzero((char*)attr->d.data+oldsize, newsize-oldsize); @@ -231,7 +265,7 @@ newlen=i+1; /* free unused clusters in current run, unless sparse */ newcount=count; - if(rl[i].cluster!=-1){ + if(rl[i].cluster!=MAX_CLUSTER_T){ int rounded=newsize-count*clustersize; rounded=(rounded+clustersize-1)/clustersize; error=ntfs_deallocate_clusters(ino->vol,rl[i].cluster+rounded, @@ -243,7 +277,7 @@ } /* free all other runs */ for(i++;id.r.len;i++) - if(rl[i].cluster!=-1){ + if(rl[i].cluster!=MAX_CLUSTER_T){ error=ntfs_deallocate_clusters(ino->vol,rl[i].cluster,(int)rl[i].len); if(error) return error; /* FIXME: incomplete operation */ @@ -279,12 +313,20 @@ if(aname){ namelen=strlen(aname); name=ntfs_malloc(2*namelen); + if( !name ) + return ENOMEM; ntfs_ascii2uni(name,aname,namelen); }else{ name=0; namelen=0; } - new_attr(ino,anum,name,namelen,&i,&found); + + error = ntfs_new_attr(ino,anum,name,namelen,&i,&found,1); + if( error ) { + ntfs_free( name ); + return error; + } + if(found){ ntfs_free(name); return EEXIST; @@ -309,6 +351,10 @@ }else attr->indexed=0; attr->d.data=ntfs_malloc(dsize); + + if( !attr->d.data ) + return ENOMEM; + ntfs_memcpy(attr->d.data,data,dsize); return 0; } @@ -366,6 +412,7 @@ int namelen; void *data; ntfs_attribute *attr; + int error; type = NTFS_GETU32(attrdata); namelen = NTFS_GETU8(attrdata+9); @@ -376,15 +423,30 @@ { /* 1 Unicode character fits in 2 bytes */ name=ntfs_malloc(2*namelen); + if( !name ) + return ENOMEM; + ntfs_memcpy(name,attrdata+NTFS_GETU16(attrdata+10),2*namelen); } - new_attr(ino,type,name,namelen,&i,&found); + + error = ntfs_new_attr(ino,type,name,namelen,&i,&found,1); + if( error ) { + if( name ) ntfs_free( name ); + return error; + } + /* We can have in one inode two attributes with type 0x00000030 (File Name) and without name */ if(found && /*FIXME*/type!=ino->vol->at_file_name) { ntfs_process_runs(ino,ino->attrs+i,attrdata); return 0; + } else if( found ) { + /* Don't understand the above, but I know it leaks memory below + as it overwrites a found entry without freeing it. So here we + call ntfs_new_attr again but this time ask it to always allocate a + new entry */ + ntfs_new_attr(ino,type,name,namelen,&i,&found,0); } attr=ino->attrs+i; attr->resident=NTFS_GETU8(attrdata+8)==0; @@ -395,6 +457,8 @@ attr->size=NTFS_GETU16(attrdata+0x10); data=attrdata+NTFS_GETU16(attrdata+0x14); attr->d.data = (void*)ntfs_malloc(attr->size); + if( !attr->d.data ) + return ENOMEM; ntfs_memcpy(attr->d.data,data,attr->size); attr->indexed=NTFS_GETU16(attrdata+0x16); }else{ @@ -468,7 +532,7 @@ copied=0; while(l){ chunk=0; - if(cluster==-1){ + if(cluster==MAX_CLUSTER_T){ /* sparse cluster */ int l1; if((len-(s_vcn-vcn)) & 15) @@ -503,9 +567,9 @@ } got+=l1; comp1+=l1*clustersize; - }while(cluster!=-1 && got<16); /* until empty run */ + }while(cluster!=MAX_CLUSTER_T && got<16); /* until empty run */ chunk=16*clustersize; - if(cluster!=-1 || got==16) + if(cluster!=MAX_CLUSTER_T || got==16) /* uncompressible */ comp1=comp; else{ diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/attr.h linux/fs/ntfs/attr.h --- v2.2.5/linux/fs/ntfs/attr.h Mon Jan 4 15:08:17 1999 +++ linux/fs/ntfs/attr.h Mon Apr 12 10:05:58 1999 @@ -18,3 +18,7 @@ int ntfs_read_zero(ntfs_io *dest,int size); int ntfs_make_attr_nonresident(ntfs_inode *ino, ntfs_attribute *attr); int ntfs_attr_allnonresident(ntfs_inode *ino); +int ntfs_new_attr( ntfs_inode *ino, int type, void *name, int namelen, + int *pos, int *found, int do_search ); +void ntfs_insert_run( ntfs_attribute *attr, int cnum, ntfs_cluster_t cluster, + int len ); diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/dir.c linux/fs/ntfs/dir.c --- v2.2.5/linux/fs/ntfs/dir.c Mon Jan 4 15:08:17 1999 +++ linux/fs/ntfs/dir.c Mon Apr 12 10:05:58 1999 @@ -1,7 +1,9 @@ /* * dir.c * - * Copyright (C) 1995-1997 Martin von Löwis + * Copyright (C) 1995-1997, 1999 Martin von Löwis + * Copyright (C) 1999 Steve Dodd + * Copyright (C) 1999 Joseph Malicki */ #include "ntfstypes.h" @@ -67,7 +69,7 @@ if(i<55)return (stack<<8)|((i-23)<<3)|3; if(i<120)return (stack<<10)|((i-55)<<4)|7; ntfs_error("Too many entries\n"); - return 0xFFFFFFFFFFFFFFFF; + return ~((ntfs_u64)0); } #if 0 @@ -166,6 +168,8 @@ int nr_fix = s1/vol->blocksize+1; int hsize; char *record=ntfs_malloc(s1); + if( !record ) + return ENOMEM; ntfs_bzero(record,s1); /* magic */ ntfs_memcpy(record,"INDX",4); @@ -356,8 +360,10 @@ if(do_split){ error=ntfs_split_record(walk,start,blocksize,usedsize); ntfs_free(start); - }else - ntfs_index_writeback(walk,start,walk->block,usedsize); + }else{ + error=ntfs_index_writeback(walk,start,walk->block,usedsize); + if(error)return error; + } return 0; } @@ -395,8 +401,9 @@ goto out; } index = ntfs_malloc(ino->vol->index_recordsize); - if(!index) - goto out; + if(!index) { + error = ENOMEM; goto out; + } walk.dir = ino; walk.block = -1; walk.result = walk.new_entry = 0; @@ -462,12 +469,12 @@ ntfs_u16* name=(ntfs_u16*)(entry+0x52); ntfs_volume *vol=walk->dir->vol; for(i=0;inamelen;i++) - if(ntfs_my_toupper(vol,name[i])!=ntfs_my_toupper(vol,walk->name[i])) + if(ntfs_my_toupper(vol,NTFS_GETU16(name+i))!=ntfs_my_toupper(vol,NTFS_GETU16(walk->name+i))) break; if(i==lu && i==walk->namelen)return 0; if(i==lu)return 1; if(i==walk->namelen)return -1; - if(ntfs_my_toupper(vol,name[i])name[i]))return 1; + if(ntfs_my_toupper(vol,NTFS_GETU16(name+i))name+i)))return 1; return -1; } @@ -485,6 +492,9 @@ int oldblock; ntfs_io io; + if( !record ) + return ENOMEM; + io.fn_put=ntfs_put; io.param=record; io.size=length; @@ -607,7 +617,6 @@ static int ntfs_getdir_iterate(ntfs_iterate_s *walk, char *start, char *entry) { int length; - int retval=0; int cmp; if(walk->type==BY_POSITION) @@ -647,7 +656,7 @@ } entry+=length; }while(1); - return retval; + return 0; } /* Tree walking is done using position numbers. The following numbers have @@ -683,6 +692,9 @@ char *root=ntfs_malloc(length); ntfs_io io; + if( !root ) + return ENOMEM; + io.fn_put=ntfs_put; io.param=root; io.size=length; @@ -747,6 +759,8 @@ /* are we still in the index root */ if(*p_high==0){ buf=ntfs_malloc(length=vol->mft_recordsize); + if( !buf ) + return ENOMEM; io.fn_put=ntfs_put; io.param=buf; io.size=length; @@ -762,6 +776,8 @@ }else{ /* we are in an index record */ length=ino->u.index.recordsize; buf=ntfs_malloc(length); + if( !buf ) + return ENOMEM; io.fn_put=ntfs_put; io.param=buf; io.size=length; @@ -821,6 +837,9 @@ return 0; } buf=ntfs_malloc(length=attr->size); + if( !buf ) + return ENOMEM; + io.param=buf; io.size=length; error=ntfs_read_attr(ino,vol->at_bitmap,I30,0,&io); @@ -920,8 +939,8 @@ /* Fills out and creates an INDEX_ROOT attribute. */ -static int -add_index_root (ntfs_inode *ino, int type) +int +ntfs_add_index_root (ntfs_inode *ino, int type) { ntfs_attribute *da; ntfs_u8 data[0x30]; /* 0x20 header, 0x10 last entry */ @@ -959,7 +978,7 @@ error = ntfs_alloc_inode(dir, result, name, namelen, NTFS_AFLAG_DIR); if(error) goto out; - error = add_index_root(result, 0x30); + error = ntfs_add_index_root(result, 0x30); if (error) goto out; /* Set directory bit */ diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/dir.h linux/fs/ntfs/dir.h --- v2.2.5/linux/fs/ntfs/dir.h Mon Jan 4 15:08:17 1999 +++ linux/fs/ntfs/dir.h Mon Apr 12 10:05:58 1999 @@ -39,3 +39,4 @@ int ntfs_getdir_byposition(ntfs_iterate_s *walk); int ntfs_mkdir(ntfs_inode* dir,const char* name,int namelen, ntfs_inode *ino); int ntfs_split_indexroot(ntfs_inode *ino); +int ntfs_add_index_root( ntfs_inode *ino, int type ); diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/fs.c linux/fs/ntfs/fs.c --- v2.2.5/linux/fs/ntfs/fs.c Tue Mar 23 14:35:48 1999 +++ linux/fs/ntfs/fs.c Mon Apr 12 10:05:58 1999 @@ -2,7 +2,7 @@ * fs.c * NTFS driver for Linux 2.1 * - * Copyright (C) 1995-1997 Martin von Löwis + * Copyright (C) 1995-1997, 1999 Martin von Löwis * Copyright (C) 1996 Richard Russon * Copyright (C) 1996-1997 Régis Duchesne */ @@ -387,6 +387,8 @@ if(error) return error; item=ntfs_malloc(ITEM_SIZE); + if( !item ) + return ENOMEM; /* ntfs_getdir will place the directory entry into item, and the first long long is the MFT record number */ walk.type=BY_NAME; @@ -583,8 +585,6 @@ int ret=ntfs_vcn_to_lcn(NTFS_LINO2NINO(ino),block); ntfs_debug(DEBUG_OTHER, "bmap of %lx,block %x is %x\n", ino->i_ino,block,ret); - ntfs_error("bmap of %lx,block %x is %x\n", ino->i_ino,block,ret); - ntfs_error("super %x\n", ino->i_sb->s_blocksize); return (ret==-1) ? 0:ret; } @@ -709,6 +709,7 @@ #ifdef NTFS_IN_LINUX_KERNEL ino=&inode->u.ntfs_i; #else + /* FIXME: check for ntfs_malloc failure */ ino=(ntfs_inode*)ntfs_malloc(sizeof(ntfs_inode)); inode->u.generic_ip=ino; #endif @@ -818,6 +819,7 @@ struct statfs fs; struct inode *mft; ntfs_volume *vol; + int error; ntfs_debug(DEBUG_OTHER, "ntfs_statfs\n"); vol=NTFS_SB2VOL(sb); @@ -825,7 +827,9 @@ fs.f_type=NTFS_SUPER_MAGIC; fs.f_bsize=vol->clustersize; - fs.f_blocks=ntfs_get_volumesize(NTFS_SB2VOL(sb)); + error = ntfs_get_volumesize( NTFS_SB2VOL( sb ), &fs.f_blocks ); + if( error ) + return error; fs.f_bfree=ntfs_get_free_cluster_count(vol->bitmap); fs.f_bavail=fs.f_bfree; diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/inode.c linux/fs/ntfs/inode.c --- v2.2.5/linux/fs/ntfs/inode.c Mon Jan 4 15:08:17 1999 +++ linux/fs/ntfs/inode.c Mon Apr 12 10:05:58 1999 @@ -5,13 +5,18 @@ * Copyright (C) 1996 Albert D. Cahalan * Copyright (C) 1996-1997 Régis Duchesne * Copyright (C) 1998 Joseph Malicki + * Copyright (C) 1999 Steve Dodd */ #include "ntfstypes.h" +#include "ntfsendian.h" #include "struct.h" #include "inode.h" #include +#ifdef HAVE_STRING_H +#include +#endif #include "macros.h" #include "attr.h" #include "super.h" @@ -30,8 +35,8 @@ ntfs_mft_record* records; } ntfs_disk_inode; -static void -fill_mft_header(ntfs_u8*mft,int record_size,int blocksize, +void +ntfs_fill_mft_header(ntfs_u8*mft,int record_size,int blocksize, int sequence_number) { int fixup_count = record_size / blocksize + 1; @@ -98,7 +103,7 @@ if(mdata->allocatedsize+vol->mft_recordsize){ size=ntfs_get_free_cluster_count(vol->bitmap)*vol->clustersize; block=vol->mft_recordsize; - size=max(size/1000,block); + size=max(size/1000,mdata->size+vol->mft_recordsize); size=((size+block-1)/block)*block; /* require this to be a single chunk */ error=ntfs_extend_attr(vol->mft_ino,mdata,&size, @@ -141,7 +146,7 @@ /* now fill in the MFT header for the new block */ buf=ntfs_calloc(vol->mft_recordsize); if(!buf)return ENOMEM; - fill_mft_header(buf,vol->mft_recordsize,vol->blocksize,0); + ntfs_fill_mft_header(buf,vol->mft_recordsize,vol->blocksize,0); ntfs_insert_fixups(buf,vol->blocksize); io.param=buf; io.size=vol->mft_recordsize; @@ -149,6 +154,8 @@ (rcount-1)*vol->mft_recordsize,&io); if(error)return error; if(io.size!=vol->mft_recordsize)return EIO; + error=ntfs_update_inode(vol->mft_ino); + if(error)return error; return 0; } @@ -165,13 +172,16 @@ /* (re-)allocate space if necessary */ if(ino->record_count % 8==0) { - int *old=ino->records; - ino->records=ntfs_malloc((ino->record_count+8)*sizeof(int)); - if(old) { + int *new; + new = ntfs_malloc((ino->record_count+8)*sizeof(int)); + if( !new ) + return; + if( ino->records ) { for(i=0;irecord_count;i++) - ino->records[i]=old[i]; - ntfs_free(old); + new[i] = ino->records[i]; + ntfs_free( ino->records ); } + ino->records = new; } ino->records[ino->record_count]=mftno; ino->record_count++; @@ -179,8 +189,10 @@ do{ type=NTFS_GETU32(it); len=NTFS_GETU32(it+4); - if(type!=-1) + if(type!=-1) { + /* FIXME: check ntfs_insert_attribute for failure (e.g. no mem)? */ ntfs_insert_attribute(ino,it); + } it+=len; }while(type!=-1); /* attribute list ends with type -1 */ } @@ -195,6 +207,8 @@ int last_mft=-1; int len=*plen; mft=ntfs_malloc(ino->vol->mft_recordsize); + if( !mft ) + return ENOMEM; while(len>8) { l=NTFS_GETU16(alist+4); @@ -239,6 +253,8 @@ return; } buf=ntfs_malloc(1024); + if( !buf ) + return; delta=0; for(offset=0;datasize;datasize-=len) { @@ -271,6 +287,8 @@ ino->i_number=inum; ino->vol=vol; ino->attr=buf=ntfs_malloc(vol->mft_recordsize); + if( !buf ) + return ENOMEM; error=ntfs_read_mft_record(vol,inum,ino->attr); if(error){ ntfs_debug(DEBUG_OTHER, "init inode: %x failed\n",inum); @@ -441,7 +459,7 @@ int ntfs_readwrite_attr(ntfs_inode *ino, ntfs_attribute *attr, int offset, ntfs_io *dest) { - int datasize,rnum; + int rnum; ntfs_cluster_t cluster,s_cluster,vcn,len; int l,chunk,copied; int s_vcn; @@ -449,26 +467,39 @@ int error; clustersize=ino->vol->clustersize; - datasize=attr->size; l=dest->size; if(l==0) return 0; if(dest->do_read) { - if(offset>=datasize){ + /* if read _starts_ beyond end of stream, return nothing */ + if(offset>=attr->size){ dest->size=0; return 0; } - if(offset+l>=datasize) - l=dest->size=datasize-offset; - }else { /* fixed by CSA: if writing beyond end, extend attribute */ - if (offset+l>datasize) { + + /* if read _extends_ beyond end of stream, return as much + initialised data as we have */ + if(offset+l>=attr->size) + l=dest->size=attr->size-offset; + + }else { + /* fixed by CSA: if writing beyond end, extend attribute */ + + /* if write extends beyond _allocated_ size, extend attrib */ + if (offset+l>attr->allocated) { error=ntfs_resize_attr(ino,attr,offset+l); if(error) return error; } - if (offset+l > attr->initialized) + + /* the amount of initialised data has increased; update */ + /* FIXME: shouldn't we zero-out the section between the old + initialised length and the write start? */ + if (offset+l > attr->initialized) { attr->initialized = offset+l; + attr->size = offset+l; + } } if(attr->resident) { @@ -565,7 +596,6 @@ { int rnum; ntfs_attribute *data; - ntfs_error("bmap %x\n",vcn); data=ntfs_find_attr(ino,ino->vol->at_data,0); /* It's hard to give an error code */ if(!data)return -1; @@ -583,7 +613,6 @@ vcn>data->d.r.runlist[rnum].len;rnum++) vcn-=data->d.r.runlist[rnum].len; - ntfs_error("result %x\n",data->d.r.runlist[rnum].cluster+vcn); return data->d.r.runlist[rnum].cluster+vcn; } @@ -655,7 +684,7 @@ *(rec+offset)|=coffs++; - if(rl[i].cluster==0) /*compressed run*/ + if(rl[i].cluster==MAX_CLUSTER_T) /*compressed run*/ /*nothing*/; else if(rclus>-0x80 && rclus<0x7F){ *(rec+offset)|=0x10; @@ -768,7 +797,8 @@ NTFS_PUTU16(buf+0xA,asize); ntfs_memcpy(buf+asize,attr->name,2*attr->namelen); asize+=2*attr->namelen; - asize=(asize+7) & ~7; + /* SRD: you whaaa? + asize=(asize+7) & ~7;*/ } /* asize points at the beginning of the data */ NTFS_PUTU16(buf+0x20,asize); @@ -841,7 +871,12 @@ if(error) return error; } - next=(next+7) & ~7; /* align to DWORD */ + /* SRD: umm.. + next=(next+7) & ~7; */ + /* is this setting the length? if so maybe we could get + away with rounding up so long as we set the length first.. + ..except, is the length the only way to get to the next attr? + */ NTFS_PUTU16(rec+offset+4,next-offset); offset=next; #endif @@ -1038,7 +1073,8 @@ data=ntfs_find_attr(vol->mft_ino,vol->at_data,0); length=data->size/vol->mft_recordsize; - for (byte = 3; 8*byte < length; byte++) + /* SRD: start at byte 0: bits for system files _are_ already set in bitmap */ + for (byte = 0; 8*byte < length; byte++) { value = buffer[byte]; if(value==0xFF) @@ -1064,7 +1100,7 @@ mft=ino->attr; ntfs_bzero(mft, vol->mft_recordsize); - fill_mft_header(mft,vol->mft_recordsize,vol->blocksize, + ntfs_fill_mft_header(mft,vol->mft_recordsize,vol->blocksize, ino->sequence_number); return 0; } @@ -1108,6 +1144,8 @@ /* work out the size */ size = 0x42 + 2 * length; data = ntfs_malloc(size); + if( !data ) + return ENOMEM; ntfs_bzero(data,size); /* search for a position */ @@ -1191,7 +1229,7 @@ { ntfs_io io; int error; - ntfs_u8 buffer[1]; + ntfs_u8 buffer[2]; ntfs_volume* vol=dir->vol; int byte,bit; @@ -1230,7 +1268,7 @@ */ /* get the sequence number */ io.param = buffer; - io.size = 0x10; + io.size = 2; error = ntfs_read_attr(vol->mft_ino, vol->at_data, 0, result->i_number*vol->mft_recordsize+0x10,&io); if(error) @@ -1238,10 +1276,17 @@ result->sequence_number=NTFS_GETU16(buffer)+1; result->vol=vol; result->attr=ntfs_malloc(vol->mft_recordsize); + if( !result->attr ) + return ENOMEM; result->attr_count=0; result->attrs=0; result->record_count=1; result->records=ntfs_malloc(8*sizeof(int)); + if( !result->records ) { + ntfs_free( result->attr ); + result->attr = 0; + return ENOMEM; + } result->records[0]=result->i_number; error=add_mft_header(result); if(error) diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/inode.h linux/fs/ntfs/inode.h --- v2.2.5/linux/fs/ntfs/inode.h Mon Jan 4 15:08:17 1999 +++ linux/fs/ntfs/inode.h Mon Apr 12 10:05:58 1999 @@ -26,3 +26,5 @@ int ntfs_decompress_run(unsigned char **data, int *length, ntfs_cluster_t *cluster, int *ctype); void ntfs_decompress(unsigned char *dest, unsigned char *src, ntfs_size_t l); +void ntfs_fill_mft_header( ntfs_u8 *mft, int recordsize, int blocksize, + int sequence_number ); diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/ntfsendian.h linux/fs/ntfs/ntfsendian.h --- v2.2.5/linux/fs/ntfs/ntfsendian.h Thu Jan 7 15:11:40 1999 +++ linux/fs/ntfs/ntfsendian.h Mon Apr 12 10:05:58 1999 @@ -1,8 +1,9 @@ /* * ntfsendian.h * - * Copyright (C) 1998 Martin von Löwis + * Copyright (C) 1998, 1999 Martin von Löwis * Copyright (C) 1998 Joseph Malicki + * Copyright (C) 1999 Werner Seiler */ #ifdef __linux__ @@ -36,9 +37,9 @@ #ifdef __BIG_ENDIAN /* We hope its big-endian, not PDP-endian :) */ -#define CPU_TO_LE16(a) ((((a)&0xF) << 8)|((a) >> 8)) -#define CPU_TO_LE32(a) ((((a) & 0xF) << 24) | (((a) & 0xF0) << 8) | \ - (((a) & 0xF00) >> 8) | ((a) >> 24)) +#define CPU_TO_LE16(a) ((((a)&0xFF) << 8)|((a) >> 8)) +#define CPU_TO_LE32(a) ((((a) & 0xFF) << 24) | (((a) & 0xFF00) << 8) | \ + (((a) & 0xFF0000) >> 8) | ((a) >> 24)) #define CPU_TO_LE64(a) ((CPU_TO_LE32(a)<<32)|CPU_TO_LE32((a)>>32) #define LE16_TO_CPU(a) CPU_TO_LE16(a) @@ -55,7 +56,7 @@ #define NTFS_GETU8(p) (*(ntfs_u8*)(p)) #define NTFS_GETU16(p) ((ntfs_u16)LE16_TO_CPU(*(ntfs_u16*)(p))) -#define NTFS_GETU24(p) (NTFS_GETU32(p) & 0xFFFFFF) +#define NTFS_GETU24(p) ((ntfs_u32)NTFS_GETU16(p) | ((ntfs_u32)NTFS_GETU8(((char*)(p))+2)<<16)) #define NTFS_GETU32(p) ((ntfs_u32)LE32_TO_CPU(*(ntfs_u32*)(p))) #define NTFS_GETU40(p) ((ntfs_u64)NTFS_GETU32(p)|(((ntfs_u64)NTFS_GETU8(((char*)(p))+4))<<32)) #define NTFS_GETU48(p) ((ntfs_u64)NTFS_GETU32(p)|(((ntfs_u64)NTFS_GETU16(((char*)(p))+4))<<32)) @@ -75,9 +76,9 @@ #define NTFS_GETS16(p) ((ntfs_s16)LE16_TO_CPU(*(short*)(p))) #define NTFS_GETS24(p) (NTFS_GETU24(p) < 0x800000 ? (int)NTFS_GETU24(p) : (int)(NTFS_GETU24(p) - 0x1000000)) #define NTFS_GETS32(p) ((ntfs_s32)LE32_TO_CPU(*(int*)(p))) -#define NTFS_GETS40(p) (((ntfs_s64)NTFS_GETS32(p)) | (((ntfs_s64)NTFS_GETS8(((char*)(p))+4)) << 32)) -#define NTFS_GETS48(p) (((ntfs_s64)NTFS_GETS32(p)) | (((ntfs_s64)NTFS_GETS16(((char*)(p))+4)) << 32)) -#define NTFS_GETS56(p) (((ntfs_s64)NTFS_GETS32(p)) | (((ntfs_s64)NTFS_GETS24(((char*)(p))+4)) << 32)) +#define NTFS_GETS40(p) (((ntfs_s64)NTFS_GETU32(p)) | (((ntfs_s64)NTFS_GETS8(((char*)(p))+4)) << 32)) +#define NTFS_GETS48(p) (((ntfs_s64)NTFS_GETU32(p)) | (((ntfs_s64)NTFS_GETS16(((char*)(p))+4)) << 32)) +#define NTFS_GETS56(p) (((ntfs_s64)NTFS_GETU32(p)) | (((ntfs_s64)NTFS_GETS24(((char*)(p))+4)) << 32)) #define NTFS_GETS64(p) ((ntfs_s64)NTFS_GETU64(p)) #define NTFS_PUTS8(p,v) NTFS_PUTU8(p,v) diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/ntfstypes.h linux/fs/ntfs/ntfstypes.h --- v2.2.5/linux/fs/ntfs/ntfstypes.h Mon Jan 4 15:08:17 1999 +++ linux/fs/ntfs/ntfstypes.h Mon Apr 12 10:05:58 1999 @@ -1,12 +1,12 @@ /* - * types.h + * ntfstypes.h * This file defines four things: * - generic platform independent fixed-size types (e.g. ntfs_u32) * - specific fixed-size types (e.g. ntfs_offset_t) * - macros that read and write those types from and to byte arrays * - types derived from OS specific ones * - * Copyright (C) 1996,1998 Martin von Löwis + * Copyright (C) 1996,1998, 1999 Martin von Löwis */ #ifdef NTFS_IN_LINUX_KERNEL @@ -52,6 +52,10 @@ #ifndef NTFS_CLUSTER_T #define NTFS_CLUSTER_T typedef u32 ntfs_cluster_t; +#endif + +#ifndef MAX_CLUSTER_T +#define MAX_CLUSTER_T (~((ntfs_cluster_t)0)) #endif /* architecture independent macros */ diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/super.c linux/fs/ntfs/super.c --- v2.2.5/linux/fs/ntfs/super.c Mon Jan 4 15:08:17 1999 +++ linux/fs/ntfs/super.c Mon Apr 12 10:05:58 1999 @@ -1,8 +1,9 @@ /* * super.c * - * Copyright (C) 1995-1997 Martin von Löwis + * Copyright (C) 1995-1997, 1999 Martin von Löwis * Copyright (C) 1996-1997 Régis Duchesne + * Copyright (C) 1999 Steve Dodd */ #include "ntfstypes.h" @@ -113,12 +114,14 @@ ntfs_io io; #define UPCASE_LENGTH 256 upcase->vol->upcase = ntfs_malloc(2*UPCASE_LENGTH); - upcase->vol->upcase_length = UPCASE_LENGTH; + if( !upcase->vol->upcase ) + return; io.fn_put=ntfs_put; io.fn_get=0; io.param=(char*)upcase->vol->upcase; io.size=2*UPCASE_LENGTH; ntfs_read_attr(upcase,upcase->vol->at_data,0,0,&io); + upcase->vol->upcase_length = io.size; } static int @@ -246,11 +249,22 @@ return 0; } -int ntfs_get_volumesize(ntfs_volume *vol) +/* + * Writes the volume size into vol_size. Returns 0 if successful + * or error. + */ +int ntfs_get_volumesize(ntfs_volume *vol, long *vol_size ) { ntfs_io io; - char *cluster0=ntfs_malloc(vol->clustersize); ntfs_u64 size; + char *cluster0; + + if( !vol_size ) + return EFAULT; + + cluster0=ntfs_malloc(vol->clustersize); + if( !cluster0 ) + return ENOMEM; io.fn_put=ntfs_put; io.fn_get=ntfs_get; @@ -262,7 +276,8 @@ ntfs_free(cluster0); /* FIXME: more than 2**32 cluster */ /* FIXME: gcc will emit udivdi3 if we don't truncate it */ - return ((unsigned int)size)/vol->clusterfactor; + *vol_size = ((unsigned long)size)/vol->clusterfactor; + return 0; } static int nc[16]={4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0}; @@ -337,7 +352,7 @@ int start,stop=0,in=0; /* special case searching for a single block */ if(*cnt==1){ - while(l && *cnt==0xFF){ + while(l && *bits==0xFF){ bits++; *loc+=8; l--; @@ -398,7 +413,7 @@ io.fn_put=ntfs_put; io.fn_get=ntfs_get; - bsize=(cnt+(loc & 7)+7) & ~7; /* round up to multiple of 8*/ + bsize=(cnt+(loc & 7)+7) >> 3; /* round up to multiple of 8*/ bits=ntfs_malloc(bsize); io.param=bits; io.size=bsize; @@ -418,7 +433,7 @@ else *it &= ~(1<<(locit%8)); cnt--;locit++; - if(locit%8==7) + if(locit%8==0) it++; } while(cnt>8){ /*process full bytes */ @@ -456,10 +471,13 @@ unsigned char *bits; ntfs_io io; int error=0,found=0; - int loc,cnt,bloc=-1,bcnt=0; + int cnt,bloc=-1,bcnt=0; int start; + ntfs_cluster_t loc; bits=ntfs_malloc(2048); + if( !bits ) + return ENOMEM; io.fn_put=ntfs_put; io.fn_get=ntfs_get; io.param=bits; diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/super.h linux/fs/ntfs/super.h --- v2.2.5/linux/fs/ntfs/super.h Mon Jan 4 15:08:17 1999 +++ linux/fs/ntfs/super.h Mon Apr 12 10:05:58 1999 @@ -10,7 +10,7 @@ #define ALLOC_REQUIRE_SIZE 2 int ntfs_get_free_cluster_count(ntfs_inode *bitmap); -int ntfs_get_volumesize(ntfs_volume *vol); +int ntfs_get_volumesize(ntfs_volume *vol, long *vol_size ); int ntfs_init_volume(ntfs_volume *vol,char *boot); int ntfs_load_special_files(ntfs_volume *vol); int ntfs_release_volume(ntfs_volume *vol); diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/support.c linux/fs/ntfs/support.c --- v2.2.5/linux/fs/ntfs/support.c Mon Jan 4 15:08:17 1999 +++ linux/fs/ntfs/support.c Mon Apr 12 10:05:58 1999 @@ -246,6 +246,10 @@ if(!(vol->nct & nct_uni_xlate))goto inval; /* realloc */ buf=ntfs_malloc(*out_len+3); + if( !buf ) { + ntfs_free( result ); + return ENOMEM; + } memcpy(buf,result,o); ntfs_free(result); result=buf; diff -u --recursive --new-file v2.2.5/linux/fs/open.c linux/fs/open.c --- v2.2.5/linux/fs/open.c Tue Mar 23 14:35:48 1999 +++ linux/fs/open.c Fri Apr 16 14:21:39 1999 @@ -69,6 +69,10 @@ int error; struct iattr newattrs; + /* Not pretty: "inode->i_size" shouldn't really be "off_t". But it is. */ + if ((off_t) length < 0) + return -EINVAL; + down(&inode->i_sem); newattrs.ia_size = length; newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; @@ -294,11 +298,16 @@ /* Clear the capabilities if we switch to a non-root user */ if (current->uid) cap_clear(current->cap_effective); - + else + current->cap_effective = current->cap_permitted; + dentry = namei(filename); 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; dput(dentry); } diff -u --recursive --new-file v2.2.5/linux/fs/proc/link.c linux/fs/proc/link.c --- v2.2.5/linux/fs/proc/link.c Mon Sep 28 10:51:35 1998 +++ linux/fs/proc/link.c Mon Apr 12 16:18:26 1999 @@ -158,7 +158,7 @@ path = tmp; } else { path = d_path(dentry, tmp, PAGE_SIZE); - len = tmp + PAGE_SIZE - path; + len = tmp + PAGE_SIZE - 1 - path; } if (len < buflen) diff -u --recursive --new-file v2.2.5/linux/fs/smbfs/dir.c linux/fs/smbfs/dir.c --- v2.2.5/linux/fs/smbfs/dir.c Tue Dec 22 14:16:57 1998 +++ linux/fs/smbfs/dir.c Mon Apr 12 10:03:45 1999 @@ -423,9 +423,6 @@ printk("smb_create: creating %s/%s, mode=%d\n", dentry->d_parent->d_name.name, dentry->d_name.name, mode); #endif - error = -ENAMETOOLONG; - if (dentry->d_name.len > SMB_MAXNAMELEN) - goto out; smb_invalid_dir_cache(dir); error = smb_proc_create(dentry, 0, CURRENT_TIME, &fileid); @@ -439,7 +436,6 @@ dentry->d_parent->d_name.name, dentry->d_name.name, error); #endif } -out: return error; } @@ -449,17 +445,12 @@ { int error; - error = -ENAMETOOLONG; - if (dentry->d_name.len > SMB_MAXNAMELEN) - goto out; - smb_invalid_dir_cache(dir); error = smb_proc_mkdir(dentry); if (!error) { error = smb_instantiate(dentry, 0, 0); } -out: return error; } @@ -514,11 +505,6 @@ { int error; - error = -ENAMETOOLONG; - if (old_dentry->d_name.len > SMB_MAXNAMELEN || - new_dentry->d_name.len > SMB_MAXNAMELEN) - goto out; - /* * Close any open files, and check whether to delete the * target before attempting the rename. @@ -537,6 +523,7 @@ #endif goto out; } + /* FIXME */ d_delete(new_dentry); } @@ -547,7 +534,6 @@ { smb_renew_times(old_dentry); smb_renew_times(new_dentry); - d_move(old_dentry, new_dentry); } out: return error; diff -u --recursive --new-file v2.2.5/linux/fs/super.c linux/fs/super.c --- v2.2.5/linux/fs/super.c Fri Jan 8 22:36:14 1999 +++ linux/fs/super.c Mon Apr 12 10:03:45 1999 @@ -559,6 +559,7 @@ s->s_dev = dev; s->s_flags = flags; s->s_dirt = 0; + sema_init(&s->s_vfs_rename_sem,1); /* N.B. Should lock superblock now ... */ if (!type->read_super(s, data, silent)) goto out_fail; diff -u --recursive --new-file v2.2.5/linux/fs/sysv/namei.c linux/fs/sysv/namei.c --- v2.2.5/linux/fs/sysv/namei.c Tue Mar 23 14:35:48 1999 +++ linux/fs/sysv/namei.c Mon Apr 12 10:03:45 1999 @@ -594,8 +594,8 @@ * Anybody can rename anything with this: the permission checks are left to the * higher-level routines. */ -static int do_sysv_rename(struct inode * old_dir, struct dentry * old_dentry, - struct inode * new_dir, struct dentry * new_dentry) +int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, + struct inode * new_dir, struct dentry * new_dentry) { struct inode * old_inode, * new_inode; struct buffer_head * old_bh, * new_bh, * dir_bh; @@ -628,20 +628,8 @@ new_bh = NULL; } } - if (new_inode == old_inode) { - retval = 0; - goto end_rename; - } if (S_ISDIR(old_inode->i_mode)) { - retval = -EINVAL; - if (is_subdir(new_dentry, old_dentry)) - goto end_rename; if (new_inode) { - if (new_dentry->d_count > 1) - shrink_dcache_parent(new_dentry); - retval = -EBUSY; - if (new_dentry->d_count > 1) - goto end_rename; retval = -ENOTEMPTY; if (!empty_dir(new_inode)) goto end_rename; @@ -696,37 +684,10 @@ mark_inode_dirty(new_dir); } } - d_move(old_dentry, new_dentry); retval = 0; end_rename: brelse(dir_bh); brelse(old_bh); brelse(new_bh); return retval; -} - -/* - * Ok, rename also locks out other renames, as they can change the parent of - * a directory, and we don't want any races. Other races are checked for by - * "do_rename()", which restarts if there are inconsistencies. - * - * Note that there is no race between different filesystems: it's only within - * the same device that races occur: many renames can happen at once, as long - * as they are on different partitions. - */ -int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, - struct inode * new_dir, struct dentry * new_dentry) -{ - static struct wait_queue * wait = NULL; - static int lock = 0; - int result; - - while (lock) - sleep_on(&wait); - lock = 1; - result = do_sysv_rename(old_dir, old_dentry, - new_dir, new_dentry); - lock = 0; - wake_up(&wait); - return result; } diff -u --recursive --new-file v2.2.5/linux/fs/ufs/namei.c linux/fs/ufs/namei.c --- v2.2.5/linux/fs/ufs/namei.c Tue Jan 19 11:32:52 1999 +++ linux/fs/ufs/namei.c Mon Apr 12 10:03:45 1999 @@ -250,12 +250,6 @@ swab = sb->u.ufs_sb.s_swab; uspi = sb->u.ufs_sb.s_uspi; - if (namelen > UFS_MAXNAMLEN) - { - *err = -ENAMETOOLONG; - return NULL; - } - if (!namelen) return NULL; /* @@ -469,10 +463,6 @@ sb = dir->i_sb; flags = sb->u.ufs_sb.s_flags; swab = sb->u.ufs_sb.s_swab; - - err = -ENAMETOOLONG; - if (dentry->d_name.len > UFS_MAXNAMLEN) - goto out; inode = ufs_new_inode (dir, mode, &err); if (!inode) @@ -528,10 +518,6 @@ sb = dir->i_sb; flags = sb->u.ufs_sb.s_flags; swab = sb->u.ufs_sb.s_swab; - - err = -ENAMETOOLONG; - if (dentry->d_name.len > UFS_MAXNAMLEN) - goto out; err = -EMLINK; if (dir->i_nlink >= UFS_LINK_MAX) @@ -670,10 +656,6 @@ swab = sb->u.ufs_sb.s_swab; UFSD(("ENTER\n")) - - retval = -ENAMETOOLONG; - if (dentry->d_name.len > UFS_MAXNAMLEN) - goto out; retval = -ENOENT; bh = ufs_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &de); @@ -687,14 +669,12 @@ if (SWAB32(de->d_ino) != inode->i_ino) goto end_rmdir; + retval = -ENOTEMPTY; if (!ufs_empty_dir (inode)) - retval = -ENOTEMPTY; - else if (SWAB32(de->d_ino) != inode->i_ino) - retval = -ENOENT; - else { - retval = ufs_delete_entry (dir, de, bh); - dir->i_version = ++event; - } + goto end_rmdir; + + retval = ufs_delete_entry (dir, de, bh); + dir->i_version = ++event; if (retval) goto end_rmdir; mark_buffer_dirty(bh, 1); @@ -717,7 +697,6 @@ end_rmdir: brelse (bh); -out: UFSD(("EXIT\n")) return retval; @@ -735,10 +714,6 @@ sb = dir->i_sb; flags = sb->u.ufs_sb.s_flags; swab = sb->u.ufs_sb.s_swab; - - retval = -ENAMETOOLONG; - if (dentry->d_name.len > UFS_MAXNAMLEN) - goto out; retval = -ENOENT; bh = ufs_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &de); @@ -779,7 +754,6 @@ end_unlink: brelse (bh); -out: return retval; } @@ -881,9 +855,6 @@ if (S_ISDIR(inode->i_mode)) return -EPERM; - if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) - return -EPERM; - if (inode->i_nlink >= UFS_LINK_MAX) return -EMLINK; @@ -912,17 +883,10 @@ ((struct ufs_dir_entry *) ((char *) buffer + \ SWAB16(((struct ufs_dir_entry *) buffer)->d_reclen)))->d_ino /* - * rename uses retrying to avoid race-conditions: at least they should be - * minimal. - * it tries to allocate all the blocks, then sanity-checks, and if the sanity- - * checks fail, it tries to restart itself again. Very practical - no changes - * are done until we know everything works ok.. and then all the changes can be - * done in one fell swoop when we have claimed all the buffers needed. - * * Anybody can rename anything with this: the permission checks are left to the * higher-level routines. */ -static int do_ufs_rename (struct inode * old_dir, struct dentry * old_dentry, +int ufs_rename (struct inode * old_dir, struct dentry * old_dentry, struct inode * new_dir, struct dentry * new_dentry ) { struct super_block * sb; @@ -941,9 +905,6 @@ old_inode = new_inode = NULL; old_bh = new_bh = dir_bh = NULL; new_de = NULL; - retval = -ENAMETOOLONG; - if (old_dentry->d_name.len > UFS_MAXNAMLEN) - goto end_rename; old_bh = ufs_find_entry (old_dir, old_dentry->d_name.name, old_dentry->d_name.len, &old_de); /* @@ -967,25 +928,14 @@ DQUOT_INIT(new_inode); } } - retval = 0; - if (new_inode == old_inode) - goto end_rename; if (S_ISDIR(old_inode->i_mode)) { - retval = -EINVAL; - if (is_subdir(new_dentry, old_dentry)) - goto end_rename; if (new_inode) { - /* Prune any children before testing for busy */ - if (new_dentry->d_count > 1) - shrink_dcache_parent(new_dentry); - retval = -EBUSY; - if (new_dentry->d_count > 1) - goto end_rename; retval = -ENOTEMPTY; if (!ufs_empty_dir (new_inode)) goto end_rename; } + retval = -EIO; dir_bh = ufs_bread (old_inode, 0, 0, &retval); if (!dir_bh) goto end_rename; @@ -1042,8 +992,6 @@ wait_on_buffer (new_bh); } - /* Update the dcache */ - d_move(old_dentry, new_dentry); retval = 0; end_rename: brelse (dir_bh); @@ -1054,36 +1002,3 @@ return retval; } - -/* - * Ok, rename also locks out other renames, as they can change the parent of - * a directory, and we don't want any races. Other races are checked for by - * "do_rename()", which restarts if there are inconsistencies. - * - * Note that there is no race between different filesystems: it's only within - * the same device that races occur: many renames can happen at once, as long - * as they are on different partitions. - * - * In the second extended file system, we use a lock flag stored in the memory - * super-block. This way, we really lock other renames only if they occur - * on the same file system - */ -int ufs_rename (struct inode * old_dir, struct dentry *old_dentry, - struct inode * new_dir, struct dentry *new_dentry ) -{ - int result; - - UFSD(("ENTER\n")) - - while (old_dir->i_sb->u.ufs_sb.s_rename_lock) - sleep_on (&old_dir->i_sb->u.ufs_sb.s_rename_wait); - old_dir->i_sb->u.ufs_sb.s_rename_lock = 1; - result = do_ufs_rename (old_dir, old_dentry, new_dir, new_dentry); - old_dir->i_sb->u.ufs_sb.s_rename_lock = 0; - wake_up (&old_dir->i_sb->u.ufs_sb.s_rename_wait); - - UFSD(("EXIT\n")) - - return result; -} - diff -u --recursive --new-file v2.2.5/linux/fs/ufs/super.c linux/fs/ufs/super.c --- v2.2.5/linux/fs/ufs/super.c Tue Jan 19 11:32:52 1999 +++ linux/fs/ufs/super.c Mon Apr 12 10:03:45 1999 @@ -125,7 +125,7 @@ printk(" cssize: %u\n", SWAB32(usb1->fs_cssize)); printk(" cgsize: %u\n", SWAB32(usb1->fs_cgsize)); printk(" fstodb: %u\n", SWAB32(usb1->fs_fsbtodb)); - printk(" contigsumsize: %d\n", SWAB32(usb3->fs_u.fs_44.fs_contigsumsize)); + printk(" contigsumsize: %d\n", SWAB32(usb3->fs_u2.fs_44.fs_contigsumsize)); printk(" postblformat: %u\n", SWAB32(usb3->fs_postblformat)); printk(" nrpos: %u\n", SWAB32(usb3->fs_nrpos)); printk(" ndir %u\n", SWAB32(usb1->fs_cstotal.cs_ndir)); @@ -269,10 +269,12 @@ ufs_set_opt (*mount_options, UFSTYPE_SUN); else if (!strcmp (value, "44bsd")) ufs_set_opt (*mount_options, UFSTYPE_44BSD); - else if (!strcmp (value, "next")) - ufs_set_opt (*mount_options, UFSTYPE_NEXT); + else if (!strcmp (value, "nextstep")) + ufs_set_opt (*mount_options, UFSTYPE_NEXTSTEP); else if (!strcmp (value, "openstep")) ufs_set_opt (*mount_options, UFSTYPE_OPENSTEP); + else if (!strcmp (value, "sunx86")) + ufs_set_opt (*mount_options, UFSTYPE_SUNx86); else { printk ("UFS-fs: Invalid type option: %s\n", value); return 0; @@ -463,7 +465,7 @@ } if (!(sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE)) { printk("You didn't specify the type of your ufs filesystem\n\n" - " mount -t ufs -o ufstype=sun|44bsd|old|next|openstep ....\n\n" + " mount -t ufs -o ufstype=sun|sunx86|44bsd|old|nextstep|openstep ....\n\n" ">>>WARNING<<< Wrong ufstype may corrupt your filesystem, " "default is ufstype=old\n"); ufs_set_opt (sb->u.ufs_sb.s_mount_opt, UFSTYPE_OLD); @@ -495,6 +497,16 @@ flags |= UFS_DE_OLD | UFS_UID_EFT | UFS_ST_SUN | UFS_CG_SUN; break; + case UFS_MOUNT_UFSTYPE_SUNx86: + UFSD(("ufstype=sunx86\n")) + uspi->s_fsize = block_size = 1024; + uspi->s_fmask = ~(1024 - 1); + uspi->s_fshift = 10; + uspi->s_sbsize = super_block_size = 2048; + uspi->s_sbbase = 0; + flags |= UFS_DE_OLD | UFS_UID_EFT | UFS_ST_SUNx86 | UFS_CG_SUN; + break; + case UFS_MOUNT_UFSTYPE_OLD: UFSD(("ufstype=old\n")) uspi->s_fsize = block_size = 1024; @@ -509,8 +521,8 @@ } break; - case UFS_MOUNT_UFSTYPE_NEXT: - UFSD(("ufstype=next\n")) + case UFS_MOUNT_UFSTYPE_NEXTSTEP: + UFSD(("ufstype=nextstep\n")) uspi->s_fsize = block_size = 1024; uspi->s_fmask = ~(1024 - 1); uspi->s_fshift = 10; @@ -518,7 +530,7 @@ uspi->s_sbbase = 0; flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; if (!(sb->s_flags & MS_RDONLY)) { - printk(KERN_INFO "ufstype=next is supported read-only\n"); + printk(KERN_INFO "ufstype=nextstep is supported read-only\n"); sb->s_flags |= MS_RDONLY; } break; @@ -579,10 +591,9 @@ } #endif - if ((((sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE) == - UFS_MOUNT_UFSTYPE_NEXT) || - ((sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE) == - UFS_MOUNT_UFSTYPE_OPENSTEP)) && uspi->s_sbbase < 256) { + if ((((sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE) == UFS_MOUNT_UFSTYPE_NEXTSTEP) + || ((sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE) == UFS_MOUNT_UFSTYPE_OPENSTEP)) + && uspi->s_sbbase < 256) { ubh_brelse_uspi(uspi); ubh = NULL; uspi->s_sbbase += 8; @@ -627,9 +638,10 @@ * If not, make it read only. */ if (((flags & UFS_ST_MASK) == UFS_ST_44BSD) || - ((flags & UFS_ST_MASK) == UFS_ST_OLD) || - (((flags & UFS_ST_MASK) == UFS_ST_SUN) && - (ufs_get_fs_state(usb3) == (UFS_FSOK - SWAB32(usb1->fs_time))))) { + ((flags & UFS_ST_MASK) == UFS_ST_OLD) || + (((flags & UFS_ST_MASK) == UFS_ST_SUN || + (flags & UFS_ST_MASK) == UFS_ST_SUNx86) && + (ufs_get_fs_state(usb1, usb3) == (UFS_FSOK - SWAB32(usb1->fs_time))))) { switch(usb1->fs_clean) { case UFS_FSCLEAN: UFSD(("fs is clean\n")) @@ -649,8 +661,7 @@ sb->s_flags |= MS_RDONLY; break; default: - printk("ufs_read_super: can't grok fs_clean 0x%x\n", - usb1->fs_clean); + printk("ufs_read_super: can't grok fs_clean 0x%x\n", usb1->fs_clean); sb->s_flags |= MS_RDONLY; break; } @@ -694,7 +705,7 @@ uspi->s_nindir = SWAB32(usb1->fs_nindir); uspi->s_inopb = SWAB32(usb1->fs_inopb); uspi->s_nspf = SWAB32(usb1->fs_nspf); - uspi->s_npsect = SWAB32(usb1->fs_npsect); + uspi->s_npsect = ufs_get_fs_npsect(usb1, usb3); uspi->s_interleave = SWAB32(usb1->fs_interleave); uspi->s_trackskew = SWAB32(usb1->fs_trackskew); uspi->s_csaddr = SWAB32(usb1->fs_csaddr); @@ -706,7 +717,7 @@ uspi->s_ipg = SWAB32(usb1->fs_ipg); uspi->s_fpg = SWAB32(usb1->fs_fpg); uspi->s_cpc = SWAB32(usb2->fs_cpc); - uspi->s_contigsumsize = SWAB32(usb3->fs_u.fs_44.fs_contigsumsize); + uspi->s_contigsumsize = SWAB32(usb3->fs_u2.fs_44.fs_contigsumsize); uspi->s_qbmask = ufs_get_fs_qbmask(usb3); uspi->s_qfmask = ufs_get_fs_qfmask(usb3); uspi->s_postblformat = SWAB32(usb3->fs_postblformat); @@ -734,8 +745,6 @@ sb->u.ufs_sb.s_flags = flags; sb->u.ufs_sb.s_swab = swab; - sb->u.ufs_sb.s_rename_lock = 0; - sb->u.ufs_sb.s_rename_wait = NULL; sb->s_root = d_alloc_root(iget(sb, UFS_ROOTINO), NULL); @@ -776,8 +785,9 @@ if (!(sb->s_flags & MS_RDONLY)) { usb1->fs_time = SWAB32(CURRENT_TIME); - if (usb1->fs_clean == UFS_FSCLEAN && (flags&UFS_ST_MASK) == UFS_ST_SUN) - ufs_set_fs_state(usb3, UFS_FSOK - SWAB32(usb1->fs_time)); + if ((flags & UFS_ST_MASK) == UFS_ST_SUN + || (flags & UFS_ST_MASK) == UFS_ST_SUNx86) + ufs_set_fs_state(usb1, usb3, UFS_FSOK - SWAB32(usb1->fs_time)); ubh_mark_buffer_dirty (USPI_UBH, 1); } sb->s_dirt = 0; @@ -842,8 +852,9 @@ if (*mount_flags & MS_RDONLY) { ufs_put_cylinder_structures(sb); usb1->fs_time = SWAB32(CURRENT_TIME); - if (usb1->fs_clean == UFS_FSCLEAN && (flags&UFS_ST_MASK) == UFS_ST_SUN) - ufs_set_fs_state(usb3, UFS_FSOK - SWAB32(usb1->fs_time)); + if ((flags & UFS_ST_MASK) == UFS_ST_SUN + || (flags & UFS_ST_MASK) == UFS_ST_SUNx86) + ufs_set_fs_state(usb1, usb3, UFS_FSOK - SWAB32(usb1->fs_time)); ubh_mark_buffer_dirty (USPI_UBH, 1); sb->s_dirt = 0; sb->s_flags |= MS_RDONLY; diff -u --recursive --new-file v2.2.5/linux/fs/ufs/util.h linux/fs/ufs/util.h --- v2.2.5/linux/fs/ufs/util.h Sun Nov 8 14:03:08 1998 +++ linux/fs/ufs/util.h Mon Apr 12 09:53:45 1999 @@ -31,24 +31,46 @@ /* * macros used for accesing structures */ -#define ufs_get_fs_state(usb3) _ufs_get_fs_state_(usb3,flags,swab) -static inline __s32 _ufs_get_fs_state_(struct ufs_super_block_third * usb3, - unsigned flags, unsigned swab) +#define ufs_get_fs_state(usb1,usb3) _ufs_get_fs_state_(usb1,usb3,flags,swab) +static inline __s32 _ufs_get_fs_state_(struct ufs_super_block_first * usb1, + struct ufs_super_block_third * usb3, unsigned flags, unsigned swab) +{ + switch (flags & UFS_ST_MASK) { + case UFS_ST_SUN: + return SWAB32((usb3)->fs_u2.fs_sun.fs_state); + case UFS_ST_SUNx86: + return SWAB32((usb1)->fs_u1.fs_sunx86.fs_state); + case UFS_ST_44BSD: + default: + return SWAB32((usb3)->fs_u2.fs_44.fs_state); + } +} + +#define ufs_set_fs_state(usb1,usb3,value) _ufs_set_fs_state_(usb1,usb3,value,flags,swab) +static inline void _ufs_set_fs_state_(struct ufs_super_block_first * usb1, + struct ufs_super_block_third * usb3, __s32 value, unsigned flags, unsigned swab) { - if ((flags & UFS_ST_MASK) == UFS_ST_SUN) - return SWAB32((usb3)->fs_u.fs_sun.fs_state); - else - return SWAB32((usb3)->fs_u.fs_44.fs_state); + switch (flags & UFS_ST_MASK) { + case UFS_ST_SUN: + (usb3)->fs_u2.fs_sun.fs_state = SWAB32(value); + break; + case UFS_ST_SUNx86: + (usb1)->fs_u1.fs_sunx86.fs_state = SWAB32(value); + break; + case UFS_ST_44BSD: + (usb3)->fs_u2.fs_44.fs_state = SWAB32(value); + break; + } } -#define ufs_set_fs_state(usb3,value) _ufs_set_fs_state_(usb3,value,flags,swab) -static inline void _ufs_set_fs_state_(struct ufs_super_block_third * usb3, - __s32 value, unsigned flags, unsigned swab) +#define ufs_get_fs_npsect(usb1,usb3) _ufs_get_fs_npsect_(usb1,usb3,flags,swab) +static inline __u32 _ufs_get_fs_npsect_(struct ufs_super_block_first * usb1, + struct ufs_super_block_third * usb3, unsigned flags, unsigned swab) { - if ((flags & UFS_ST_MASK) == UFS_ST_SUN) - (usb3)->fs_u.fs_sun.fs_state = SWAB32(value); - else - (usb3)->fs_u.fs_44.fs_state = SWAB32(value); + if ((flags & UFS_ST_MASK) == UFS_ST_SUNx86) + return SWAB32((usb3)->fs_u2.fs_sunx86.fs_npsect); + else + return SWAB32((usb1)->fs_u1.fs_sun.fs_npsect); } #define ufs_get_fs_qbmask(usb3) _ufs_get_fs_qbmask_(usb3,flags,swab) @@ -56,13 +78,19 @@ unsigned flags, unsigned swab) { __u64 tmp; - if ((flags & UFS_ST_MASK) == UFS_ST_SUN) { - ((u32 *)&tmp)[0] = usb3->fs_u.fs_sun.fs_qbmask[0]; - ((u32 *)&tmp)[1] = usb3->fs_u.fs_sun.fs_qbmask[1]; - } - else { - ((u32 *)&tmp)[0] = usb3->fs_u.fs_44.fs_qbmask[0]; - ((u32 *)&tmp)[1] = usb3->fs_u.fs_44.fs_qbmask[1]; + switch (flags & UFS_ST_MASK) { + case UFS_ST_SUN: + ((u32 *)&tmp)[0] = usb3->fs_u2.fs_sun.fs_qbmask[0]; + ((u32 *)&tmp)[1] = usb3->fs_u2.fs_sun.fs_qbmask[1]; + break; + case UFS_ST_SUNx86: + ((u32 *)&tmp)[0] = usb3->fs_u2.fs_sunx86.fs_qbmask[0]; + ((u32 *)&tmp)[1] = usb3->fs_u2.fs_sunx86.fs_qbmask[1]; + break; + case UFS_ST_44BSD: + ((u32 *)&tmp)[0] = usb3->fs_u2.fs_44.fs_qbmask[0]; + ((u32 *)&tmp)[1] = usb3->fs_u2.fs_44.fs_qbmask[1]; + break; } return SWAB64(tmp); } @@ -72,13 +100,19 @@ unsigned flags, unsigned swab) { __u64 tmp; - if ((flags & UFS_ST_MASK) == UFS_ST_SUN) { - ((u32 *)&tmp)[0] = usb3->fs_u.fs_sun.fs_qfmask[0]; - ((u32 *)&tmp)[1] = usb3->fs_u.fs_sun.fs_qfmask[1]; - } - else { - ((u32 *)&tmp)[0] = usb3->fs_u.fs_44.fs_qfmask[0]; - ((u32 *)&tmp)[1] = usb3->fs_u.fs_44.fs_qfmask[1]; + switch (flags & UFS_ST_MASK) { + case UFS_ST_SUN: + ((u32 *)&tmp)[0] = usb3->fs_u2.fs_sun.fs_qfmask[0]; + ((u32 *)&tmp)[1] = usb3->fs_u2.fs_sun.fs_qfmask[1]; + break; + case UFS_ST_SUNx86: + ((u32 *)&tmp)[0] = usb3->fs_u2.fs_sunx86.fs_qfmask[0]; + ((u32 *)&tmp)[1] = usb3->fs_u2.fs_sunx86.fs_qfmask[1]; + break; + case UFS_ST_44BSD: + ((u32 *)&tmp)[0] = usb3->fs_u2.fs_44.fs_qfmask[0]; + ((u32 *)&tmp)[1] = usb3->fs_u2.fs_44.fs_qfmask[1]; + break; } return SWAB64(tmp); } diff -u --recursive --new-file v2.2.5/linux/fs/umsdos/dir.c linux/fs/umsdos/dir.c --- v2.2.5/linux/fs/umsdos/dir.c Wed Dec 16 10:32:56 1998 +++ linux/fs/umsdos/dir.c Mon Apr 12 10:03:45 1999 @@ -598,6 +598,33 @@ return ret; } +struct dentry *umsdos_covered(struct dentry *parent, char *name, int len) +{ + struct dentry *result, *dentry; + int error; + struct qstr qstr; + + qstr.name = name; + qstr.len = len; + qstr.hash = full_name_hash(name, len); + result = ERR_PTR(-ENOMEM); + dentry = d_alloc(parent, &qstr); + if (dentry) { + result = dentry; + /* XXXXXXXXXXXXXXXXXXX Race alert! */ + error = UMSDOS_rlookup(parent->d_inode, result); + d_drop(result); + if (error) + goto out_fail; + } +out: + return result; + +out_fail: + dput(result); + result = ERR_PTR(error); + goto out; +} /* * Lookup or create a dentry from within the filesystem. @@ -706,11 +733,6 @@ len = (int) (pt - start); if (*pt == '/') *pt++ = '\0'; - real = (dir->d_inode->u.umsdos_i.i_emd_dir == 0); - /* - * Hack alert! inode->u.umsdos_i.i_emd_dir isn't reliable, - * so just check whether there's an EMD file ... - */ real = 1; demd = umsdos_get_emd_dentry(dir); if (!IS_ERR(demd)) { @@ -720,9 +742,8 @@ } #ifdef UMSDOS_DEBUG_VERBOSE -printk ("umsdos_solve_hlink: dir %s/%s, name=%s, emd_dir=%ld, real=%d\n", -dir->d_parent->d_name.name, dir->d_name.name, start, -dir->d_inode->u.umsdos_i.i_emd_dir, real); +printk ("umsdos_solve_hlink: dir %s/%s, name=%s, real=%d\n", +dir->d_parent->d_name.name, dir->d_name.name, start, real); #endif dentry_dst = umsdos_lookup_dentry(dir, start, len, real); if (real) diff -u --recursive --new-file v2.2.5/linux/fs/umsdos/emd.c linux/fs/umsdos/emd.c --- v2.2.5/linux/fs/umsdos/emd.c Mon Sep 28 10:51:35 1998 +++ linux/fs/umsdos/emd.c Mon Apr 12 10:03:45 1999 @@ -250,12 +250,8 @@ printk (KERN_WARNING "umsdos_make_emd: create %s/%s failed, err=%d\n", parent->d_name.name, demd->d_name.name, err); - goto out_dput; } out_set: - parent->d_inode->u.umsdos_i.i_emd_dir = demd->d_inode->i_ino; - -out_dput: dput(demd); out: return err; diff -u --recursive --new-file v2.2.5/linux/fs/umsdos/inode.c linux/fs/umsdos/inode.c --- v2.2.5/linux/fs/umsdos/inode.c Wed Dec 16 10:32:56 1998 +++ linux/fs/umsdos/inode.c Mon Apr 12 10:03:45 1999 @@ -50,10 +50,10 @@ void UMSDOS_put_inode (struct inode *inode) { PRINTK ((KERN_DEBUG - "put inode %p (%lu) owner %lu pos %lu dir %lu count=%d\n" + "put inode %p (%lu) pos %lu count=%d\n" ,inode, inode->i_ino - ,inode->u.umsdos_i.i_emd_owner, inode->u.umsdos_i.pos - ,inode->u.umsdos_i.i_emd_dir, inode->i_count)); + ,inode->u.umsdos_i.pos + ,inode->i_count)); if (inode == pseudo_root) { printk (KERN_ERR "Umsdos: Oops releasing pseudo_root." @@ -94,7 +94,6 @@ printk(KERN_ERR "umsdos_setup_dir: %s/%s not a dir!\n", dir->d_parent->d_name.name, dir->d_name.name); - inode->u.umsdos_i.i_emd_dir = 0; inode->i_op = &umsdos_rdir_inode_operations; if (umsdos_have_emd(dir)) { Printk((KERN_DEBUG "umsdos_setup_dir: %s/%s using EMD\n", @@ -112,14 +111,11 @@ struct inode *inode = dentry->d_inode; struct dentry *demd; - inode->u.umsdos_i.i_emd_owner = 0; inode->u.umsdos_i.pos = f_pos; /* now check the EMD file */ demd = umsdos_get_emd_dentry(dentry->d_parent); if (!IS_ERR(demd)) { - if (demd->d_inode) - inode->u.umsdos_i.i_emd_owner = demd->d_inode->i_ino; dput(demd); } return; @@ -149,7 +145,6 @@ dentry, f_pos)); umsdos_set_dirinfo_new(dentry, f_pos); - inode->u.umsdos_i.i_emd_dir = 0; if (S_ISREG (inode->i_mode)) { if (MSDOS_SB (inode->i_sb)->cvf_format) { if (MSDOS_SB (inode->i_sb)->cvf_format->flags & CVF_USE_READPAGE) { @@ -327,8 +322,6 @@ { struct iattr newattrs; - PRINTK (("UMSDOS_write_inode emd %d (FIXME: missing notify_change)\n", - inode->u.umsdos_i.i_emd_owner)); fat_write_inode (inode); newattrs.ia_mtime = inode->i_mtime; newattrs.ia_atime = inode->i_atime; diff -u --recursive --new-file v2.2.5/linux/fs/umsdos/namei.c linux/fs/umsdos/namei.c --- v2.2.5/linux/fs/umsdos/namei.c Tue Dec 22 14:16:57 1998 +++ linux/fs/umsdos/namei.c Mon Apr 12 10:03:45 1999 @@ -6,6 +6,10 @@ * * Maintain and access the --linux alternate directory file. */ + /* + * You are in the maze of twisted functions - half of them shouldn't + * be here... + */ #include #include @@ -258,16 +262,11 @@ goto out; /* do a real lookup to get the short name dentry */ - fake = umsdos_lookup_dentry(dentry->d_parent, info.fake.fname, - info.fake.len, 1); + fake = umsdos_covered(dentry->d_parent, info.fake.fname, info.fake.len); ret = PTR_ERR(fake); if (IS_ERR(fake)) goto out_remove; - /* keep the short name anonymous ... */ - if (dentry != fake) - d_drop(fake); - /* should not exist yet ... */ ret = -EEXIST; if (fake->d_inode) @@ -278,14 +277,8 @@ goto out_remove_dput; inode = fake->d_inode; - /* - * Note! The long and short name might be the same, - * so check first before doing the instantiate ... - */ - if (dentry != fake) { - inode->i_count++; - d_instantiate (dentry, inode); - } + inode->i_count++; + d_instantiate (dentry, inode); dput(fake); if (inode->i_count > 1) { printk(KERN_WARNING @@ -363,7 +356,7 @@ { struct inode *old_inode = old_dentry->d_inode; struct dentry *old, *new, *old_emd; - int err, ret, rehash = 0; + int err, ret; struct umsdos_info old_info; struct umsdos_info new_info; @@ -386,34 +379,11 @@ umsdos_lockcreate2 (old_dir, new_dir); ret = umsdos_findentry(old_emd->d_parent, &old_info, 0); - if (ret) { - printk(KERN_ERR - "umsdos_rename_f: old entry %s/%s not in EMD, ret=%d\n", - old_dentry->d_parent->d_name.name, old_info.entry.name, - ret); - goto out_unlock; - } - - /* check sticky bit on old_dir */ - ret = -EPERM; - if (is_sticky(old_dir, old_info.entry.uid)) { -printk("umsdos_rename_f: %s/%s old sticky bit, fsuid=%d, uid=%d, dir=%d\n", -old_dentry->d_parent->d_name.name, old_info.entry.name, -current->fsuid, old_info.entry.uid, old_dir->i_uid); + if (ret) goto out_unlock; - } - /* - * Check whether the new_name already exists, and - * if so whether we're allowed to replace it. - */ err = umsdos_findentry(new_dentry->d_parent, &new_info, 0); if (err == 0) { - /* Are we allowed to replace it? */ - if (is_sticky(new_dir, new_info.entry.uid)) { -Printk (("sticky set on new ")); - goto out_unlock; - } /* check whether it _really_ exists ... */ ret = -EEXIST; if (new_dentry->d_inode) @@ -427,108 +397,41 @@ S_ISDIR(new_info.entry.mode)); } -Printk (("new newentry ")); - /* create the new entry ... */ umsdos_ren_init (&new_info, &old_info); if (flags) new_info.entry.flags = flags; ret = umsdos_newentry (new_dentry->d_parent, &new_info); - if (ret) { - printk(KERN_WARNING - "umsdos_rename_f: newentry %s/%s failed, ret=%d\n", - new_dentry->d_parent->d_name.name, new_info.entry.name, - ret); + if (ret) goto out_unlock; - } /* If we're moving a hardlink, drop it first */ if (old_info.entry.flags & UMSDOS_HLINK) { - rehash = !list_empty(&old_dentry->d_hash); d_drop(old_dentry); -printk("umsdos_rename_f: moving hardlink %s/%s, rehash=%d\n", -old_dentry->d_parent->d_name.name, old_info.entry.name, rehash); } - /* Do a real lookup to get the old short name dentry */ - old = umsdos_lookup_dentry(old_dentry->d_parent, old_info.fake.fname, - old_info.fake.len, 1); + old = umsdos_covered(old_dentry->d_parent, old_info.fake.fname, + old_info.fake.len); ret = PTR_ERR(old); - if (IS_ERR(old)) { - printk(KERN_WARNING - "umsdos_rename_f: lookup old dentry %s/%s, ret=%d\n", - old_dentry->d_parent->d_name.name, old_info.fake.fname, - ret); + if (IS_ERR(old)) goto out_unlock; - } - /* short and long name dentries match? */ - if (old == old_dentry) - dput(old); - else { - /* make sure it's the same inode! */ - ret = -ENOENT; - if (old->d_inode != old_inode) - goto out_dput; - /* - * A cross-directory move with different short and long - * names has nasty complications: msdos-fs will need to - * change inodes, so we must check whether the original - * dentry is busy, and if the rename succeeds the short - * dentry will come back with a different inode. - * - * To handle this, we drop the dentry and free the inode, - * and then pick up the new inode after the rename. - */ - if (old_dir != new_dir) { - ret = -EBUSY; - if (old_dentry->d_count > 1) { -printk("umsdos_rename_f: old dentry %s/%s busy, d_count=%d\n", -old_dentry->d_parent->d_name.name, old_dentry->d_name.name,old_dentry->d_count); - goto out_dput; - } - d_drop(old_dentry); - d_delete(old_dentry); -printk("umsdos_rename_f: cross-dir move, %s/%s dropped\n", -old_dentry->d_parent->d_name.name, old_dentry->d_name.name); - } - } + /* make sure it's the same inode! */ + ret = -ENOENT; + if (old->d_inode != old_inode) + goto out_dput; - new = umsdos_lookup_dentry(new_dentry->d_parent, new_info.fake.fname, - new_info.fake.len, 1); + new = umsdos_covered(new_dentry->d_parent, new_info.fake.fname, + new_info.fake.len); ret = PTR_ERR(new); - if (IS_ERR(new)) { - printk(KERN_WARNING - "umsdos_rename_f: lookup new dentry %s/%s, ret=%d\n", - new_dentry->d_parent->d_name.name, new_info.fake.fname, - ret); + if (IS_ERR(new)) goto out_dput; - } -#ifdef UMSDOS_PARANOIA -if (new->d_inode != new_dentry->d_inode) -printk("umsdos_rename_f: new %s/%s, inode %p!=%p??\n", -new->d_parent->d_name.name, new->d_name.name, new->d_inode,new_dentry->d_inode); -#endif - /* short and long name dentries match? */ - if (new == new_dentry) - dput(new); -#ifdef UMSDOS_DEBUG_VERBOSE -printk("umsdos_rename_f: msdos_rename %s/%s(%ld) to %s/%s(%ld)\n", -old->d_parent->d_name.name, old->d_name.name, old->d_inode->i_ino, -new->d_parent->d_name.name, new->d_name.name, -new->d_inode ? new->d_inode->i_ino : 0); -#endif /* Do the msdos-level rename */ ret = msdos_rename (old_dir, old, new_dir, new); -Printk(("umsdos_rename_f: now %s/%s, ret=%d\n", -old->d_parent->d_name.name, old->d_name.name, ret)); - if (new != new_dentry) - dput(new); + dput(new); /* If the rename failed, remove the new EMD entry */ if (ret != 0) { -Printk(("umsdos_rename_f: rename failed, ret=%d, removing %s/%s\n", -ret, new_dentry->d_parent->d_name.name, new_info.entry.name)); umsdos_delentry (new_dentry->d_parent, &new_info, S_ISDIR (new_info.entry.mode)); goto out_dput; @@ -550,33 +453,6 @@ } /* - * Check whether to update the dcache ... if both - * old and new dentries match, it's already correct. - * If the targets were aliases, the old short-name - * dentry has the original target name. - */ - if (old_dentry != old) { - if (!old_dentry->d_inode) { - struct inode *inode = old->d_inode; - inode->i_count++; - d_instantiate(old_dentry, inode); -printk("umsdos_rename_f: %s/%s gets new ino=%ld\n", -old_dentry->d_parent->d_name.name, old_dentry->d_name.name, inode->i_ino); - } - if (new_dentry == new) - new_dentry = old; - goto move_it; - } else if (new_dentry != new) { - move_it: - /* this will rehash the dentry ... */ - d_move(old_dentry, new_dentry); - } - /* Check whether the old inode changed ... */ - if (old_dentry->d_inode != old_inode) { - umsdos_lookup_patch_new(old_dentry, &new_info); - } - - /* * Update f_pos so notify_change will succeed * if the file was already in use. */ @@ -584,8 +460,7 @@ /* dput() the dentry if we haven't already */ out_dput: - if (old_dentry != old) - dput(old); + dput(old); out_unlock: dput(old_emd); @@ -614,6 +489,9 @@ extern struct inode_operations umsdos_symlink_inode_operations; +/* + * AV. Should be called with dir->i_sem down. + */ static int umsdos_symlink_x (struct inode *dir, struct dentry *dentry, const char *symname, int mode, char flags) { @@ -745,8 +623,9 @@ goto cleanup; } /* rename the link to the hidden location ... */ - ret = umsdos_rename_f (olddir, olddentry, olddir, temp, + ret = umsdos_rename_f(olddir, olddentry, olddir, temp, UMSDOS_HIDDEN); + d_move(olddentry, temp); dput(temp); if (ret) { printk("umsdos_link: rename to %s/%s failed, ret=%d\n", @@ -1096,7 +975,7 @@ { struct dentry *temp, *link = NULL; struct inode *inode; - int ret, rehash = 0; + int ret; struct umsdos_info info; Printk(("UMSDOS_unlink: entering %s/%s\n", @@ -1135,10 +1014,7 @@ * the original dentry. */ if (info.entry.flags & UMSDOS_HLINK) { - rehash = !list_empty(&dentry->d_hash); d_drop(dentry); -Printk(("UMSDOS_unlink: hard link %s/%s, fake=%s, rehash=%d\n", -dentry->d_parent->d_name.name, dentry->d_name.name, info.fake.fname, rehash)); } /* Do a real lookup to get the short name dentry */ @@ -1247,57 +1123,31 @@ return ret; } - /* * Rename (move) a file. */ int UMSDOS_rename (struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry) { - struct dentry *new_target; int ret; -#ifdef UMSDOS_DEBUG_VERBOSE -printk("umsdos_rename: enter, %s/%s(%ld) to %s/%s(%ld)\n", -old_dentry->d_parent->d_name.name, old_dentry->d_name.name, -old_dentry->d_inode->i_ino, -new_dentry->d_parent->d_name.name, new_dentry->d_name.name, -new_dentry->d_inode ? new_dentry->d_inode->i_ino : 0); -#endif ret = umsdos_nevercreat (new_dir, new_dentry, -EEXIST); if (ret) - goto out; + return ret; - /* - * If the target already exists, delete it first. - */ + /* + * If the target already exists, delete it first. + */ if (new_dentry->d_inode) { - if (S_ISDIR(new_dentry->d_inode->i_mode)) + new_dentry->d_count++; + if (S_ISDIR(old_dentry->d_inode->i_mode)) ret = UMSDOS_rmdir (new_dir, new_dentry); else ret = UMSDOS_unlink (new_dir, new_dentry); + dput(new_dentry); if (ret) - goto out; + return ret; } - - /* - * If we didn't get a negative dentry, make a copy and hash it. - */ - new_target = new_dentry; - if (new_dentry->d_inode) { -printk("umsdos_rename: %s/%s not negative, hash=%d\n", -new_dentry->d_parent->d_name.name, new_dentry->d_name.name, -!list_empty(&new_dentry->d_hash)); - ret = -ENOMEM; - new_target = d_alloc(new_dentry->d_parent, &new_dentry->d_name); - if (!new_target) - goto out; - d_add(new_target, NULL); - } - ret = umsdos_rename_f(old_dir, old_dentry, new_dir, new_target, 0); - if (new_target != new_dentry) - dput(new_target); - -out: + ret = umsdos_rename_f(old_dir, old_dentry, new_dir, new_dentry, 0); return ret; } diff -u --recursive --new-file v2.2.5/linux/fs/vfat/namei.c linux/fs/vfat/namei.c --- v2.2.5/linux/fs/vfat/namei.c Wed Mar 10 15:29:49 1999 +++ linux/fs/vfat/namei.c Mon Apr 12 10:03:45 1999 @@ -1570,14 +1570,6 @@ old_dentry, old_dentry->d_inode, old_dentry->d_inode->i_ino, new_dentry, new_dentry->d_inode, new_dentry->d_inode ? new_dentry->d_inode->i_ino : 0)); - /* - * POSIX is braindead (surprise, surprise). It requires that rename() - * should return 0 and do nothing if the target has the same inode as - * the source. Somebody, get a time machine, return to '89 and tell - * RMS & Co *not* to do that idiocy, FAST! - */ - if (old_dentry->d_inode == new_dentry->d_inode) - return 0; old_bh = new_bh = NULL; old_inode = new_inode = NULL; @@ -1597,16 +1589,8 @@ old_inode = old_dentry->d_inode; is_dir = S_ISDIR(old_inode->i_mode); - /* - * Race: we can be hit by another rename after this check. - * For the time being use fat_lock_creation(), but it's - * ugly. FIXME. - */ - - fat_lock_creation(); locked = 1; - if (is_dir) { - /* We can't use d_subdir() here. Arrgh. */ + /* We can't use is_subdir() here. Even now. Arrgh. */ for (walk=new_dentry;walk!=walk->d_parent;walk=walk->d_parent) { if (walk->d_inode != old_dentry->d_inode) continue; @@ -1615,6 +1599,8 @@ } } + fat_lock_creation(); locked = 1; + if (new_dentry->d_inode) { /* * OK, we have to remove the target. We should do it so @@ -1639,8 +1625,6 @@ * be tolerated. */ res = -EBUSY; - if (d_invalidate(new_dentry) < 0) - goto rename_done; /* * OK, let's try to get rid of other dentries. * No need to do it if i_count is 1. @@ -1726,12 +1710,8 @@ fat_brelse(sb, dotdot_bh); } - if (res >= 0) { - if (new_inode && is_dir) - d_rehash(new_dentry); - d_move(old_dentry, new_dentry); + if (res >= 0) res = 0; - } rename_done: if (locked) diff -u --recursive --new-file v2.2.5/linux/include/asm-alpha/io.h linux/include/asm-alpha/io.h --- v2.2.5/linux/include/asm-alpha/io.h Wed Jan 13 15:00:43 1999 +++ linux/include/asm-alpha/io.h Thu Apr 15 05:42:31 1999 @@ -287,7 +287,7 @@ * String version of IO memory access ops: */ extern void _memcpy_fromio(void *, unsigned long, long); -extern void _memcpy_toio(unsigned long, void *, long); +extern void _memcpy_toio(unsigned long, const void *, long); extern void _memset_c_io(unsigned long, unsigned long, long); #define memcpy_fromio(to,from,len) \ diff -u --recursive --new-file v2.2.5/linux/include/asm-alpha/semaphore-helper.h linux/include/asm-alpha/semaphore-helper.h --- v2.2.5/linux/include/asm-alpha/semaphore-helper.h Tue Mar 23 14:35:48 1999 +++ linux/include/asm-alpha/semaphore-helper.h Thu Apr 15 05:42:32 1999 @@ -50,7 +50,7 @@ * 0 go to sleep * -EINTR interrupted * - * We must undo the sem->count down_interruptible increment + * We must undo the sem->count down_interruptible decrement * simultaneously and atomicly with the sem->waking adjustment, * otherwise we can race with wake_one_more. * diff -u --recursive --new-file v2.2.5/linux/include/asm-alpha/semaphore.h linux/include/asm-alpha/semaphore.h --- v2.2.5/linux/include/asm-alpha/semaphore.h Tue Mar 23 14:35:48 1999 +++ linux/include/asm-alpha/semaphore.h Fri Apr 16 08:22:49 1999 @@ -115,42 +115,46 @@ extern inline int down_trylock(struct semaphore * sem) { - long ret, tmp, tmp2; + long ret, tmp, tmp2, sub; /* "Equivalent" C. Note that we have to do this all without (taken) branches in order to be a valid ll/sc sequence. do { tmp = ldq_l; - ret = 0; - tmp -= 1; - if ((int)tmp < 0) // count - break; - if ((long)tmp < 0) // waking - break; - tmp += 0xffffffff00000000; - ret = 1; + sub = 0x0000000100000000; + ret = ((int)tmp <= 0); // count =< 0 ? + if ((int)tmp >= 0) sub = 0; // count >= 0 ? + // note that if count=0 subq overflows to the high + // longword (i.e waking) + ret &= ((long)tmp < 0); // waking < 0 ? + sub += 1; + if (ret) + break; + tmp -= sub; tmp = stq_c = tmp; } while (tmp == 0); */ __asm__ __volatile__( - "1: ldq_l %1,%3\n" - " lda %0,0\n" - " subl %1,1,%2\n" - " subq %1,1,%1\n" - " blt %2,2f\n" - " blt %1,2f\n" - " ldah %1,-32768(%1)\n" - " ldah %1,-32768(%1)\n" - " lda %0,1\n" - " stq_c %1,%3\n" + "1: ldq_l %1,%4\n" + " lda %3,1\n" + " addl %1,0,%2\n" + " sll %3,32,%3\n" + " cmple %2,0,%0\n" + " cmovge %2,0,%3\n" + " cmplt %1,0,%2\n" + " addq %3,1,%3\n" + " and %0,%2,%0\n" + " bne %0,2f\n" + " subq %1,%3,%1\n" + " stq_c %1,%4\n" " beq %1,3f\n" - "2: mb\n" + "2:\n" ".section .text2,\"ax\"\n" "3: br 1b\n" ".previous" - : "=&r"(ret), "=&r"(tmp), "=&r"(tmp2) + : "=&r"(ret), "=&r"(tmp), "=&r"(tmp2), "=&r"(sub) : "m"(*sem) : "memory"); diff -u --recursive --new-file v2.2.5/linux/include/asm-alpha/uaccess.h linux/include/asm-alpha/uaccess.h --- v2.2.5/linux/include/asm-alpha/uaccess.h Wed Jun 24 22:54:10 1998 +++ linux/include/asm-alpha/uaccess.h Thu Apr 15 05:42:31 1999 @@ -358,43 +358,55 @@ * Complex access routines */ -#define __copy_to_user(to,from,n) __copy_tofrom_user_nocheck((to),(from),(n)) -#define __copy_from_user(to,from,n) __copy_tofrom_user_nocheck((to),(from),(n)) - -#define copy_to_user(to,from,n) __copy_tofrom_user((to),(from),(n),__cu_to) -#define copy_from_user(to,from,n) __copy_tofrom_user((to),(from),(n),__cu_from) - extern void __copy_user(void); -#define __copy_tofrom_user_nocheck(to,from,n) \ -({ \ - register void * __cu_to __asm__("$6") = (to); \ - register const void * __cu_from __asm__("$7") = (from); \ - register long __cu_len __asm__("$0") = (n); \ - __asm__ __volatile__( \ - "jsr $28,(%3),__copy_user" \ - : "=r" (__cu_len), "=r" (__cu_from), "=r" (__cu_to) \ - : "r" (__copy_user), "0" (__cu_len), \ - "1" (__cu_from), "2" (__cu_to) \ - : "$1","$2","$3","$4","$5","$28","memory"); \ - __cu_len; \ -}) +extern inline long +__copy_tofrom_user_nocheck(void *to, const void *from, long len) +{ + register void * __cu_to __asm__("$6") = to; + register const void * __cu_from __asm__("$7") = from; + register long __cu_len __asm__("$0") = len; + + __asm__ __volatile__( + "jsr $28,__copy_user" + : "=r" (__cu_len), "=r" (__cu_from), "=r" (__cu_to) + : "0" (__cu_len), "1" (__cu_from), "2" (__cu_to) + : "$1","$2","$3","$4","$5","$27","$28","memory"); + + return __cu_len; +} + +extern inline long +__copy_tofrom_user(void *to, const void *from, long len, const void *validate) +{ + if (__access_ok((long)validate, len, get_fs())) { + register void * __cu_to __asm__("$6") = to; + register const void * __cu_from __asm__("$7") = from; + register long __cu_len __asm__("$0") = len; + __asm__ __volatile__( + "jsr $28,__copy_user" + : "=r" (__cu_len), "=r" (__cu_from), "=r" (__cu_to) + : "0" (__cu_len), "1" (__cu_from), "2" (__cu_to) + : "$1","$2","$3","$4","$5","$27","$28","memory"); + len = __cu_len; + } + return len; +} -#define __copy_tofrom_user(to,from,n,v) \ -({ \ - register void * __cu_to __asm__("$6") = (to); \ - register const void * __cu_from __asm__("$7") = (from); \ - register long __cu_len __asm__("$0") = (n); \ - if (__access_ok(((long)(v)),__cu_len,get_fs())) { \ - __asm__ __volatile__( \ - "jsr $28,(%3),__copy_user" \ - : "=r" (__cu_len), "=r" (__cu_from), "=r" (__cu_to) \ - : "r" (__copy_user), "0" (__cu_len), \ - "1" (__cu_from), "2" (__cu_to) \ - : "$1","$2","$3","$4","$5","$28","memory"); \ - } \ - __cu_len; \ -}) +#define __copy_to_user(to,from,n) __copy_tofrom_user_nocheck((to),(from),(n)) +#define __copy_from_user(to,from,n) __copy_tofrom_user_nocheck((to),(from),(n)) + +extern inline long +copy_to_user(void *to, const void *from, long n) +{ + return __copy_tofrom_user(to, from, n, to); +} + +extern inline long +copy_from_user(void *to, const void *from, long n) +{ + return __copy_tofrom_user(to, from, n, from); +} #define copy_to_user_ret(to,from,n,retval) ({ \ if (copy_to_user(to,from,n)) \ @@ -408,46 +420,48 @@ extern void __do_clear_user(void); -#define __clear_user(to,n) \ -({ \ - register void * __cl_to __asm__("$6") = (to); \ - register long __cl_len __asm__("$0") = (n); \ - __asm__ __volatile__( \ - "jsr $28,(%2),__do_clear_user" \ - : "=r"(__cl_len), "=r"(__cl_to) \ - : "r"(__do_clear_user), "0"(__cl_len), "1"(__cl_to) \ - : "$1","$2","$3","$4","$5","$28","memory"); \ - __cl_len; \ -}) - -#define clear_user(to,n) \ -({ \ - register void * __cl_to __asm__("$6") = (to); \ - register long __cl_len __asm__("$0") = (n); \ - if (__access_ok(((long)__cl_to),__cl_len,get_fs())) { \ - __asm__ __volatile__( \ - "jsr $28,(%2),__do_clear_user" \ - : "=r"(__cl_len), "=r"(__cl_to) \ - : "r"(__do_clear_user), "0"(__cl_len), "1"(__cl_to)\ - : "$1","$2","$3","$4","$5","$28","memory"); \ - } \ - __cl_len; \ -}) +extern inline long +__clear_user(void *to, long len) +{ + register void * __cl_to __asm__("$6") = to; + register long __cl_len __asm__("$0") = len; + __asm__ __volatile__( + "jsr $28,__do_clear_user" + : "=r"(__cl_len), "=r"(__cl_to) + : "0"(__cl_len), "1"(__cl_to) + : "$1","$2","$3","$4","$5","$27","$28","memory"); + return __cl_len; +} + +extern inline long +clear_user(void *to, long len) +{ + if (__access_ok((long)to, len, get_fs())) { + register void * __cl_to __asm__("$6") = to; + register long __cl_len __asm__("$0") = len; + __asm__ __volatile__( + "jsr $28,__do_clear_user" + : "=r"(__cl_len), "=r"(__cl_to) + : "0"(__cl_len), "1"(__cl_to) + : "$1","$2","$3","$4","$5","$27","$28","memory"); + len = __cl_len; + } + return len; +} /* Returns: -EFAULT if exception before terminator, N if the entire buffer filled, else strlen. */ extern long __strncpy_from_user(char *__to, const char *__from, long __to_len); -#define strncpy_from_user(to,from,n) \ -({ \ - char * __sfu_to = (to); \ - const char * __sfu_from = (from); \ - long __sfu_ret = -EFAULT; \ - if (__access_ok(((long)__sfu_from),0,get_fs())) \ - __sfu_ret = __strncpy_from_user(__sfu_to,__sfu_from,(n)); \ - __sfu_ret; \ -}) +extern inline long +strncpy_from_user(char *to, const char *from, long n) +{ + long ret = -EFAULT; + if (__access_ok((long)from, 0, get_fs())) + ret = __strncpy_from_user(to, from, n); + return ret; +} /* Returns: 0 if bad, string length+1 (memory size) of string if ok */ extern long __strlen_user(const char *); diff -u --recursive --new-file v2.2.5/linux/include/asm-i386/pgtable.h linux/include/asm-i386/pgtable.h --- v2.2.5/linux/include/asm-i386/pgtable.h Tue Mar 23 14:35:48 1999 +++ linux/include/asm-i386/pgtable.h Fri Apr 16 14:28:08 1999 @@ -220,7 +220,7 @@ #define _PAGE_PRESENT 0x001 #define _PAGE_RW 0x002 #define _PAGE_USER 0x004 -#define _PAGE_WT 0x008 +#define _PAGE_PWT 0x008 #define _PAGE_PCD 0x010 #define _PAGE_ACCESSED 0x020 #define _PAGE_DIRTY 0x040 diff -u --recursive --new-file v2.2.5/linux/include/linux/cyclades.h linux/include/linux/cyclades.h --- v2.2.5/linux/include/linux/cyclades.h Thu Dec 31 10:29:02 1998 +++ linux/include/linux/cyclades.h Mon Apr 12 10:09:47 1999 @@ -316,6 +316,7 @@ #define C_IN_OVR_ERROR 0x00008000 /* overrun error */ #define C_IN_RXOFL 0x00010000 /* RX buffer overflow */ #define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */ +#define C_IN_MRTS 0x00040000 /* modem RTS drop */ /* flow control */ @@ -332,12 +333,14 @@ /* rs_control/rs_status RS-232 signals */ +#define C_RS_PARAM 0x80000000 /* Indicates presence of parameter in + IOCTLM command */ +#define C_RS_RTS 0x00000001 /* RTS */ +#define C_RS_DTR 0x00000004 /* DTR */ #define C_RS_DCD 0x00000100 /* CD */ #define C_RS_DSR 0x00000200 /* DSR */ #define C_RS_RI 0x00000400 /* RI */ #define C_RS_CTS 0x00000800 /* CTS */ -#define C_RS_RTS 0x00000001 /* RTS */ -#define C_RS_DTR 0x00000004 /* DTR */ /* commands Host <-> Board */ @@ -353,13 +356,18 @@ #define C_CM_SET_BREAK 0x43 /* Tx break on */ #define C_CM_CLR_BREAK 0x44 /* Tx break off */ #define C_CM_CMD_DONE 0x45 /* Previous command done */ +#define C_CM_INTBACK2 0x46 /* Alternate Interrupt back */ #define C_CM_TINACT 0x51 /* set inactivity detection */ #define C_CM_IRQ_ENBL 0x52 /* enable generation of interrupts */ #define C_CM_IRQ_DSBL 0x53 /* disable generation of interrupts */ -#define C_CM_ACK_ENBL 0x54 /* enable acknolowdged interrupt mode */ -#define C_CM_ACK_DSBL 0x55 /* disable acknolowdged intr mode */ +#define C_CM_ACK_ENBL 0x54 /* enable acknowledged interrupt mode */ +#define C_CM_ACK_DSBL 0x55 /* disable acknowledged intr mode */ #define C_CM_FLUSH_RX 0x56 /* flushes Rx buffer */ #define C_CM_FLUSH_TX 0x57 /* flushes Tx buffer */ +#define C_CM_Q_ENABLE 0x58 /* enables queue access from the + driver */ +#define C_CM_Q_DISABLE 0x59 /* disables queue access from the + driver */ #define C_CM_TXBEMPTY 0x60 /* Tx buffer is empty */ #define C_CM_TXLOWWM 0x61 /* Tx buffer low water mark */ @@ -369,6 +377,7 @@ #define C_CM_MDSR 0x71 /* modem DSR change */ #define C_CM_MRI 0x72 /* modem RI change */ #define C_CM_MCTS 0x73 /* modem CTS change */ +#define C_CM_MRTS 0x74 /* modem RTS drop */ #define C_CM_RXBRK 0x84 /* Break received */ #define C_CM_PR_ERROR 0x85 /* Parity error */ #define C_CM_FR_ERROR 0x86 /* Frame error */ @@ -449,9 +458,22 @@ /* FW to Host commands */ uclong fwcmd_channel; /* channel number */ uclong fwcmd_param; /* pointer to parameters */ + uclong zf_int_queue_addr; /* offset for INT_QUEUE structure */ /* filler so the structures are aligned */ - uclong filler[7]; + uclong filler[6]; +}; + +/* Host Interrupt Queue */ + +#define QUEUE_SIZE (10*MAX_CHAN) + +struct INT_QUEUE { + unsigned char intr_code[QUEUE_SIZE]; + unsigned long channel[QUEUE_SIZE]; + unsigned long param[QUEUE_SIZE]; + unsigned long put; + unsigned long get; }; /* @@ -585,6 +607,8 @@ #define CyPCI_Zctl CTRL_WINDOW_SIZE #define CyPCI_Zwin 0x80000 #define CyPCI_Ze_win (2 * CyPCI_Zwin) + +#define PCI_DEVICE_ID_MASK 0x06 /**** CD1400 registers ****/ diff -u --recursive --new-file v2.2.5/linux/include/linux/ext2_fs_sb.h linux/include/linux/ext2_fs_sb.h --- v2.2.5/linux/include/linux/ext2_fs_sb.h Fri Jul 31 17:05:52 1998 +++ linux/include/linux/ext2_fs_sb.h Mon Apr 12 10:03:45 1999 @@ -49,8 +49,6 @@ struct buffer_head * s_inode_bitmap[EXT2_MAX_GROUP_LOADED]; unsigned long s_block_bitmap_number[EXT2_MAX_GROUP_LOADED]; struct buffer_head * s_block_bitmap[EXT2_MAX_GROUP_LOADED]; - int s_rename_lock; - struct wait_queue * s_rename_wait; unsigned long s_mount_opt; unsigned short s_resuid; unsigned short s_resgid; diff -u --recursive --new-file v2.2.5/linux/include/linux/fs.h linux/include/linux/fs.h --- v2.2.5/linux/include/linux/fs.h Tue Mar 23 14:35:48 1999 +++ linux/include/linux/fs.h Fri Apr 16 14:28:08 1999 @@ -96,6 +96,10 @@ #define MS_NOATIME 1024 /* Do not update access times. */ #define MS_NODIRATIME 2048 /* Do not update directory access times */ +#define MS_ODD_RENAME 32768 /* Temporary stuff; will go away as soon + * as nfs_rename() will be cleaned up + */ + /* * Flags that can be altered by MS_REMOUNT */ @@ -560,6 +564,11 @@ struct qnx4_sb_info qnx4_sb; void *generic_sbp; } u; + /* + * The next field is for VFS *only*. No filesystems have any business + * even looking at it. You had been warned. + */ + struct semaphore s_vfs_rename_sem; /* Kludge */ }; /* diff -u --recursive --new-file v2.2.5/linux/include/linux/mca.h linux/include/linux/mca.h --- v2.2.5/linux/include/linux/mca.h Fri Oct 23 22:01:26 1998 +++ linux/include/linux/mca.h Thu Apr 15 05:42:40 1999 @@ -39,27 +39,27 @@ specify a starting slot beyond zero, to deal with detecting multiple devices. Returns MCA_NOTFOUND if id not found. Also checks the integrated adapters. */ -extern int mca_find_adapter( int id, int start ); -extern int mca_find_unused_adapter( int id, int start ); +extern int mca_find_adapter(int id, int start); +extern int mca_find_unused_adapter(int id, int start); /* adapter state info - returns 0 if no */ -extern int mca_isadapter( int slot ); -extern int mca_isenabled( int slot ); +extern int mca_isadapter(int slot); +extern int mca_isenabled(int slot); -extern int mca_is_adapter_used( int slot ); -extern int mca_mark_as_used( int slot ); -extern void mca_mark_as_unused( int slot ); +extern int mca_is_adapter_used(int slot); +extern int mca_mark_as_used(int slot); +extern void mca_mark_as_unused(int slot); /* gets a byte out of POS register (stored in memory) */ -extern unsigned char mca_read_stored_pos( int slot, int reg ); +extern unsigned char mca_read_stored_pos(int slot, int reg); /* This can be expanded later. Right now, it gives us a way of getting meaningful information into the MCA_info structure, so we can have a more interesting /proc/mca. */ -extern void mca_set_adapter_name( int slot, char* name ); -extern char* mca_get_adapter_name( int slot ); +extern void mca_set_adapter_name(int slot, char* name); +extern char* mca_get_adapter_name(int slot); /* This sets up an information callback for /proc/mca/slot?. The @@ -73,8 +73,8 @@ unregisters, thus preventing kernel crashes and other such nastiness. */ -typedef int (*MCA_ProcFn)( char* buf, int slot, void* dev ); -extern void mca_set_adapter_procfn( int slot, MCA_ProcFn, void* dev ); +typedef int (*MCA_ProcFn)(char* buf, int slot, void* dev); +extern void mca_set_adapter_procfn(int slot, MCA_ProcFn, void* dev); /* These routines actually mess with the hardware POS registers. They temporarily disable the device (and interrupts), so make sure you know @@ -88,13 +88,13 @@ */ /* read a byte from the specified POS register. */ -extern unsigned char mca_read_pos( int slot, int reg ); +extern unsigned char mca_read_pos(int slot, int reg); /* write a byte to the specified POS register. */ -extern void mca_write_pos( int slot, int reg, unsigned char byte ); +extern void mca_write_pos(int slot, int reg, unsigned char byte); /* Should only be called by the NMI interrupt handler, this will do some fancy stuff to figure out what might have generated a NMI. */ -extern void mca_handle_nmi( void ); +extern void mca_handle_nmi(void); #endif /* _LINUX_MCA_H */ diff -u --recursive --new-file v2.2.5/linux/include/linux/pagemap.h linux/include/linux/pagemap.h --- v2.2.5/linux/include/linux/pagemap.h Wed Jan 20 23:14:06 1999 +++ linux/include/linux/pagemap.h Fri Apr 16 14:28:20 1999 @@ -17,7 +17,7 @@ return PAGE_OFFSET + PAGE_SIZE * (page - mem_map); } -#define PAGE_HASH_BITS 11 +#define PAGE_HASH_BITS 12 #define PAGE_HASH_SIZE (1 << PAGE_HASH_BITS) #define PAGE_AGE_VALUE 16 diff -u --recursive --new-file v2.2.5/linux/include/linux/pci.h linux/include/linux/pci.h --- v2.2.5/linux/include/linux/pci.h Tue Mar 23 14:35:48 1999 +++ linux/include/linux/pci.h Fri Apr 16 14:28:08 1999 @@ -901,6 +901,10 @@ #define PCI_VENDOR_ID_CYCLADES 0x120e #define PCI_DEVICE_ID_CYCLOM_Y_Lo 0x0100 #define PCI_DEVICE_ID_CYCLOM_Y_Hi 0x0101 +#define PCI_DEVICE_ID_CYCLOM_4Y_Lo 0x0102 +#define PCI_DEVICE_ID_CYCLOM_4Y_Hi 0x0103 +#define PCI_DEVICE_ID_CYCLOM_8Y_Lo 0x0104 +#define PCI_DEVICE_ID_CYCLOM_8Y_Hi 0x0105 #define PCI_DEVICE_ID_CYCLOM_Z_Lo 0x0200 #define PCI_DEVICE_ID_CYCLOM_Z_Hi 0x0201 diff -u --recursive --new-file v2.2.5/linux/include/linux/proc_fs.h linux/include/linux/proc_fs.h --- v2.2.5/linux/include/linux/proc_fs.h Tue Mar 23 14:35:48 1999 +++ linux/include/linux/proc_fs.h Fri Apr 16 14:28:30 1999 @@ -174,6 +174,7 @@ PROC_SCSI_SEAGATE, PROC_SCSI_T128, PROC_SCSI_NCR53C7xx, + PROC_SCSI_SYM53C8XX, PROC_SCSI_NCR53C8XX, PROC_SCSI_ULTRASTOR, PROC_SCSI_7000FASST, diff -u --recursive --new-file v2.2.5/linux/include/linux/socket.h linux/include/linux/socket.h --- v2.2.5/linux/include/linux/socket.h Tue Dec 22 14:16:58 1998 +++ linux/include/linux/socket.h Thu Apr 15 05:42:43 1999 @@ -246,6 +246,7 @@ #define SOL_PACKET 263 #define SOL_ATM 264 /* ATM layer (cell level) */ #define SOL_AAL 265 /* ATM Adaption Layer (packet level) */ +#define SOL_IRDA 266 /* IPX options */ #define IPX_TYPE 1 diff -u --recursive --new-file v2.2.5/linux/include/linux/ufs_fs.h linux/include/linux/ufs_fs.h --- v2.2.5/linux/include/linux/ufs_fs.h Fri Jan 8 22:36:24 1999 +++ linux/include/linux/ufs_fs.h Mon Apr 12 10:03:45 1999 @@ -93,6 +93,7 @@ #define UFS_ST_OLD 0x00000000 #define UFS_ST_44BSD 0x00000100 #define UFS_ST_SUN 0x00000200 +#define UFS_ST_SUNx86 0x00000400 /*cylinder group encoding */ #define UFS_CG_MASK 0x00003000 /* mask for the following */ #define UFS_CG_OLD 0x00000000 @@ -110,12 +111,13 @@ #define UFS_MOUNT_ONERROR_UMOUNT 0x00000004 #define UFS_MOUNT_ONERROR_REPAIR 0x00000008 -#define UFS_MOUNT_UFSTYPE 0x000001F0 +#define UFS_MOUNT_UFSTYPE 0x000003F0 #define UFS_MOUNT_UFSTYPE_OLD 0x00000010 #define UFS_MOUNT_UFSTYPE_44BSD 0x00000020 #define UFS_MOUNT_UFSTYPE_SUN 0x00000040 -#define UFS_MOUNT_UFSTYPE_NEXT 0x00000080 +#define UFS_MOUNT_UFSTYPE_NEXTSTEP 0x00000080 #define UFS_MOUNT_UFSTYPE_OPENSTEP 0x00000100 +#define UFS_MOUNT_UFSTYPE_SUNx86 0x00000200 #define ufs_clear_opt(o,opt) o &= ~UFS_MOUNT_##opt #define ufs_set_opt(o,opt) o |= UFS_MOUNT_##opt @@ -203,7 +205,7 @@ #define UFS_MAXNAMLEN 255 #define UFS_MAXMNTLEN 512 #define UFS_MAXCSBUFS 31 -#define UFS_LINK_MAX EXT2_LINK_MAX +#define UFS_LINK_MAX 32000 /* * UFS_DIR_PAD defines the directory entries boundaries @@ -294,7 +296,14 @@ /* yet another configuration parameter */ __u32 fs_optim; /* optimization preference, see below */ /* these fields are derived from the hardware */ - __u32 fs_npsect; /* # sectors/track including spares */ + union { + struct { + __u32 fs_npsect; /* # sectors/track including spares */ + } fs_sun; + struct { + __s32 fs_state; /* file system state time stamp */ + } fs_sunx86; + } fs_u1; __u32 fs_interleave; /* hardware sector interleave */ __u32 fs_trackskew; /* sector 0 skew, per track */ /* a unique id for this filesystem (currently unused and unmaintained) */ @@ -319,11 +328,11 @@ /* this data must be re-computed after crashes */ struct ufs_csum fs_cstotal; /* cylinder summary information */ /* these fields are cleared at mount time */ - __u8 fs_fmod; /* super block modified flag */ - __u8 fs_clean; /* file system is clean flag */ - __u8 fs_ronly; /* mounted read-only flag */ - __u8 fs_flags; /* currently unused flag */ - __u8 fs_fsmnt[UFS_MAXMNTLEN]; /* name mounted on */ + __s8 fs_fmod; /* super block modified flag */ + __s8 fs_clean; /* file system is clean flag */ + __s8 fs_ronly; /* mounted read-only flag */ + __s8 fs_flags; /* currently unused flag */ + __s8 fs_fsmnt[UFS_MAXMNTLEN]; /* name mounted on */ /* these fields retain the current block allocation info */ __u32 fs_cgrotor; /* last cg searched */ __u32 fs_csp[UFS_MAXCSBUFS]; /* list of fs_cs info buffers */ @@ -340,6 +349,14 @@ __u32 fs_qfmask[2]; /* ~usb_fmask */ } fs_sun; struct { + __s32 fs_sparecon[53];/* reserved for future constants */ + __s32 fs_reclaim; + __s32 fs_sparecon2[1]; + __u32 fs_npsect; /* # sectors/track including spares */ + __u32 fs_qbmask[2]; /* ~usb_bmask */ + __u32 fs_qfmask[2]; /* ~usb_fmask */ + } fs_sunx86; + struct { __s32 fs_sparecon[50];/* reserved for future constants */ __s32 fs_contigsumsize;/* size of cluster summary array */ __s32 fs_maxsymlinklen;/* max length of an internal symlink */ @@ -349,7 +366,7 @@ __u32 fs_qfmask[2]; /* ~usb_fmask */ __s32 fs_state; /* file system state time stamp */ } fs_44; - } fs_u; + } fs_u2; __s32 fs_postblformat; /* format of positional layout tables */ __s32 fs_nrpos; /* number of rotational positions */ __s32 fs_postbloff; /* (__s16) rotation block list head */ diff -u --recursive --new-file v2.2.5/linux/include/linux/ufs_fs_sb.h linux/include/linux/ufs_fs_sb.h --- v2.2.5/linux/include/linux/ufs_fs_sb.h Fri Oct 23 22:01:27 1998 +++ linux/include/linux/ufs_fs_sb.h Mon Apr 12 10:03:45 1999 @@ -116,8 +116,6 @@ struct ufs_sb_info { struct ufs_sb_private_info * s_uspi; struct ufs_csum * s_csp[UFS_MAXCSBUFS]; - int s_rename_lock; - struct wait_queue * s_rename_wait; unsigned s_swab; unsigned s_flags; struct buffer_head ** s_ucg; @@ -167,7 +165,14 @@ __u32 fs_inopb; __u32 fs_nspf; __u32 fs_optim; - __u32 fs_npsect; + union { + struct { + __u32 fs_npsect; + } fs_sun; + struct { + __s32 fs_state; + } fs_sunx86; + } fs_u1; __u32 fs_interleave; __u32 fs_trackskew; __u32 fs_id[2]; @@ -182,16 +187,16 @@ __u32 fs_ipg; __u32 fs_fpg; struct ufs_csum fs_cstotal; - __u8 fs_fmod; - __u8 fs_clean; - __u8 fs_ronly; - __u8 fs_flags; - __u8 fs_fsmnt[UFS_MAXMNTLEN - 212]; + __s8 fs_fmod; + __s8 fs_clean; + __s8 fs_ronly; + __s8 fs_flags; + __s8 fs_fsmnt[UFS_MAXMNTLEN - 212]; }; struct ufs_super_block_second { - __u8 fs_fsmnt[212]; + __s8 fs_fsmnt[212]; __u32 fs_cgrotor; __u32 fs_csp[UFS_MAXCSBUFS]; __u32 fs_maxcluster; @@ -211,6 +216,14 @@ __u32 fs_qfmask[2]; /* ~usb_fmask */ } fs_sun; struct { + __s32 fs_sparecon[53];/* reserved for future constants */ + __s32 fs_reclaim; + __s32 fs_sparecon2[1]; + __u32 fs_npsect; /* # sectors/track including spares */ + __u32 fs_qbmask[2]; /* ~usb_bmask */ + __u32 fs_qfmask[2]; /* ~usb_fmask */ + } fs_sunx86; + struct { __s32 fs_sparecon[50];/* reserved for future constants */ __s32 fs_contigsumsize;/* size of cluster summary array */ __s32 fs_maxsymlinklen;/* max length of an internal symlink */ @@ -220,7 +233,7 @@ __u32 fs_qfmask[2]; /* ~usb_fmask */ __s32 fs_state; /* file system state time stamp */ } fs_44; - } fs_u; + } fs_u2; __s32 fs_postblformat; __s32 fs_nrpos; __s32 fs_postbloff; diff -u --recursive --new-file v2.2.5/linux/include/linux/umsdos_fs.p linux/include/linux/umsdos_fs.p --- v2.2.5/linux/include/linux/umsdos_fs.p Wed Dec 16 10:32:56 1998 +++ linux/include/linux/umsdos_fs.p Mon Apr 12 10:03:45 1999 @@ -12,6 +12,7 @@ int umsdos_lookup_x ( struct inode *dir, struct dentry *dentry, int nopseudo); int UMSDOS_lookup(struct inode *, struct dentry *); struct dentry *umsdos_lookup_dentry(struct dentry *, char *, int, int); +struct dentry *umsdos_covered(struct dentry *, char *, int); struct dentry *umsdos_solve_hlink (struct dentry *hlink); diff -u --recursive --new-file v2.2.5/linux/include/net/irda/discovery.h linux/include/net/irda/discovery.h --- v2.2.5/linux/include/net/irda/discovery.h Wed Dec 31 16:00:00 1969 +++ linux/include/net/irda/discovery.h Thu Apr 15 05:42:41 1999 @@ -0,0 +1,65 @@ +/********************************************************************* + * + * Filename: discovery.h + * Version: + * Description: + * Status: Experimental. + * Author: Dag Brattli + * Created at: Tue Apr 6 16:53:53 1999 + * Modified at: Tue Apr 6 20:44:35 1999 + * Modified by: Dag Brattli + * + * Copyright (c) 1999 Dag Brattli, 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. + * + * 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 DISCOVERY_H +#define DISCOVERY_H + +#include + +#include +#include + +#define DISCOVERY_EXPIRE_TIMEOUT 6*HZ + +/* + * The DISCOVERY structure is used for both discovery requests and responses + */ +typedef struct { + QUEUE queue; /* Must be first! */ + + __u32 saddr; /* Which link the device was discovered */ + __u32 daddr; /* Remote device address */ + LAP_REASON condition; /* More info about the discovery */ + + __u16_host_order hints; /* Discovery hint bits */ + __u8 charset; + char info[32]; /* Usually the name of the device */ + __u8 info_len; /* Length of device info field */ + + int gen_addr_bit; /* Need to generate a new device address? */ + int nslots; /* Number of slots to use when discovering */ + int timestamp; /* Time discovered */ +} discovery_t; + +void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *discovery); +void irlmp_add_discovery_log(hashbin_t *cachelog, hashbin_t *log); +void irlmp_expire_discoveries(hashbin_t *log, int saddr, int force); + +#endif diff -u --recursive --new-file v2.2.5/linux/include/net/irda/ircomm_common.h linux/include/net/irda/ircomm_common.h --- v2.2.5/linux/include/net/irda/ircomm_common.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/ircomm_common.h Thu Apr 15 05:42:41 1999 @@ -19,6 +19,9 @@ * ********************************************************************/ +#ifndef IRCOMM_H +#define IRCOMM_H + /* #define DEBUG(n, args...) printk( KERN_DEBUG args) */ /* enable all debug message */ #include @@ -52,16 +55,23 @@ IRCOMM_CONTROL_REQUEST, } IRCOMM_EVENT; +typedef enum { + TX_READY, + TX_BUSY, + + IAS_PARAM, + CONTROL_CHANNEL, +} IRCOMM_CMD; + + #define IRCOMM_MAGIC 0x434f4d4d #define COMM_INIT_CTRL_PARAM 3 /* length of initial control parameters */ -#define COMM_CTRL_MIN 1 /* length of clen field */ -#define COMM_HEADER_SIZE (LAP_HEADER+LMP_HEADER+TTP_HEADER+COMM_CTRL_MIN) +#define COMM_HEADER 1 /* length of clen field */ +#define COMM_HEADER_SIZE (LAP_HEADER+LMP_HEADER+TTP_HEADER+COMM_HEADER) #define COMM_DEFAULT_DATA_SIZE 64 -#define IRCOMM_MAX_CONNECTION 1 /* Don't change */ +#define IRCOMM_MAX_CONNECTION 1 /* Don't change for now */ -#define IAS_PARAM 1 -#define CONTROL_CHANNEL 2 @@ -78,7 +88,7 @@ #define SERVICETYPE 0x00 -#define PORT_TYPE 0x02 +#define PORT_TYPE 0x01 #define PORT_NAME 0x02 #define FIXED_PORT_NAME 0x82 @@ -101,10 +111,6 @@ #define IEEE1284_MODE 0x34 #define IEEE1284_ECP_EPP_DATA_TRANSFER 0x35 -#define TX_READY 0xFE /* FIXME: this is not defined in IrCOMM spec */ -#define TX_BUSY 0XFF /* so we should find another way */ - - /* parameters of FLOW_CONTROL */ #define USE_RTS 0x08 /* use RTS on output */ @@ -131,6 +137,20 @@ /* parameters of DATA_FORMAT */ +#define IRCOMM_WLEN5 0x00 /* word length is 5bit */ +#define IRCOMM_WLEN6 0x01 /* word length is 6bit */ +#define IRCOMM_WLEN7 0x02 /* word length is 7bit */ +#define IRCOMM_WLEN8 0x03 /* word length is 8bit */ + +#define IRCOMM_STOP2 0x04 /* 2 stop bits mode */ +#define IRCOMM_PARENB 0x08 /* parity enable */ +#define IRCOMM_PARODD 0x00 /* odd parity */ +#define IRCOMM_PAREVEN 0x10 /* even parity */ +#define IRCOMM_PARMARK 0x20 +#define IRCOMM_PARSPC 0x30 + +/* parameters of LINE_STATUS */ + #define LSR_OE 0x02 /* Overrun error indicator */ #define LSR_PE 0x04 /* Parity error indicator */ #define LSR_FE 0x08 /* Frame error indicator */ @@ -146,31 +166,46 @@ int in_use; int null_modem_mode; /* switch for null modem emulation */ int ttp_stop; + int max_txbuff_size; - int maxsdusize; + __u32 maxsdusize; + __u32 daddr; /* Device address of the peer device */ __u32 saddr; - - void (*d_handler)(struct ircomm_cb *self); + int ias_type; + int disconnect_priority; /* P_NORMAL or P_HIGH. see irttp.h */ struct notify_t notify; /* container of callbacks */ + void (*d_handler)(struct ircomm_cb *self); + int control_ch_pending; struct sk_buff *ctrl_skb; /* queue of control channel */ + __u8 dlsap; /* IrLMP dlsap */ + __u8 lsap; /* sap of local device */ struct tsap_cb *tsap; /* IrTTP/LMP handle */ struct qos_info *qos; /* Quality of Service */ - int reason; /* I don't know about reason: see Irlmp.c or somewhere :p)*/ + int peer_cap; /* capability of peer device */ + + struct wait_queue *discovery_wait; + struct wait_queue *ias_wait; + + /* statistics */ + int tx_packets; + int rx_packets; + int tx_controls; + int pending_control_tuples; + int ignored_control_tuples; + - __u8 dlsap; /* IrLMP dlsap */ - __u8 lsap; /* sap of local device */ __u8 pi ; /* instruction of control channel*/ + __u8 port_type; __u8 peer_port_type; __u8 servicetype; - __u8 peer_servicetype; __u8 data_format; __u8 peer_data_format; __u8 flow_ctrl; @@ -200,35 +235,26 @@ __u32 data_rate; __u32 peer_data_rate; - char port_name[60]; - + char port_name[33]; + int port_name_critical; }; -void ircomm_connect_request(struct ircomm_cb *self, int maxsdusize); +int ircomm_query_ias_and_connect(struct ircomm_cb *self, __u8 servicetype); +void ircomm_connect_request(struct ircomm_cb *self); void ircomm_connect_response(struct ircomm_cb *self, struct sk_buff *userdata, - int maxsdusize); + __u32 maxsdusize); void ircomm_disconnect_request(struct ircomm_cb *self, - struct sk_buff *userdata); -void ircomm_data_request(struct ircomm_cb *self, - struct sk_buff *userdata); -void ircomm_control_request(struct ircomm_cb *self); -void ircomm_append_ctrl(struct ircomm_cb *self, __u8 instruction); -struct ircomm_cb *ircomm_attach_cable( __u8 servicetype, struct notify_t notify, - void *handler); -int ircomm_detach_cable(struct ircomm_cb *self); - - -void ircomm_accept_data_indication(void *instance, void *sap, struct sk_buff *skb); -void ircomm_accept_connect_confirm(void *instance, void *sap, struct qos_info *qos, - int maxsdusize, struct sk_buff *skb); -void ircomm_accept_connect_indication(void *instance, void *sap, - struct qos_info *qos, - int maxsdusize, struct sk_buff *skb); -void ircomm_accept_disconnect_indication(void *instance, void *sap, LM_REASON reason, - struct sk_buff *skb); -void ircomm_accept_flow_indication(void *instance, void *sap, LOCAL_FLOW flow); -void ircomm_next_state( struct ircomm_cb *self, IRCOMM_STATE state); + struct sk_buff *userdata, int priority); +int ircomm_data_request(struct ircomm_cb *self, + struct sk_buff *userdata); +void ircomm_control_request(struct ircomm_cb *self, __u8 instruction); + +void ircomm_parse_tuples(struct ircomm_cb *self, struct sk_buff *skb, int type); + +struct ircomm_cb *ircomm_open_instance(struct notify_t notify); +int ircomm_close_instance(struct ircomm_cb *self); +#endif diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irda.h linux/include/net/irda/irda.h --- v2.2.5/linux/include/net/irda/irda.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irda.h Fri Apr 16 14:29:06 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Tue Dec 9 21:13:12 1997 - * Modified at: Wed Jan 27 14:15:50 1999 + * Modified at: Tue Apr 6 20:31:08 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. @@ -22,11 +22,15 @@ * ********************************************************************/ -#ifndef IRDA_H -#define IRDA_H +#ifndef NET_IRDA_H +#define NET_IRDA_H #include #include +#include + +#include +#include #ifndef TRUE #define TRUE 1 @@ -57,47 +61,6 @@ #define ASSERT(expr, func) #endif /* CONFIG_IRDA_DEBUG */ -#ifdef CHECK_SKB -static unsigned int check_skb = CHECK_SKB; - -#define SK_FREED_SKB 0x0DE2C0DE -#define SK_GOOD_SKB 0xDEC0DED1 -#define SK_HEAD_SKB 0x12231298 - -extern int skb_check(struct sk_buff *skb,int,int, char *); - -#ifdef IS_SKB -#undef IS_SKB -#endif - -#define IS_SKB(skb, func) \ -if( skb_check((skb), 0, __LINE__,__FILE__) == -1) { \ - ##func} - -#ifdef IS_SKB_HEAD -#undef IS_SKB_HEAD -#endif - -#define IS_SKB_HEAD(skb) skb_check((skb), 1, __LINE__,__FILE__) - -#define ALLOC_SKB_MAGIC(skb) \ -if( check_skb) \ - skb->magic_debug_cookie = SK_GOOD_SKB; - -#define FREE_SKB_MAGIC(skb) \ -if( check_skb) {\ - skb->magic_debug_cookie = SK_FREED_SKB; \ -} - -#else -#undef IS_SKB -#define IS_SKB(skb, func) -#undef IS_SKB_HEAD -#define IS_SKB_HEAD(skb) -#define ALLOC_SKB_MAGIC(skb) -#define FREE_SKB_MAGIC(skb) -#endif /* CHECK_SKB */ - /* * Magic numbers used by Linux/IR. Random numbers which must be unique to * give the best protection @@ -117,39 +80,153 @@ #define IAS_OBJECT_MAGIC 0x34234 #define IAS_ATTRIB_MAGIC 0x45232 -#define IAS_DEVICE_ID 0x5342 +#define IAS_DEVICE_ID 0x5342 #define IAS_PNP_ID 0xd342 #define IAS_OBEX_ID 0x34323 #define IAS_IRLAN_ID 0x34234 #define IAS_IRCOMM_ID 0x2343 #define IAS_IRLPT_ID 0x9876 -#endif /* IRDA_H */ - - - - - - - - - - - - - - - - - - - - - - +typedef enum { FLOW_STOP, FLOW_START } LOCAL_FLOW; +/* IrDA Socket */ +struct tsap_cb; +struct irda_sock { + __u32 saddr; /* my local address */ + __u32 daddr; /* peer address */ + + struct ias_object *ias_obj; + struct tsap_cb *tsap; /* TSAP used by this connection */ + __u8 dtsap_sel; /* remote TSAP address */ + __u8 stsap_sel; /* local TSAP address */ + + __u32 max_sdu_size_rx; + __u32 max_sdu_size_tx; + struct qos_info qos_tx; + + __u16 mask; /* Hint bits mask */ + __u16 hints; /* Hint bits */ + + __u32 ckey; /* IrLMP client handle */ + __u32 skey; /* IrLMP service handle */ + + int nslots; /* Number of slots to use for discovery */ + + struct sock *sk; + struct wait_queue *ias_wait; /* Wait for LM-IAS answer */ + + LOCAL_FLOW tx_flow; + LOCAL_FLOW rx_flow; +}; +/* + * This type is used by the protocols that transmit 16 bits words in + * little endian format. A little endian machine stores MSB of word in + * byte[1] and LSB in byte[0]. A big endian machine stores MSB in byte[0] + * and LSB in byte[1]. + */ +typedef union { + __u16 word; + __u8 byte[2]; +} __u16_host_order; +/* + * Information monitored by some layers + */ +struct irda_statistics +{ + int rx_packets; /* total packets received */ + int tx_packets; /* total packets transmitted */ + int rx_errors; /* bad packets received */ + int tx_errors; /* packet transmit problems */ + int rx_dropped; /* no space in linux buffers */ + int tx_dropped; /* no space available in linux */ + int rx_compressed; + int tx_compressed; + int rx_bytes; /* total bytes received */ + int tx_bytes; /* total bytes transmitted */ + + int multicast; /* multicast packets received */ + int collisions; + + /* detailed rx_errors: */ + int rx_length_errors; + int rx_over_errors; /* receiver ring buff overflow */ + int rx_crc_errors; /* recved pkt with crc error */ + int rx_frame_errors; /* recv'd frame alignment error */ + int rx_fifo_errors; /* recv'r fifo overrun */ + int rx_missed_errors; /* receiver missed packet */ + + /* detailed tx_errors */ + int tx_aborted_errors; + int tx_carrier_errors; + int tx_fifo_errors; + int tx_heartbeat_errors; + int tx_window_errors; +}; + +/* Misc status information */ +typedef enum { + STATUS_OK, + STATUS_ABORTED, + STATUS_NO_ACTIVITY, + STATUS_NOISY, + STATUS_REMOTE, +} LINK_STATUS; + +typedef enum { + LOCK_NO_CHANGE, + LOCK_LOCKED, + LOCK_UNLOCKED, +} LOCK_STATUS; + +typedef enum { /* FIXME check the two first reason codes */ + LAP_DISC_INDICATION=1, /* Received a disconnect request from peer */ + LAP_NO_RESPONSE, /* To many retransmits without response */ + LAP_RESET_INDICATION, /* To many retransmits, or invalid nr/ns */ + LAP_FOUND_NONE, /* No devices were discovered */ + LAP_MEDIA_BUSY, + LAP_PRIMARY_CONFLICT, +} LAP_REASON; + +/* + * IrLMP disconnect reasons. The order is very important, since they + * correspond to disconnect reasons sent in IrLMP disconnect frames, so + * please do not touch :-) + */ +typedef enum { + LM_USER_REQUEST = 1, /* User request */ + LM_LAP_DISCONNECT, /* Unexpected IrLAP disconnect */ + LM_CONNECT_FAILURE, /* Failed to establish IrLAP connection */ + LM_LAP_RESET, /* IrLAP reset */ + LM_INIT_DISCONNECT, /* Link Management initiated disconnect */ + LM_LSAP_NOTCONN, /* Data delivered on unconnected LSAP */ + LM_NON_RESP_CLIENT, /* Non responsive LM-MUX client */ + LM_NO_AVAIL_CLIENT, /* No available LM-MUX client */ + LM_CONN_HALF_OPEN, /* Connection is half open */ + LM_BAD_SOURCE_ADDR, /* Illegal source address (i.e 0x00) */ +} LM_REASON; +#define LM_UNKNOWN 0xff /* Unspecified disconnect reason */ +/* + * Notify structure used between transport and link management layers + */ +struct notify_t { + int (*data_indication)(void *priv, void *sap, struct sk_buff *skb); + int (*udata_indication)(void *priv, void *sap, struct sk_buff *skb); + void (*connect_confirm)(void *instance, void *sap, + struct qos_info *qos, __u32 max_sdu_size, + struct sk_buff *skb); + void (*connect_indication)(void *instance, void *sap, + struct qos_info *qos, __u32 max_sdu_size, + struct sk_buff *skb); + void (*disconnect_indication)(void *instance, void *sap, + LM_REASON reason, struct sk_buff *); + void (*flow_indication)(void *instance, void *sap, LOCAL_FLOW flow); + void *instance; /* Layer instance pointer */ + char name[16]; /* Name of layer */ +}; +#define NOTIFY_MAX_NAME 16 +#endif /* NET_IRDA_H */ diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irda_device.h linux/include/net/irda/irda_device.h --- v2.2.5/linux/include/net/irda/irda_device.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irda_device.h Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Haris Zukanovic * Created at: Tue Apr 14 12:41:42 1998 - * Modified at: Tue Feb 9 14:01:50 1999 + * Modified at: Wed Apr 7 17:17:16 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Haris Zukanovic, @@ -31,17 +31,20 @@ #include #include +#include + #include #include #include -/* Some non-standard interface flags (should not conflict with any in if.h */ +/* Some non-standard interface flags (should not conflict with any in if.h) */ #define IFF_SIR 0x01 /* Supports SIR speeds */ #define IFF_MIR 0x02 /* Supports MIR speeds */ #define IFF_FIR 0x04 /* Supports FIR speeds */ #define IFF_PIO 0x08 /* Supports PIO transfer of data */ #define IFF_DMA 0x10 /* Supports DMA transfer of data */ -#define IFF_DONGLE 0x20 /* Interface has a dongle attached */ +#define IFF_SHM 0x20 /* Supports shared memory data transfers */ +#define IFF_DONGLE 0x40 /* Interface has a dongle attached */ #define IO_XMIT 0x01 #define IO_RECV 0x02 @@ -50,12 +53,13 @@ struct chipio_t { int iobase, iobase2; /* IO base */ int io_ext, io_ext2; /* Length of iobase */ + int membase; /* Shared memory base */ int irq, irq2; /* Interrupts used */ int fifo_size; /* FIFO size */ int dma, dma2; /* DMA channel used */ int irqflags; /* interrupt flags (ie, SA_SHIRQ|SA_INTERRUPT) */ - int direction; /* Used by some FIR drivers */ + int direction; /* Link direction, used by some FIR drivers */ int baudrate; /* Currently used baudrate */ int dongle_id; /* Dongle or transceiver currently used */ @@ -107,50 +111,40 @@ int xbofs; int media_busy; + /* spinlock_t lock; */ /* For serializing operations */ /* Media busy stuff */ struct timer_list media_busy_timer; - struct timer_list todo_timer; - - int (*hard_xmit)( struct sk_buff *skb, struct device *dev); - void (*change_speed)( struct irda_device *driver, int baud); + /* Driver specific implementation */ + void (*change_speed)(struct irda_device *driver, int baud); int (*is_receiving)(struct irda_device *); /* receiving? */ /* int (*is_tbusy)(struct irda_device *); */ /* transmitting? */ void (*wait_until_sent)(struct irda_device *); - - int new_speed; /* Will be removed in future */ }; extern hashbin_t *irda_device; /* Function prototypes */ -int irda_device_init( void); -void irda_device_cleanup( void); +int irda_device_init(void); +void irda_device_cleanup(void); -int irda_device_open( struct irda_device *, char *name, void *priv); -void irda_device_close( struct irda_device *); +int irda_device_open(struct irda_device *, char *name, void *priv); +void irda_device_close(struct irda_device *); /* Interface to be uses by IrLAP */ -inline void irda_device_set_media_busy( struct irda_device *, int status); -inline int irda_device_is_media_busy( struct irda_device *); -inline int irda_device_is_receiving( struct irda_device *); -inline void irda_device_change_speed( struct irda_device *, int); +inline void irda_device_set_media_busy(struct irda_device *, int status); +inline int irda_device_is_media_busy(struct irda_device *); +inline int irda_device_is_receiving(struct irda_device *); +inline void irda_device_change_speed(struct irda_device *, int); -inline struct qos_info *irda_device_get_qos( struct irda_device *self); -int irda_device_txqueue_empty( struct irda_device *self); +inline struct qos_info *irda_device_get_qos(struct irda_device *self); +int irda_device_txqueue_empty(struct irda_device *self); -int irda_device_setup( struct device *dev); +int irda_device_setup(struct device *dev); -__inline__ int irda_get_mtt( struct sk_buff *skb); +inline unsigned short irda_get_mtt(struct sk_buff *skb); -void setup_dma( int channel, char *buffer, int count, int mode); +void setup_dma(int channel, char *buffer, int count, int mode); #endif - - - - - - - diff -u --recursive --new-file v2.2.5/linux/include/net/irda/iriap.h linux/include/net/irda/iriap.h --- v2.2.5/linux/include/net/irda/iriap.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/iriap.h Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Thu Aug 21 00:02:07 1997 - * Modified at: Tue Jan 26 11:50:33 1999 + * Modified at: Mon Mar 22 13:15:04 1999 * Modified by: Dag Brattli * * Copyright (c) 1997 Dag Brattli , All Rights Reserved. @@ -34,8 +34,8 @@ #include #include -#define LST 0x80 -#define ACK 0x40 +#define IAP_LST 0x80 +#define IAP_ACK 0x40 #define IAS_SERVER 0 #define IAS_CLIENT 1 @@ -91,13 +91,9 @@ void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb); void iriap_send_ack( struct iriap_cb *self); -void iriap_data_indication( void *instance, void *sap, struct sk_buff *skb); -void iriap_connect_confirm( void *instance, void *sap, struct qos_info *qos, - int max_sdu_size, struct sk_buff *skb); -void iriap_connect_indication( void *instance, void *sap, - struct qos_info *qos, int max_sdu_size, - struct sk_buff *skb); -void iriap_call_indication( struct iriap_cb *self, struct sk_buff *skb); +void iriap_connect_confirm(void *instance, void *sap, struct qos_info *qos, + __u32 max_sdu_size, struct sk_buff *skb); +void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb); void iriap_register_server(void); diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irkbd.h linux/include/net/irda/irkbd.h --- v2.2.5/linux/include/net/irda/irkbd.h Wed Dec 31 16:00:00 1969 +++ linux/include/net/irda/irkbd.h Thu Apr 15 05:42:41 1999 @@ -0,0 +1,91 @@ +/********************************************************************* + * + * Filename: irkbd.h + * Version: 0.2 + * Description: IrDA Keyboard/Mouse driver (Tekram IR-660) + * Status: Experimental. + * Author: Dag Brattli + * Created at: Mon Mar 1 00:24:19 1999 + * Modified at: Thu Mar 11 14:54:00 1999 + * Modified by: Dag Brattli + * + * Copyright (c) 1999 Dag Brattli, 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. + * + * Neither Dag Brattli nor University of Tromsų admit liability nor + * provide warranty for any of this software. This material is + * provided "AS-IS" and at no charge. + * + ********************************************************************/ + +#ifndef IRKBD_H +#define IRKBD_H + +/* Some commands */ +#define IRKBD_CMD_INIT_KBD 0xfe +#define IRKBD_CMD_INIT_MOUSE 0xff +#define IRKBD_CMD_ENABLE 0x41 +#define IRKBD_CMD_LED 0x31 +#define IRKBD_CMD_KDB_SPEED 0x33 + +/* Some responses */ +#define IRKBD_RSP_KBDOK 0x11 +#define IRKBD_RSP_KBDERR 0x12 +#define IRKBD_RSP_MSOK 0x21 +#define IRKBD_RSP_MSERR 0x22 +#define IRKBD_RSP_LEDOK 0x31 +#define IRKBD_RSP_KBDSPEEDOK 0x33 +#define IRKBD_RSP_RSPN41 0x41 + +#define IRKBD_RATE 2 /* Polling rate, should be 15 ms */ +#define IRKBD_TIMEOUT 100 /* 1000 ms */ + +#define SUBFRAME_MASK 0xc0 +#define SUBFRAME_MOUSE 0x80 +#define SUBFRAME_KEYBOARD 0x40 +#define SUBFRAME_RESPONSE 0x00 + +#define IRKBD_MAX_HEADER (TTP_HEADER+LMP_HEADER+LAP_HEADER) + +#define IRKBD_BUF_SIZE 4096 /* Must be power of 2! */ + +enum { + IRKBD_IDLE, /* Not connected */ + IRKBD_INIT_KBD, /* Initializing keyboard */ + IRKBD_INIT_MOUSE, /* Initializing mouse */ + IRKBD_POLLING, /* Polling device */ +}; + +/* Main structure */ +struct irkbd_cb { + struct miscdevice dev; + char devname[9]; /* name of the registered device */ + int state; + + int count; /* Open count */ + + __u32 saddr; /* my local address */ + __u32 daddr; /* peer address */ + + struct tsap_cb *tsap; + __u8 dtsap_sel; /* remote TSAP address */ + __u8 stsap_sel; /* local TSAP address */ + + struct timer_list watchdog_timer; + + LOCAL_FLOW tx_flow; + LOCAL_FLOW rx_flow; + + __u8 scancodes[IRKBD_BUF_SIZE]; /* Buffer for mouse events */ + int head; + int tail; + + struct wait_queue *read_wait; + struct fasync_struct *async; +}; + +#endif /* IRKBD_H */ diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irlan_client.h linux/include/net/irda/irlan_client.h --- v2.2.5/linux/include/net/irda/irlan_client.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irlan_client.h Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sun Aug 31 20:14:37 1997 - * Modified at: Wed Feb 3 14:29:49 1999 + * Modified at: Thu Feb 25 21:05:53 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , All Rights Reserved. @@ -33,7 +33,7 @@ #include void irlan_client_start_kick_timer(struct irlan_cb *self, int timeout); -void irlan_client_discovery_indication(DISCOVERY*); +void irlan_client_discovery_indication(discovery_t *); void irlan_client_wakeup(struct irlan_cb *self, __u32 saddr, __u32 daddr); void irlan_client_open_ctrl_tsap( struct irlan_cb *self); diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irlan_common.h linux/include/net/irda/irlan_common.h --- v2.2.5/linux/include/net/irda/irlan_common.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irlan_common.h Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sun Aug 31 20:14:37 1997 - * Modified at: Wed Feb 17 23:28:53 1999 + * Modified at: Tue Apr 6 16:19:41 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , All Rights Reserved. @@ -25,6 +25,8 @@ #ifndef IRLAN_H #define IRLAN_H +#include /* for HZ */ + #include #include #include @@ -34,7 +36,7 @@ #include #define IRLAN_MTU 1518 -#define IRLAN_TIMEOUT 1000 +#define IRLAN_TIMEOUT 10*HZ /* 10 seconds */ /* Command packet types */ #define CMD_GET_PROVIDER_INFO 0 diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irlan_eth.h linux/include/net/irda/irlan_eth.h --- v2.2.5/linux/include/net/irda/irlan_eth.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irlan_eth.h Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Thu Oct 15 08:36:58 1998 - * Modified at: Fri Jan 29 15:20:45 1999 + * Modified at: Mon Mar 22 12:57:11 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. @@ -25,8 +25,8 @@ #ifndef IRLAN_ETH_H #define IRLAN_ETH_H -void irlan_eth_receive( void *instance, void *sap, struct sk_buff *skb); -int irlan_eth_xmit( struct sk_buff *skb, struct device *dev); +int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb); +int irlan_eth_xmit(struct sk_buff *skb, struct device *dev); void irlan_eth_flow_indication( void *instance, void *sap, LOCAL_FLOW flow); diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irlan_provider.h linux/include/net/irda/irlan_provider.h --- v2.2.5/linux/include/net/irda/irlan_provider.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irlan_provider.h Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sun Aug 31 20:14:37 1997 - * Modified at: Sat Jan 30 16:22:24 1999 + * Modified at: Mon Mar 8 15:32:35 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , All Rights Reserved. @@ -40,7 +40,8 @@ struct sk_buff *skb); void irlan_provider_connect_indication(void *instance, void *sap, - struct qos_info *qos, int max_sdu_size, + struct qos_info *qos, + __u32 max_sdu_size, struct sk_buff *skb); void irlan_provider_connect_response(struct irlan_cb *, struct tsap_cb *); diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irlap.h linux/include/net/irda/irlap.h --- v2.2.5/linux/include/net/irda/irlap.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irlap.h Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Mon Aug 4 20:40:53 1997 - * Modified at: Mon Jan 25 13:58:59 1999 + * Modified at: Fri Mar 26 15:15:17 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , All Rights Reserved. @@ -157,23 +157,19 @@ int discovery_count; hashbin_t *discovery_log; - DISCOVERY *discovery_cmd; + discovery_t *discovery_cmd; struct qos_info qos_tx; /* QoS requested by peer */ struct qos_info qos_rx; /* QoS requested by self */ struct notify_t notify; /* Callbacks to IrLMP */ - int mtt_required; /* Minumum turnaround time required */ - int xbofs_delay; /* Nr of XBOF's used to MTT */ - int bofs_count; /* Negotiated extra BOFs */ + int mtt_required; /* Minumum turnaround time required */ + int xbofs_delay; /* Nr of XBOF's used to MTT */ + int bofs_count; /* Negotiated extra BOFs */ struct irda_statistics stats; -#ifdef CONFIG_IRDA_RECYCLE_RR - struct sk_buff *recycle_rr_skb; -#endif - #ifdef CONFIG_IRDA_COMPRESSION struct irda_compressor compressor; struct irda_compressor decompressor; @@ -210,9 +206,9 @@ void irlap_test_request( __u8 *info, int len); -void irlap_discovery_request( struct irlap_cb *, DISCOVERY *discovery); -void irlap_discovery_confirm( struct irlap_cb *, hashbin_t *discovery_log); -void irlap_discovery_indication( struct irlap_cb *, DISCOVERY *discovery); +void irlap_discovery_request(struct irlap_cb *, discovery_t *discovery); +void irlap_discovery_confirm(struct irlap_cb *, hashbin_t *discovery_log); +void irlap_discovery_indication(struct irlap_cb *, discovery_t *discovery); void irlap_reset_indication( struct irlap_cb *self); void irlap_reset_confirm(void); diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irlap_event.h linux/include/net/irda/irlap_event.h --- v2.2.5/linux/include/net/irda/irlap_event.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irlap_event.h Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sat Aug 16 00:59:29 1997 - * Modified at: Thu Feb 11 00:41:02 1999 + * Modified at: Tue Apr 6 17:10:38 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , All Rights Reserved. @@ -25,7 +25,8 @@ #ifndef IRLAP_EVENT_H #define IRLAP_EVENT_H -#include "irmod.h" +#include +#include struct irlap_cb; @@ -67,6 +68,7 @@ RECV_DISCOVERY_XID_RSP, RECV_SNRM_CMD, RECV_TEST_CMD, + RECV_TEST_RSP, RECV_UA_RSP, RECV_DM_RSP, RECV_I_CMD, @@ -108,7 +110,7 @@ int slot; /* Random chosen slot */ int s; /* Current slot */ - DISCOVERY *discovery; /* Discovery information */ + discovery_t *discovery; /* Discovery information */ }; extern const char *irlap_state[]; diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irlap_frame.h linux/include/net/irda/irlap_frame.h --- v2.2.5/linux/include/net/irda/irlap_frame.h Tue Dec 22 14:16:58 1998 +++ linux/include/net/irda/irlap_frame.h Thu Apr 15 05:42:41 1999 @@ -1,12 +1,12 @@ /********************************************************************* * * Filename: irlap_frame.h - * Version: 0.3 + * Version: 0.9 * Description: Build and transmit IrLAP frames * Status: Experimental. * Author: Dag Brattli * Created at: Tue Aug 19 10:27:26 1997 - * Modified at: Mon Dec 14 14:22:23 1998 + * Modified at: Fri Mar 26 14:10:53 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , All Rights Reserved. @@ -27,7 +27,7 @@ #include -#include +#include #include #include @@ -59,70 +59,58 @@ #define I_FRAME 0x00 /* Information Format */ #define UI_FRAME 0x03 /* Unnumbered Information */ -#define CMD_FRAME 0x01 -#define RSP_FRAME 0x00 +#define CMD_FRAME 0x01 +#define RSP_FRAME 0x00 -#define PF_BIT 0x10 /* Poll/final bit */ - -#define IR_S 0x01 /* Supervisory frames */ -#define IR_RR 0x01 /* Receiver ready */ -#define IR_RNR 0x05 /* Receiver not ready */ -#define IR_REJ 0x09 /* Reject */ -#define IR_U 0x03 /* Unnumbered frames */ -#define IR_SNRM 0x2f /* Set Asynchronous Balanced Mode */ - -#define IR_DISC 0x43 /* Disconnect */ -#define IR_DM 0x0f /* Disconnected mode */ -#define IR_UA 0x63 /* Unnumbered acknowledge */ -#define IR_FRMR 0x87 /* Frame reject */ -#define IR_UI 0x03 /* Unnumbered information */ +#define PF_BIT 0x10 /* Poll/final bit */ struct xid_frame { - __u8 caddr __attribute__((packed)); /* Connection address */ - __u8 control __attribute__((packed)); - __u8 ident __attribute__((packed)); /* Should always be XID_FORMAT */ - __u32 saddr __attribute__((packed)); /* Source device address */ - __u32 daddr __attribute__((packed)); /* Destination device address */ - __u8 flags __attribute__((packed)); /* Discovery flags */ - __u8 slotnr __attribute__((packed)); - __u8 version __attribute__((packed)); - __u8 discovery_info[0] __attribute__((packed)); -}; + __u8 caddr; /* Connection address */ + __u8 control; + __u8 ident; /* Should always be XID_FORMAT */ + __u32 saddr; /* Source device address */ + __u32 daddr; /* Destination device address */ + __u8 flags; /* Discovery flags */ + __u8 slotnr; + __u8 version; + __u8 discovery_info[0]; +} PACK; struct test_frame { __u8 caddr; /* Connection address */ __u8 control; - __u8 saddr; /* Source device address */ - __u8 daddr; /* Destination device address */ - __u8 *info; /* Information */ -}; + __u32 saddr; /* Source device address */ + __u32 daddr; /* Destination device address */ + __u8 info[0]; /* Information */ +} PACK; struct ua_frame { - __u8 caddr __attribute__((packed)); - __u8 control __attribute__((packed)); + __u8 caddr; + __u8 control; - __u32 saddr __attribute__((packed)); /* Source device address */ - __u32 daddr __attribute__((packed)); /* Dest device address */ + __u32 saddr; /* Source device address */ + __u32 daddr; /* Dest device address */ __u8 params[0]; -}; +} PACK; struct i_frame { - __u8 caddr __attribute__((packed)); - __u8 control __attribute__((packed)); - __u8 data[0] __attribute__((packed)); -}; + __u8 caddr; + __u8 control; + __u8 data[0]; +} PACK; struct snrm_frame { - __u8 caddr __attribute__((packed)); - __u8 control __attribute__((packed)); - __u32 saddr __attribute__((packed)); - __u32 daddr __attribute__((packed)); - __u8 ncaddr __attribute__((packed)); + __u8 caddr; + __u8 control; + __u32 saddr; + __u32 daddr; + __u8 ncaddr; __u8 params[0]; -}; +} PACK; /* Per-packet information we need to hide inside sk_buff */ struct irlap_skb_cb { + int magic; /* Be sure that we can trust the information */ int mtt; /* minimum turn around time */ int xbofs; /* number of xbofs required */ int vs; /* next frame to send */ @@ -132,8 +120,10 @@ __inline__ void irlap_insert_mtt( struct irlap_cb *self, struct sk_buff *skb); void irlap_send_discovery_xid_frame( struct irlap_cb *, int S, __u8 s, - __u8 command, DISCOVERY *discovery); + __u8 command, discovery_t *discovery); void irlap_send_snrm_frame( struct irlap_cb *, struct qos_info *); +void irlap_send_test_frame(struct irlap_cb *self, __u32 daddr, + struct sk_buff *cmd); void irlap_send_ua_response_frame( struct irlap_cb *, struct qos_info *); void irlap_send_ui_frame( struct irlap_cb *self, struct sk_buff *skb, int command); @@ -149,7 +139,5 @@ void irlap_send_i_frame( struct irlap_cb *, struct sk_buff *, int command); void irlap_send_ui_frame( struct irlap_cb *, struct sk_buff *, int command); - -/* void irlap_input( struct irlap_cb *self, struct sk_buff *skb); */ #endif diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irlmp.h linux/include/net/irda/irlmp.h --- v2.2.5/linux/include/net/irda/irlmp.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irlmp.h Thu Apr 15 05:42:41 1999 @@ -1,12 +1,12 @@ /********************************************************************* * * Filename: irlmp.h - * Version: 0.3 + * Version: 0.9 * Description: IrDA Link Management Protocol (LMP) layer * Status: Experimental. * Author: Dag Brattli * Created at: Sun Aug 17 20:54:32 1997 - * Modified at: Thu Feb 4 11:06:24 1999 + * Modified at: Tue Apr 6 20:05:14 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , All Rights Reserved. @@ -25,14 +25,17 @@ #ifndef IRLMP_H #define IRLMP_H +#include /* for HZ */ + #include #include -#include +#include #include #include #include #include +#include /* LSAP-SEL's */ #define LSAP_MASK 0x7f @@ -53,25 +56,7 @@ #define LM_MAX_CONNECTIONS 10 -/* Hint bit positions for first hint byte */ -#define HINT_PNP 0x01 -#define HINT_PDA 0x02 -#define HINT_COMPUTER 0x04 -#define HINT_PRINTER 0x08 -#define HINT_MODEM 0x10 -#define HINT_FAX 0x20 -#define HINT_LAN 0x40 -#define HINT_EXTENSION 0x80 - -/* Hint bit positions for second hint byte (first extension byte) */ -#define HINT_TELEPHONY 0x01 -#define HINT_FILE_SERVER 0x02 -#define HINT_COMM 0x04 -#define HINT_MESSAGE 0x08 -#define HINT_HTTP 0x10 -#define HINT_OBEX 0x20 - -#define LM_IDLE_TIMEOUT 200 /* 2 seconds for now */ +#define LM_IDLE_TIMEOUT 2*HZ /* 2 seconds for now */ typedef enum { S_PNP, @@ -84,23 +69,27 @@ S_TELEPHONY, S_COMM, S_OBEX, + S_ANY, + S_END, } SERVICE; -#define S_END 0xff +typedef void (*DISCOVERY_CALLBACK1) (discovery_t *); +typedef void (*DISCOVERY_CALLBACK2) (hashbin_t *); -#define CLIENT 1 -#define SERVER 2 +typedef struct { + QUEUE queue; /* Must be first */ -typedef void (*DISCOVERY_CALLBACK) ( DISCOVERY*); + __u16 hints; /* Hint bits */ +} irlmp_service_t; -struct irlmp_registration { +typedef struct { QUEUE queue; /* Must be first */ - int service; /* LAN, OBEX, COMM etc. */ - int type; /* Client or server or both */ + __u16 hint_mask; - DISCOVERY_CALLBACK discovery_callback; -}; + DISCOVERY_CALLBACK1 callback1; + DISCOVERY_CALLBACK2 callback2; +} irlmp_client_t; struct lap_cb; /* Forward decl. */ @@ -142,17 +131,13 @@ IRLMP_STATE lap_state; - struct irlap_cb *irlap; /* Instance of IrLAP layer */ - + struct irlap_cb *irlap; /* Instance of IrLAP layer */ hashbin_t *lsaps; /* LSAP associated with this link */ - __u8 caddr; /* Connection address */ - + __u8 caddr; /* Connection address */ __u32 saddr; /* Source device address */ __u32 daddr; /* Destination device address */ - hashbin_t *cachelog; /* Discovered devices for this link */ - struct qos_info *qos; /* LAP QoS for this session */ struct timer_list idle_timer; }; @@ -176,8 +161,8 @@ __u8 conflict_flag; - DISCOVERY discovery_cmd; /* Discovery command to use by IrLAP */ - DISCOVERY discovery_rsp; /* Discovery response to use by IrLAP */ + discovery_t discovery_cmd; /* Discovery command to use by IrLAP */ + discovery_t discovery_rsp; /* Discovery response to use by IrLAP */ int free_lsap_sel; @@ -188,25 +173,34 @@ hashbin_t *links; /* IrLAP connection table */ hashbin_t *unconnected_lsaps; - hashbin_t *registry; + hashbin_t *clients; + hashbin_t *services; + + hashbin_t *cachelog; + int running; - __u8 hint[2]; /* Hint bits */ + spinlock_t lock; + + __u16_host_order hints; /* Hint bits */ }; /* Prototype declarations */ int irlmp_init(void); void irlmp_cleanup(void); - struct lsap_cb *irlmp_open_lsap( __u8 slsap, struct notify_t *notify); void irlmp_close_lsap( struct lsap_cb *self); -void irlmp_register_layer( int service, int type, int do_discovery, - DISCOVERY_CALLBACK); -void irlmp_unregister_layer( int service, int type); - -void irlmp_register_irlap( struct irlap_cb *self, __u32 saddr, - struct notify_t *); -void irlmp_unregister_irlap( __u32 saddr); +__u16 irlmp_service_to_hint(int service); +__u32 irlmp_register_service(__u16 hints); +int irlmp_unregister_service(__u32 handle); +__u32 irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 callback1, + DISCOVERY_CALLBACK2 callback2); +int irlmp_unregister_client(__u32 handle); +int irlmp_update_client(__u32 handle, __u16 hint_mask, + DISCOVERY_CALLBACK1, DISCOVERY_CALLBACK2); + +void irlmp_register_link(struct irlap_cb *, __u32 saddr, struct notify_t *); +void irlmp_unregister_link(__u32 saddr); int irlmp_connect_request( struct lsap_cb *, __u8 dlsap_sel, __u32 saddr, __u32 daddr, @@ -214,16 +208,16 @@ void irlmp_connect_indication( struct lsap_cb *self, struct sk_buff *skb); void irlmp_connect_response( struct lsap_cb *, struct sk_buff *); void irlmp_connect_confirm( struct lsap_cb *, struct sk_buff *); +struct lsap_cb *irlmp_dup(struct lsap_cb *self, void *instance); - -void irlmp_disconnect_indication( struct lsap_cb *self, LM_REASON reason, - struct sk_buff *userdata); -void irlmp_disconnect_request( struct lsap_cb *, struct sk_buff *userdata); - -void irlmp_discovery_confirm( struct lap_cb *, hashbin_t *discovery_log); -void irlmp_discovery_indication( struct lap_cb *, DISCOVERY *discovery); -void irlmp_discovery_request( int nslots); -DISCOVERY *irlmp_get_discovery_response(void); +void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason, + struct sk_buff *userdata); +void irlmp_disconnect_request(struct lsap_cb *, struct sk_buff *userdata); + +void irlmp_discovery_confirm(hashbin_t *discovery_log); +void irlmp_discovery_request(int nslots); +void irlmp_do_discovery(int nslots); +discovery_t *irlmp_get_discovery_response(void); void irlmp_data_request( struct lsap_cb *, struct sk_buff *); void irlmp_udata_request( struct lsap_cb *, struct sk_buff *); @@ -240,9 +234,11 @@ __u32 irlmp_get_saddr(struct lsap_cb *self); __u32 irlmp_get_daddr(struct lsap_cb *self); - extern char *lmp_reasons[]; extern int sysctl_discovery_slots; +extern int sysctl_discovery; extern struct irlmp_cb *irlmp; + +static inline hashbin_t *irlmp_get_cachelog(void) { return irlmp->cachelog; } #endif diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irlmp_event.h linux/include/net/irda/irlmp_event.h --- v2.2.5/linux/include/net/irda/irlmp_event.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irlmp_event.h Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Mon Aug 4 20:40:53 1997 - * Modified at: Thu Feb 11 00:42:41 1999 + * Modified at: Thu Feb 25 20:49:16 1999 * Modified by: Dag Brattli * * Copyright (c) 1997 Dag Brattli , All Rights Reserved. @@ -92,7 +92,7 @@ int reason; - DISCOVERY *discovery; + discovery_t *discovery; }; extern const char *irlmp_state[]; diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irlmp_frame.h linux/include/net/irda/irlmp_frame.h --- v2.2.5/linux/include/net/irda/irlmp_frame.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irlmp_frame.h Thu Apr 15 05:42:41 1999 @@ -1,12 +1,12 @@ /********************************************************************* * * Filename: irlmp_frame.h - * Version: 0.1 + * Version: 0.9 * Description: * Status: Experimental. * Author: Dag Brattli * Created at: Tue Aug 19 02:09:59 1997 - * Modified at: Tue Feb 2 11:07:45 1999 + * Modified at: Tue Apr 6 17:12:57 1999 * Modified by: Dag Brattli * * Copyright (c) 1997 Dag Brattli , All Rights Reserved. @@ -27,31 +27,31 @@ #include -/* Frame opcodes */ +#include + +/* IrLMP frame opcodes */ #define CONNECT_CMD 0x01 #define CONNECT_CNF 0x81 #define DISCONNECT 0x02 #define ACCESSMODE_CMD 0x03 #define ACCESSMODE_CNF 0x83 -#define CONTROL_BIT 0x80 +#define CONTROL_BIT 0x80 -inline void irlmp_send_data_pdu( struct lap_cb *self, __u8 dlsap, __u8 slsap, - int expedited, struct sk_buff *skb); -void irlmp_send_lcf_pdu( struct lap_cb *self, __u8 dlsap, __u8 slsap, - __u8 opcode, struct sk_buff *skb); -void irlmp_link_data_indication( struct lap_cb *, int reliable, - struct sk_buff *); -void irlmp_link_connect_indication( struct lap_cb *, __u32 saddr, __u32 daddr, - struct qos_info *qos, struct sk_buff *skb); -void irlmp_link_connect_request( __u32 daddr); -void irlmp_link_connect_confirm( struct lap_cb *self, struct qos_info *qos, - struct sk_buff *skb); -void irlmp_link_disconnect_indication( struct lap_cb *self, - struct irlap_cb *irlap, - LAP_REASON reason, - struct sk_buff *); -void irlmp_link_discovery_confirm( struct lap_cb *self, hashbin_t *log); -/* void irlmp_link_disconnect_request( void); */ +inline void irlmp_send_data_pdu(struct lap_cb *self, __u8 dlsap, __u8 slsap, + int expedited, struct sk_buff *skb); +void irlmp_send_lcf_pdu(struct lap_cb *self, __u8 dlsap, __u8 slsap, + __u8 opcode, struct sk_buff *skb); +void irlmp_link_data_indication(struct lap_cb *, int reliable, + struct sk_buff *); +void irlmp_link_connect_indication(struct lap_cb *, __u32 saddr, __u32 daddr, + struct qos_info *qos, struct sk_buff *skb); +void irlmp_link_connect_request(__u32 daddr); +void irlmp_link_connect_confirm(struct lap_cb *self, struct qos_info *qos, + struct sk_buff *skb); +void irlmp_link_disconnect_indication(struct lap_cb *, struct irlap_cb *, + LAP_REASON reason, struct sk_buff *); +void irlmp_link_discovery_confirm(struct lap_cb *self, hashbin_t *log); +void irlmp_link_discovery_indication(struct lap_cb *, discovery_t *discovery); #endif diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irmod.h linux/include/net/irda/irmod.h --- v2.2.5/linux/include/net/irda/irmod.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irmod.h Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Mon Dec 15 13:58:52 1997 - * Modified at: Thu Feb 11 15:14:30 1999 + * Modified at: Tue Mar 16 22:27:41 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. @@ -29,7 +29,6 @@ #include #include -#include #define IRMGR_IOC_MAGIC 'm' #define IRMGR_IOCTNPC _IO(IRMGR_IOC_MAGIC, 1) @@ -45,7 +44,6 @@ EVENT_IRLAN_STOP, EVENT_IRLPT_START, EVENT_IRLPT_STOP, -/* EVENT_IROBEX_INIT, */ EVENT_IROBEX_START, EVENT_IROBEX_STOP, EVENT_IRDA_STOP, @@ -100,176 +98,28 @@ QUEUE *todo_queue; /* Todo list */ }; -typedef struct { - char irda_call[7]; /* 6 call + SSID (shifted ascii!) */ -} irda_address; - -struct sockaddr_irda { - short sirda_family; - irda_address sirda_call; - int sirda_ndigis; -}; - -/* - * This type is used by the protocols that transmit 16 bits words in - * little endian format. A little endian machine stores MSB of word in - * byte[1] and LSB in byte[0]. A big endian machine stores MSB in byte[0] - * and LSB in byte[1]. - */ -typedef union { - __u16 word; - __u8 byte[2]; -} __u16_host_order; - -/* - * Information monitored by some layers - */ -struct irda_statistics -{ - int rx_packets; /* total packets received */ - int tx_packets; /* total packets transmitted */ - int rx_errors; /* bad packets received */ - int tx_errors; /* packet transmit problems */ - int rx_dropped; /* no space in linux buffers */ - int tx_dropped; /* no space available in linux */ - int rx_compressed; - int tx_compressed; - int rx_bytes; /* total bytes received */ - int tx_bytes; /* total bytes transmitted */ +int irmod_init_module(void); +void irmod_cleanup_module(void); - int multicast; /* multicast packets received */ - int collisions; - - /* detailed rx_errors: */ - int rx_length_errors; - int rx_over_errors; /* receiver ring buff overflow */ - int rx_crc_errors; /* recved pkt with crc error */ - int rx_frame_errors; /* recv'd frame alignment error */ - int rx_fifo_errors; /* recv'r fifo overrun */ - int rx_missed_errors; /* receiver missed packet */ - - /* detailed tx_errors */ - int tx_aborted_errors; - int tx_carrier_errors; - int tx_fifo_errors; - int tx_heartbeat_errors; - int tx_window_errors; -}; +inline int irda_lock(int *lock); +inline int irda_unlock(int *lock); -typedef enum { - NO_CHANGE, - LOCKED, - UNLOCKED, -} LOCK_STATUS; +void irda_notify_init(struct notify_t *notify); -/* Misc status information */ -typedef enum { - STATUS_OK, - STATUS_ABORTED, - STATUS_NO_ACTIVITY, - STATUS_NOISY, - STATUS_REMOTE, -} LINK_STATUS; - -typedef enum { /* FIXME check the two first reason codes */ - LAP_DISC_INDICATION=1, /* Received a disconnect request from peer */ - LAP_NO_RESPONSE, /* To many retransmits without response */ - LAP_RESET_INDICATION, /* To many retransmits, or invalid nr/ns */ - LAP_FOUND_NONE, /* No devices were discovered */ - LAP_MEDIA_BUSY, - LAP_PRIMARY_CONFLICT, -} LAP_REASON; - -/* - * IrLMP disconnect reasons. The order is very important, since they - * correspond to disconnect reasons sent in IrLMP disconnect frames, so - * please do not touch :-) - */ -typedef enum { - LM_USER_REQUEST = 1, /* User request */ - LM_LAP_DISCONNECT, /* Unexpected IrLAP disconnect */ - LM_CONNECT_FAILURE, /* Failed to establish IrLAP connection */ - LM_LAP_RESET, /* IrLAP reset */ - LM_INIT_DISCONNECT, /* Link Management initiated disconnect */ - LM_LSAP_NOTCONN, /* Data delivered on unconnected LSAP */ - LM_NON_RESP_CLIENT, /* Non responsive LM-MUX client */ - LM_NO_AVAIL_CLIENT, /* No available LM-MUX client */ - LM_CONN_HALF_OPEN, /* Connection is half open */ - LM_BAD_SOURCE_ADDR, /* Illegal source address (i.e 0x00) */ -} LM_REASON; -#define LM_UNKNOWN 0xff /* Unspecified disconnect reason */ +void irda_execute_as_process(void *self, TODO_CALLBACK callback, __u32 param); +void irmanager_notify(struct irmanager_event *event); -/* - * IrLMP character code values - */ -#define CS_ASCII 0x00 -#define CS_ISO_8859_1 0x01 -#define CS_ISO_8859_2 0x02 -#define CS_ISO_8859_3 0x03 -#define CS_ISO_8859_4 0x04 -#define CS_ISO_8859_5 0x05 -#define CS_ISO_8859_6 0x06 -#define CS_ISO_8859_7 0x07 -#define CS_ISO_8859_8 0x08 -#define CS_ISO_8859_9 0x09 -#define CS_UNICODE 0xff - -/* - * The DISCOVERY structure is used for both discovery requests and responses - */ -#define DISCOVERY struct discovery_t -struct discovery_t { - QUEUE queue; /* Must be first! */ - - __u32 saddr; /* Which link the device was discovered */ - __u32 daddr; /* Remote device address */ - LAP_REASON condition; /* More info about the discovery */ - - __u8 hint[2]; /* Discovery hint bits */ - __u8 charset; - char info[32]; /* Usually the name of the device */ - __u8 info_len; /* Length of device info field */ +extern void irda_proc_modcount(struct inode *, int); +void irda_mod_inc_use_count(void); +void irda_mod_dec_use_count(void); - int gen_addr_bit; /* Need to generate a new device address? */ - int nslots; /* Number of slots to use when discovering */ -}; +#endif /* IRMOD_H */ -typedef enum { FLOW_STOP, FLOW_START } LOCAL_FLOW; -/* - * Notify structure used between transport and link management layers - */ -struct notify_t { - void (*data_indication)( void *instance, void *sap, - struct sk_buff *skb); - void (*udata_indication)( void *instance, void *sap, - struct sk_buff *skb); - void (*connect_confirm)( void *instance, void *sap, - struct qos_info *qos, int max_sdu_size, - struct sk_buff *skb); - void (*connect_indication)( void *instance, void *sap, - struct qos_info *qos, int max_sdu_size, - struct sk_buff *skb); - void (*disconnect_indication)( void *instance, void *sap, - LM_REASON reason, struct sk_buff *); - void (*flow_indication)( void *instance, void *sap, LOCAL_FLOW flow); - void *instance; /* Layer instance pointer */ - char name[16]; /* Name of layer */ -}; -#define NOTIFY_MAX_NAME 16 -int irmod_init_module(void); -void irmod_cleanup_module(void); -inline int irda_lock(int *lock); -inline int irda_unlock(int *lock); -void irda_notify_init(struct notify_t *notify); -void irda_execute_as_process(void *self, TODO_CALLBACK callback, __u32 param); -void irmanager_notify(struct irmanager_event *event); -extern void irda_proc_modcount(struct inode *, int); -#endif diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irobex.h linux/include/net/irda/irobex.h --- v2.2.5/linux/include/net/irda/irobex.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irobex.h Thu Apr 15 05:42:41 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sat Jul 4 22:43:57 1998 - * Modified at: Tue Jan 26 11:49:55 1999 + * Modified at: Thu Mar 11 16:11:54 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. @@ -69,6 +69,9 @@ __u32 saddr; /* my local address */ __u32 daddr; /* peer address */ unsigned long time_discovered; + + __u32 ckey; /* IrLMP client handle */ + __u32 skey; /* IrLMP service handle */ char devname[9]; /* name of the registered device */ struct tsap_cb *tsap; diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irqueue.h linux/include/net/irda/irqueue.h --- v2.2.5/linux/include/net/irda/irqueue.h Tue Dec 22 14:16:58 1998 +++ linux/include/net/irda/irqueue.h Fri Apr 16 14:28:09 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Tue Jun 9 13:26:50 1998 - * Modified at: Sun Oct 25 00:26:31 1998 + * Modified at: Thu Feb 25 20:34:21 1999 * Modified by: Dag Brattli * * Copyright (C) 1998, Aage Kvalnes @@ -30,7 +30,7 @@ #include #include -#include +/* #include */ #ifndef QUEUE_H #define QUEUE_H @@ -50,6 +50,10 @@ */ #define HASHBIN_SIZE 8 #define HASHBIN_MASK 0x7 + +#ifndef ALIGN +#define ALIGN __attribute__((aligned)) +#endif typedef void (*FREE_FUNC)( void *arg); diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irttp.h linux/include/net/irda/irttp.h --- v2.2.5/linux/include/net/irda/irttp.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/irttp.h Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sun Aug 31 20:14:31 1997 - * Modified at: Tue Feb 2 10:55:18 1999 + * Modified at: Mon Mar 22 13:17:30 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , All Rights Reserved. @@ -27,8 +27,9 @@ #include #include +#include -#include +#include #include #include #include @@ -50,6 +51,7 @@ #define P_HIGH 1 #define SAR_DISABLE 0 +#define SAR_UNBOUND 0xffffffff /* * This structure contains all data assosiated with one instance of a TTP @@ -79,23 +81,22 @@ struct sk_buff_head rx_fragments; int tx_queue_lock; int rx_queue_lock; + spinlock_t lock; struct notify_t notify; /* Callbacks to client layer */ struct irda_statistics stats; struct timer_list todo_timer; - int rx_sdu_busy; /* RxSdu.busy */ - int rx_sdu_size; /* Current size of a partially received frame */ - int rx_max_sdu_size; /* Max receive user data size */ + int rx_sdu_busy; /* RxSdu.busy */ + __u32 rx_sdu_size; /* Current size of a partially received frame */ + __u32 rx_max_sdu_size; /* Max receive user data size */ - int tx_sdu_busy; /* TxSdu.busy */ - int tx_max_sdu_size; /* Max transmit user data size */ + int tx_sdu_busy; /* TxSdu.busy */ + int tx_max_sdu_size; /* Max transmit user data size */ - int no_defrag; /* Don't reassemble received fragments */ - - int close_pend; /* Close, but disconnect_pend */ - int disconnect_pend; /* Disconnect, but still data to send */ + int close_pend; /* Close, but disconnect_pend */ + int disconnect_pend; /* Disconnect, but still data to send */ struct sk_buff *disconnect_skb; }; @@ -115,23 +116,18 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb); int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb); -void irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, - __u32 saddr, __u32 daddr, - struct qos_info *qos, int max_sdu_size, - struct sk_buff *userdata); +int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, + __u32 saddr, __u32 daddr, + struct qos_info *qos, __u32 max_sdu_size, + struct sk_buff *userdata); void irttp_connect_confirm(void *instance, void *sap, struct qos_info *qos, - int max_sdu_size, struct sk_buff *skb); -void irttp_connect_response(struct tsap_cb *self, int max_sdu_size, + __u32 max_sdu_size, struct sk_buff *skb); +void irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size, struct sk_buff *userdata); - +struct tsap_cb *irttp_dup(struct tsap_cb *self, void *instance); void irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *skb, int priority); void irttp_flow_request(struct tsap_cb *self, LOCAL_FLOW flow); - -static __inline__ void irttp_no_reassemble(struct tsap_cb *self) -{ - self->no_defrag = TRUE; -} static __inline __u32 irttp_get_saddr(struct tsap_cb *self) { diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irvtd.h linux/include/net/irda/irvtd.h --- v2.2.5/linux/include/net/irda/irvtd.h Tue Dec 22 14:16:58 1998 +++ linux/include/net/irda/irvtd.h Thu Apr 15 05:42:42 1999 @@ -17,12 +17,13 @@ * ********************************************************************/ -#ifndef IRCOMM_H -#define IRCOMM_H +#ifndef IRVTD_H +#define IRVTD_H #include #include #include +#include #include #include @@ -34,18 +35,11 @@ #define IRVTD_RX_QUEUE_HIGH 10 #define IRVTD_RX_QUEUE_LOW 2 +#define IRCOMM_MAJOR 60; /* Zero means automatic allocation + 60,61,62,and 63 is reserved for experiment */ +#define IRVTD_MINOR 64 + -/* - * Serial input interrupt line counters -- external structure - * Four lines can interrupt: CTS, DSR, RI, DCD - * - * this structure must be compatible with serial_icounter_struct defined in - * . - */ -struct icounter_struct { - int cts, dsr, rng, dcd; - int reserved[16]; -}; struct irvtd_cb { @@ -53,9 +47,10 @@ /* if daddr is NULL, remote device have not been discovered yet */ + int tx_disable; int rx_disable; - struct sk_buff *txbuff; /* buffer queue */ - struct sk_buff_head rxbuff; /* buffer queue */ + struct sk_buff *txbuff; + struct sk_buff_head rxbuff; struct ircomm_cb *comm; /* ircomm instance */ /* @@ -63,7 +58,6 @@ * See linux/serial.h */ - int baud_base; int flags; struct tty_struct *tty; @@ -75,30 +69,24 @@ struct wait_queue *delta_msr_wait; struct wait_queue *tx_wait; - struct tq_struct rx_tqueue; + struct timer_list timer; long pgrp; long session; - struct termios normal_termios; - struct termios callout_termios; unsigned short closing_wait; /* time to wait before closing */ unsigned short close_delay; + int custom_divisor; int mcr; int msr; int cts_stoptx; int ttp_stoptx; int ttp_stoprx; - struct icounter_struct icount; + int disconnect_pend; + struct serial_icounter_struct icount; int read_status_mask; int ignore_status_mask; }; - - -/* Debug function */ - -/* #define CHECK_SKB(skb) check_skb((skb), __LINE__,__FILE__) */ - #endif diff -u --recursive --new-file v2.2.5/linux/include/net/irda/irvtd_driver.h linux/include/net/irda/irvtd_driver.h --- v2.2.5/linux/include/net/irda/irvtd_driver.h Tue Dec 22 14:16:58 1998 +++ linux/include/net/irda/irvtd_driver.h Wed Dec 31 16:00:00 1969 @@ -1,122 +0,0 @@ -/********************************************************************* - * - * Filename: irvtd_driver.h - * Version: 0.1 - * - * Copyright (c) 1998, Takahide Higuchi , - * 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. - * - * I, Takahide Higuchi, provide no warranty for any of this software. - * This material is provided "AS-IS" and at no charge. - * - ********************************************************************/ - -#include - -#include -#include -#include - - -#define VSP_TYPE_NORMAL 1 -#define VSP_TYPE_CALLOUT 2 -#define IRCOMM_MAJOR 60; /* Zero means automatic allocation - 60,61,62,and 63 is reserved for experiment */ -#define IRVTD_MINOR 64 -#define IRVTD_CALLOUT_MINOR 32 - -#define IRVTD_TYPE_NORMAL 11 -#define IRVTD_TYPE_CALLOUT 12 - - -#define IRCOMM_HEADER 1 -#define IRCOMM_RESERVE LAP_HEADER+LMP_HEADER+TTP_HEADER+IRCOMM_HEADER - - - - - -/* - * Definitions for ircomm_cb_struct flags field - * this section is "stolen" from linux-kernel (drivers/char/serial.c) - */ -#define IRVTD_ASYNC_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes - on the callout port */ -/* #define IRVTD_ASYNC_FOURPORT 0x0002 */ -/* Set OU1, OUT2 per AST Fourport settings */ - -#define IRVTD_ASYNC_SAK 0x0004 /* Secure Attention Key (Orange book) */ - -#define IRVTD_ASYNC_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */ - -#define IRVTD_ASYNC_SPD_MASK 0x0030 -#define IRVTD_ASYNC_SPD_HI 0x0010 /* Use 56000 instead of 38400 bps */ - -#define IRVTD_ASYNC_SPD_VHI 0x0020 /* Use 115200 instead of 38400 bps */ -#define IRVTD_ASYNC_SPD_CUST 0x0030 /* Use user-specified divisor */ - -#define IRVTD_ASYNC_SKIP_TEST 0x0040 /* Skip UART test during autoconfiguration */ -#define IRVTD_ASYNC_AUTO_IRQ 0x0080 /* Do automatic IRQ during autoconfiguration */ -#define IRVTD_ASYNC_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */ -#define IRVTD_ASYNC_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */ -#define IRVTD_ASYNC_CALLOUT_NOHUP 0x0400 /* Don't do hangups for cua device */ - -#define IRVTD_ASYNC_FLAGS 0x0FFF /* Possible legal async flags */ -#define IRVTD_ASYNC_USR_MASK 0x0430 /* Legal flags that non-privileged - * users can set or reset */ - -/* Internal flags used only by kernel/chr_drv/serial.c */ -#define IRVTD_ASYNC_INITIALIZED 0x80000000 /* Serial port was initialized */ -#define IRVTD_ASYNC_CALLOUT_ACTIVE 0x40000000 /* Call out device is active */ -#define IRVTD_ASYNC_NORMAL_ACTIVE 0x20000000 /* Normal device is active */ -#define IRVTD_ASYNC_BOOT_AUTOCONF 0x10000000 /* Autoconfigure port on bootup */ -#define IRVTD_ASYNC_CLOSING 0x08000000 /* Serial port is closing */ -#define IRVTD_ASYNC_CTS_FLOW 0x04000000 /* Do CTS flow control */ -#define IRVTD_ASYNC_CHECK_CD 0x02000000 /* i.e., CLOCAL */ -#define IRVTD_ASYNC_SHARE_IRQ 0x01000000 /* for multifunction cards */ - - -#define IRVTD_ASYNC_CLOSING_WAIT_INF 0 -#define IRVTD_ASYNC_CLOSING_WAIT_NONE 65535 - -/**************************************/ - -#define DELTA_DTR 0x01 -#define DELTA_RTS 0x02 -#define MCR_DTR 0x04 -#define MCR_RTS 0x08 - -#define DELTA_CTS 0x01 -#define DELTA_DSR 0x02 -#define DELTA_RI 0x04 -#define DELTA_DCD 0x08 -#define MSR_CTS 0x10 -#define MSR_DSR 0x20 -#define MSR_RI 0x40 -#define MSR_DCD 0x80 - -#define LSR_OE 0x02 /* Overrun error indicator */ -#define LSR_PE 0x04 /* Parity error indicator */ -#define LSR_FE 0x08 /* Frame error indicator */ -#define LSR_BI 0x01 /* Break interrupt indicator */ - - - -/**************************************/ - - - - -int irvtd_register_ttydriver(void); -void irvtd_unregister_ttydriver(void); - -void irvtd_flush_chars(struct tty_struct *tty); - - - - diff -u --recursive --new-file v2.2.5/linux/include/net/irda/timer.h linux/include/net/irda/timer.h --- v2.2.5/linux/include/net/irda/timer.h Wed Mar 10 15:29:50 1999 +++ linux/include/net/irda/timer.h Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sat Aug 16 00:59:29 1997 - * Modified at: Thu Feb 4 11:05:24 1999 + * Modified at: Tue Apr 6 16:17:16 1999 * Modified by: Dag Brattli * * Copyright (c) 1997, 1998 Dag Brattli , @@ -26,6 +26,8 @@ #ifndef TIMER_H #define TIMER_H +#include /* for HZ */ + #include #include #include @@ -35,46 +37,46 @@ /* * Timeout definitions, some defined in IrLAP p. 92 */ -#define POLL_TIMEOUT 45 /* Must never exceed 500 ms */ -#define FINAL_TIMEOUT 50 /* Must never exceed 500 ms */ +#define POLL_TIMEOUT 450*HZ/1000 /* Must never exceed 500 ms */ +#define FINAL_TIMEOUT 500*HZ/1000 /* Must never exceed 500 ms */ /* * Normally twice of p-timer. Note 3, IrLAP p. 60 suggests at least twice * duration of the P-timer. */ #define WD_TIMEOUT POLL_TIMEOUT*2 -#define MEDIABUSY_TIMEOUT 50 /* 500 msec */ +#define MEDIABUSY_TIMEOUT 500*HZ/1000 /* 500 msec */ /* * Slot timer must never exceed 85 ms, and must always be at least 25 ms, * suggested to 75-85 msec by IrDA lite */ -#define SLOT_TIMEOUT 8 -#define QUERY_TIMEOUT 100 +#define SLOT_TIMEOUT 80*HZ/1000 +#define QUERY_TIMEOUT HZ /* 1 sec */ -#define WATCHDOG_TIMEOUT 2000 /* 20 sec */ +#define WATCHDOG_TIMEOUT 20*HZ /* 20 sec */ -typedef void (*TIMER_CALLBACK)( unsigned long); +typedef void (*TIMER_CALLBACK)(unsigned long); -void irda_start_timer( struct timer_list *ptimer, int timeout, int data, - TIMER_CALLBACK callback); +void irda_start_timer(struct timer_list *ptimer, int timeout, int data, + TIMER_CALLBACK callback); -inline void irlap_start_slot_timer( struct irlap_cb *self, int timeout); -inline void irlap_start_query_timer( struct irlap_cb *self, int timeout); -inline void irlap_start_final_timer( struct irlap_cb *self, int timeout); -inline void irlap_start_wd_timer( struct irlap_cb *self, int timeout); -inline void irlap_start_backoff_timer( struct irlap_cb *self, int timeout); +inline void irlap_start_slot_timer(struct irlap_cb *self, int timeout); +inline void irlap_start_query_timer(struct irlap_cb *self, int timeout); +inline void irlap_start_final_timer(struct irlap_cb *self, int timeout); +inline void irlap_start_wd_timer(struct irlap_cb *self, int timeout); +inline void irlap_start_backoff_timer(struct irlap_cb *self, int timeout); -inline void irda_device_start_mbusy_timer( struct irda_device *self); +inline void irda_device_start_mbusy_timer(struct irda_device *self); struct lsap_cb; struct lap_cb; -inline void irlmp_start_watchdog_timer( struct lsap_cb *, int timeout); -inline void irlmp_start_discovery_timer( struct irlmp_cb *, int timeout); +inline void irlmp_start_watchdog_timer(struct lsap_cb *, int timeout); +inline void irlmp_start_discovery_timer(struct irlmp_cb *, int timeout); inline void irlmp_start_idle_timer(struct lap_cb *, int timeout); struct irobex_cb; -inline void irobex_start_watchdog_timer( struct irobex_cb *, int timeout); +inline void irobex_start_watchdog_timer(struct irobex_cb *, int timeout); #endif diff -u --recursive --new-file v2.2.5/linux/include/net/irda/uircc.h linux/include/net/irda/uircc.h --- v2.2.5/linux/include/net/irda/uircc.h Wed Jan 20 23:14:06 1999 +++ linux/include/net/irda/uircc.h Thu Apr 15 05:42:42 1999 @@ -7,7 +7,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sat Dec 26 11:00:49 1998 - * Modified at: Tue Jan 19 23:52:46 1999 + * Modified at: Thu Mar 11 01:37:20 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. @@ -77,6 +77,7 @@ #define UIRCC_CR12 0x0c /* Timer counter initial value (low byte) */ #define UIRCC_CR13 0x0d /* Timer counter initial value (high byte) */ +#define UIRCC_CR15 0x0f /* Status registers (read only) */ #define UIRCC_SR0 0x00 /* Transmit/receive status register */ @@ -102,9 +103,10 @@ #define UIRCC_SR9 0x09 /* System status 1 */ #define UIRCC_SR10 0x0a /* Modem select status */ - +#define UIRCC_SR11 0x0b #define UIRCC_SR12 0x0c /* Timer counter status (low byte) */ #define UIRCC_SR13 0x0d /* Timer counter status (high byte) */ +#define UIRCC_SR15 0x0f /* Private data for each instance */ struct uircc_cb { diff -u --recursive --new-file v2.2.5/linux/include/net/sock.h linux/include/net/sock.h --- v2.2.5/linux/include/net/sock.h Mon Mar 29 11:09:12 1999 +++ linux/include/net/sock.h Fri Apr 16 14:29:08 1999 @@ -81,6 +81,10 @@ #include #endif +#if defined(CONFIG_IRDA) || defined(CONFIG_IRDA_MODULE) +#include +#endif + #ifdef CONFIG_FILTER #include #endif @@ -490,6 +494,9 @@ #endif #if defined(CONFIG_ECONET) || defined(CONFIG_ECONET_MODULE) struct econet_opt *af_econet; +#endif +#if defined(CONFIG_IRDA) || defined(CONFIG_IRDA_MODULE) + struct irda_sock *irda; #endif } protinfo; diff -u --recursive --new-file v2.2.5/linux/include/scsi/sg.h linux/include/scsi/sg.h --- v2.2.5/linux/include/scsi/sg.h Tue Apr 14 14:29:26 1998 +++ linux/include/scsi/sg.h Fri Apr 16 11:59:28 1999 @@ -1,34 +1,157 @@ +#ifndef _SCSI_GENERIC_H +#define _SCSI_GENERIC_H + /* History: Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user - process control of SCSI devices. + process control of SCSI devices. Development Sponsored by Killy Corp. NY NY -*/ - -#ifndef _SCSI_GENERIC_H -#define _SCSI_GENERIC_H +Original driver (sg.h): +* Copyright (C) 1992 Lawrence Foard +2.x extensions to driver: +* Copyright (C) 1998, 1999 Douglas Gilbert + + + Version: 2.1.31 (990327) + This version for later 2.1.x series and 2.2.x kernels + D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au) + + Changes since 2.1.30 (990320) + - memory tweaks: change flags on kmalloc (GFP_KERNEL to GFP_ATOMIC) + - increase max allowable mid-level pool usage + Changes since 2.1.21 (990315) + - skipped to 2.1.30 indicating interface change (revert to 2.1.9) + - remove attempt to accomodate cdrecord 1.8, will fix app + - keep SG_?ET_RESERVED_SIZE naming for clarity + Changes since 2.1.20 (990313) + - ommission: left out logic for SG_?ET_ALT_INTERFACE, now added + Changes since 2.1.9 (990309) + - skipped to version 2.1.20 to indicate some interface changes + - incorporate sg changes to make cdrecord 1.8 work (had its + own patches that were different from the original) + - change SG_?ET_BUFF_SIZE to SG_?ET_RESERVED_SIZE for clarity + Changes since 2.1.8 (990303) + - debug ">9" option dumps debug for _all_ active sg devices + - increase allowable dma pool usage + increase minimum threshhold + - pad out sg_scsi_id structure + Changes since 2.1.7 (990227) + - command queuing now "non-default" [back. compat. with cdparanoia] + - Tighten access on some ioctls + + + New features and changes: + - per file descriptor (fd) write-read sequencing and command queues. + - command queuing supported (SG_MAX_QUEUE is maximum per fd). + - scatter-gather supported (allowing potentially megabyte transfers). + - the SCSI target, host and driver status are returned + in unused fields of sg_header (maintaining its original size). + - asynchronous notification support added (SIGPOLL, SIGIO) for + read()s ( write()s should never block). + - pack_id logic added so read() can be made to wait for a specific + pack_id. + - uses memory > ISA_DMA_THRESHOLD if adapter allows it (e.g. a + pci scsi adapter). + - this driver no longer uses a single SG_BIG_BUFF sized buffer + obtained at driver/module init time. Rather it obtains a + SG_SCATTER_SZ buffer when a fd is open()ed and frees it at + the corresponding release() (ie pr fd). Hence open() can return + ENOMEM! If write() request > SG_SCATTER_SZ bytes for data then + it can fail with ENOMEM as well (if so, scale back). + - adds several ioctl calls, see ioctl section below. + - SG_SCATTER_SZ's presence indicates this version of "sg" driver. + + Good documentation on the original "sg" device interface and usage can be + found in the Linux HOWTO document: "SCSI Programming HOWTO" by Heiko + Eissfeldt; last updated 7 May 1996. I will add more info on using the + extensions in this driver as required. A quick summary: + An SG device is accessed by writing SCSI commands plus any associated + outgoing data to it; the resulting status codes and any incoming data + are then obtained by a read call. The device can be opened O_NONBLOCK + (non-blocking) and poll() used to monitor its progress. The device may be + opened O_EXCL which excludes other "sg" users from this device (but not + "sd", "st" or "sr" users). The buffer given to the write() call is made + up as follows: + - struct sg_header image (see below) + - scsi command (6, 10 or 12 bytes long) + - data to be written to the device (if any) + + The buffer received from the corresponding read() call contains: + - struct sg_header image (check results + sense_buffer) + - data read back from device (if any) + + The given SCSI command has its LUN field overwritten internally by the + value associated with the device that has been opened. + + Memory (RAM) is used within this driver for direct memory access (DMA) + in transferring data to and from the SCSI device. The dreaded ENOMEM + seems to be more prevalent under early 2.2.x kernels than under the + 2.0.x kernel series. For a given (large) transfer the memory obtained by + this driver must be contiguous or scatter-gather must be used (if + supported by the adapter). [Furthermore, ISA SCSI adapters can only use + memory below the 16MB level on a i386.] + This driver tries hard to find some suitable memory before admitting + defeat and returning ENOMEM. All is not lost if application writers + then back off the amount they are requesting. The value returned by + the SG_GET_RESERVED_SIZE ioctl is guaranteed to be available (one + per fd). This driver does the following: + - attempts to reserve a SG_SCATTER_SZ sized buffer on open(). The + actual amount reserved is given by the SG_GET_RESERVED_SIZE ioctl(). + - each write() needs to reserve a DMA buffer of the size of the + data buffer indicated (excluding sg_header and command overhead). + This buffer, depending on its size, adapter type (ISA or not) and + the amount of memory available will be obtained from the kernel + directly (get_free_pages or kmalloc) or the from the scsi mid-level + dma pool (taking care not to exhaust it). + If the buffer requested is > SG_SCATTER_SZ or memory is tight then + scatter-gather will be used if supported by the adapter. + - write() will also attempt to use the buffer reserved on open() + if it is large enough. + The above strategy ensures that a write() can always depend on a buffer + of the size indicated by the SG_GET_RESERVED_SIZE ioctl() (which could be + 0, but at least the app knows things are tight in advance). + Hence application writers can adopt quite aggressive strategies (e.g. + requesting 512KB) and scale them back in the face of ENOMEM errors. + N.B. Queuing up commands also ties up kernel memory. -/* - An SG device is accessed by writing "packets" to it, the replies - are then read using the read call. The same header is used for - reply, just ignore reply_len field. + More documentation can be found at www.netwinder.org/~dougg */ +#define SG_MAX_SENSE 16 /* too little, unlikely to change in 2.2.x */ + struct sg_header - { - int pack_len; /* length of incoming packet <4096 (including header) */ - int reply_len; /* maximum length <4096 of expected reply */ - int pack_id; /* id number of packet */ - int result; /* 0==ok, otherwise refer to errno codes */ - unsigned int twelve_byte:1; /* Force 12 byte command length for group 6 & 7 commands */ - unsigned int other_flags:31; /* for future use */ - unsigned char sense_buffer[16]; /* used only by reads */ - /* command follows then data for command */ - }; - -/* ioctl's */ -#define SG_SET_TIMEOUT 0x2201 /* set timeout *(int *)arg==timeout */ -#define SG_GET_TIMEOUT 0x2202 /* get timeout return timeout */ +{ + int pack_len; /* [o] reply_len (ie useless), ignored as input */ + int reply_len; /* [i] max length of expected reply (inc. sg_header) */ + int pack_id; /* [io] id number of packet (use ints >= 0) */ + int result; /* [o] 0==ok, else (+ve) Unix errno code (e.g. EIO) */ + unsigned int twelve_byte:1; + /* [i] Force 12 byte command length for group 6 & 7 commands */ + unsigned int target_status:5; /* [o] scsi status from target */ + unsigned int host_status:8; /* [o] host status (see "DID" codes) */ + unsigned int driver_status:8; /* [o] driver status+suggestion */ + unsigned int other_flags:10; /* unused */ + unsigned char sense_buffer[SG_MAX_SENSE]; /* [o] Output in 3 cases: + when target_status is CHECK_CONDITION or + when target_status is COMMAND_TERMINATED or + when (driver_status & DRIVER_SENSE) is true. */ +}; /* This structure is 36 bytes long on i386 */ + + +typedef struct sg_scsi_id { + int host_no; /* as in "scsi" where 'n' is one of 0, 1, 2 etc */ + int channel; + int scsi_id; /* scsi id of target device */ + int lun; + int scsi_type; /* TYPE_... defined in scsi/scsi.h */ + int unused1; /* probably find a good use, set 0 for now */ + int unused2; /* ditto */ + int unused3; +} Sg_scsi_id; + +/* ioctls ( _GET_s yield result via 'int *' 3rd argument unless + otherwise indicated */ +#define SG_SET_TIMEOUT 0x2201 /* unit: jiffies, 10ms on i386 */ +#define SG_GET_TIMEOUT 0x2202 /* yield timeout as _return_ value */ #define SG_EMULATED_HOST 0x2203 /* true for emulated host adapter (ATAPI) */ @@ -36,12 +159,66 @@ #define SG_SET_TRANSFORM 0x2204 #define SG_GET_TRANSFORM 0x2205 -#define SG_DEFAULT_TIMEOUT (60*HZ) /* 1 minute timeout */ +#define SG_SET_RESERVED_SIZE 0x2275 /* currently ignored, future addition */ +/* Following yields buffer reserved by open(): 0 <= x <= SG_SCATTER_SZ */ +#define SG_GET_RESERVED_SIZE 0x2272 + +/* The following ioctl takes a 'Sg_scsi_id *' object as its 3rd argument. */ +#define SG_GET_SCSI_ID 0x2276 /* Yields fd's bus,chan,dev,lun+type */ +/* SCSI id information can also be obtained from SCSI_IOCTL_GET_IDLUN */ + +/* Override adapter setting and always DMA using low memory ( <16MB on i386). + Default is 0 (off - use adapter setting) */ +#define SG_SET_FORCE_LOW_DMA 0x2279 /* 0-> use adapter setting, 1-> force */ +#define SG_GET_LOW_DMA 0x227a /* 0-> use all ram for dma; 1-> low dma ram */ + +/* When SG_SET_FORCE_PACK_ID set to 1, pack_id is input to read() which + will attempt to read that pack_id or block (or return EAGAIN). If + pack_id is -1 then read oldest waiting. When ...FORCE_PACK_ID set to 0 + (default) then pack_id ignored by read() and oldest readable fetched. */ +#define SG_SET_FORCE_PACK_ID 0x227b +#define SG_GET_PACK_ID 0x227c /* Yields oldest readable pack_id (or -1) */ + +#define SG_GET_NUM_WAITING 0x227d /* Number of commands awaiting read() */ + +/* Turn on error sense trace (1..8), dump this device to log/console (9) + or dump all sg device states ( >9 ) to log/console */ +#define SG_SET_DEBUG 0x227e /* 0 -> turn off debug */ + +/* Yields max scatter gather tablesize allowed by current host adapter */ +#define SG_GET_SG_TABLESIZE 0x227F /* 0 implies can't do scatter gather */ + +/* Control whether sequencing per file descriptor (default) or per device */ +#define SG_GET_MERGE_FD 0x2274 /* 0-> per fd (default), 1-> per device */ +#define SG_SET_MERGE_FD 0x2273 /* Attempt to change sequencing state, + if more than 1 fd open on device, will fail with EBUSY */ + +/* Get/set command queuing state per fd (default is SG_DEF_COMMAND_Q) */ +#define SG_GET_COMMAND_Q 0x2270 /* Yields 0 (queuing off) or 1 (on) */ +#define SG_SET_COMMAND_Q 0x2271 /* Change queuing state with 0 or 1 */ + + +#define SG_DEFAULT_TIMEOUT (60*HZ) /* HZ == 'jiffies in 1 second' */ #define SG_DEFAULT_RETRIES 1 -#define SG_MAX_QUEUE 4 /* maximum outstanding request, arbitrary, may be - changed if sufficient DMA buffer room available */ +/* Default modes, commented if they differ from original sg driver */ +#define SG_DEF_COMMAND_Q 0 +#define SG_DEF_MERGE_FD 0 /* was 1 -> per device sequencing */ +#define SG_DEF_FORCE_LOW_DMA 0 /* was 1 -> memory below 16MB on i386 */ +#define SG_DEF_FORCE_PACK_ID 0 + +/* maximum outstanding requests, write() yields EDOM if exceeded */ +#define SG_MAX_QUEUE 16 + +#define SG_SCATTER_SZ (8 * 4096) /* PAGE_SIZE not available to user */ +/* Largest size (in bytes) a single scatter-gather list element can have. + The value must be a power of 2 and <= (PAGE_SIZE * 32) [131072 bytes on + i386]. The minimum value is PAGE_SIZE. If scatter-gather not supported + by adapter then this value is the largest data block that can be + read/written by a single scsi command. Max number of scatter-gather + list elements seems to be limited to 255. */ -#define SG_BIG_BUFF 32768 +#define SG_BIG_BUFF SG_SCATTER_SZ /* for backward compatibility */ +/* #define SG_BIG_BUFF (SG_SCATTER_SZ * 8) */ /* =256KB, if you want */ #endif diff -u --recursive --new-file v2.2.5/linux/init/main.c linux/init/main.c --- v2.2.5/linux/init/main.c Wed Mar 10 15:29:50 1999 +++ linux/init/main.c Mon Apr 12 09:51:03 1999 @@ -179,6 +179,7 @@ extern void AM53C974_setup(char *str, int *ints); extern void BusLogic_Setup(char *str, int *ints); extern void ncr53c8xx_setup(char *str, int *ints); +extern void sym53c8xx_setup(char *str, int *ints); extern void eata2x_setup(char *str, int *ints); extern void u14_34f_setup(char *str, int *ints); extern void fdomain_setup(char *str, int *ints); @@ -677,6 +678,9 @@ #endif #ifdef CONFIG_SCSI_NCR53C8XX { "ncr53c8xx=", ncr53c8xx_setup}, +#endif +#ifdef CONFIG_SCSI_SYM53C8XX + { "sym53c8xx=", sym53c8xx_setup}, #endif #ifdef CONFIG_SCSI_EATA { "eata=", eata2x_setup}, diff -u --recursive --new-file v2.2.5/linux/ipc/shm.c linux/ipc/shm.c --- v2.2.5/linux/ipc/shm.c Thu Dec 31 10:29:03 1998 +++ linux/ipc/shm.c Mon Apr 12 14:27:26 1999 @@ -24,7 +24,8 @@ static void killseg (int id); static void shm_open (struct vm_area_struct *shmd); static void shm_close (struct vm_area_struct *shmd); -static pte_t shm_swap_in(struct vm_area_struct *, unsigned long, unsigned long); +static unsigned long shm_nopage(struct vm_area_struct *, unsigned long, int); +static int shm_swapout(struct vm_area_struct *, struct page *); static int shm_tot = 0; /* total number of shared memory pages */ static int shm_rss = 0; /* number of shared memory pages that are in memory */ @@ -364,10 +365,10 @@ NULL, /* protect */ NULL, /* sync */ NULL, /* advise */ - NULL, /* nopage (done with swapin) */ + shm_nopage, /* nopage */ NULL, /* wppage */ - NULL, /* swapout (hardcoded right now) */ - shm_swap_in /* swapin */ + shm_swapout, /* swapout */ + NULL /* swapin */ }; /* Insert shmd into the list shp->attaches */ @@ -393,11 +394,7 @@ */ static int shm_map (struct vm_area_struct *shmd) { - pgd_t *page_dir; - pmd_t *page_middle; - pte_t *page_table; - unsigned long tmp, shm_sgn; - int error; + unsigned long tmp; /* clear old mappings */ do_munmap(shmd->vm_start, shmd->vm_end - shmd->vm_start); @@ -411,30 +408,7 @@ insert_vm_struct(current->mm, shmd); merge_segments(current->mm, shmd->vm_start, shmd->vm_end); - /* map page range */ - error = 0; - shm_sgn = shmd->vm_pte + - SWP_ENTRY(0, (shmd->vm_offset >> PAGE_SHIFT) << SHM_IDX_SHIFT); - flush_cache_range(shmd->vm_mm, shmd->vm_start, shmd->vm_end); - for (tmp = shmd->vm_start; - tmp < shmd->vm_end; - tmp += PAGE_SIZE, shm_sgn += SWP_ENTRY(0, 1 << SHM_IDX_SHIFT)) - { - page_dir = pgd_offset(shmd->vm_mm,tmp); - page_middle = pmd_alloc(page_dir,tmp); - if (!page_middle) { - error = -ENOMEM; - break; - } - page_table = pte_alloc(page_middle,tmp); - if (!page_table) { - error = -ENOMEM; - break; - } - set_pte(page_table, __pte(shm_sgn)); - } - flush_tlb_range(shmd->vm_mm, shmd->vm_start, shmd->vm_end); - return error; + return 0; } /* @@ -615,44 +589,46 @@ } /* + * Enter the shm page into the SHM data structures. + * + * The way "nopage" is done, we don't actually have to + * do anything here: nopage will have filled in the shm + * data structures already, and shm_swap_out() will just + * work off them.. + */ +static int shm_swapout(struct vm_area_struct * vma, struct page * page) +{ + return 0; +} + +/* * page not present ... go through shm_pages */ -static pte_t shm_swap_in(struct vm_area_struct * shmd, unsigned long offset, unsigned long code) +static unsigned long shm_nopage(struct vm_area_struct * shmd, unsigned long address, int no_share) { pte_t pte; struct shmid_kernel *shp; unsigned int id, idx; - id = SWP_OFFSET(code) & SHM_ID_MASK; + id = SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK; + idx = (address - shmd->vm_start + shmd->vm_offset) >> PAGE_SHIFT; + #ifdef DEBUG_SHM - if (id != (SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK)) { - printk ("shm_swap_in: code id = %d and shmd id = %ld differ\n", - id, SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK); - return BAD_PAGE; - } if (id > max_shmid) { - printk ("shm_swap_in: id=%d too big. proc mem corrupted\n", id); - return BAD_PAGE; + printk ("shm_nopage: id=%d too big. proc mem corrupted\n", id); + return 0; } #endif shp = shm_segs[id]; #ifdef DEBUG_SHM if (shp == IPC_UNUSED || shp == IPC_NOID) { - printk ("shm_swap_in: id=%d invalid. Race.\n", id); - return BAD_PAGE; - } -#endif - idx = (SWP_OFFSET(code) >> SHM_IDX_SHIFT) & SHM_IDX_MASK; -#ifdef DEBUG_SHM - if (idx != (offset >> PAGE_SHIFT)) { - printk ("shm_swap_in: code idx = %u and shmd idx = %lu differ\n", - idx, offset >> PAGE_SHIFT); - return BAD_PAGE; + printk ("shm_nopage: id=%d invalid. Race.\n", id); + return 0; } if (idx >= shp->shm_npages) { - printk ("shm_swap_in : too large page index. id=%d\n", id); - return BAD_PAGE; + printk ("shm_nopage : too large page index. id=%d\n", id); + return 0; } #endif @@ -661,7 +637,7 @@ unsigned long page = get_free_page(GFP_KERNEL); if (!page) { oom(current); - return BAD_PAGE; + return 0; } pte = __pte(shp->shm_pages[idx]); if (pte_present(pte)) { @@ -687,7 +663,7 @@ done: /* pte_val(pte) == shp->shm_pages[idx] */ current->min_flt++; atomic_inc(&mem_map[MAP_NR(pte_page(pte))].count); - return pte_modify(pte, shmd->vm_page_prot); + return pte_page(pte); } /* @@ -700,7 +676,6 @@ { pte_t page; struct shmid_kernel *shp; - struct vm_area_struct *shmd; unsigned long swap_nr; unsigned long id, idx; int loop = 0; @@ -742,61 +717,6 @@ swap_free (swap_nr); return 0; } - if (shp->attaches) - for (shmd = shp->attaches; ; ) { - do { - pgd_t *page_dir; - pmd_t *page_middle; - pte_t *page_table, pte; - unsigned long tmp; - - if ((SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK) != id) { - printk ("shm_swap: id=%ld does not match shmd->vm_pte.id=%ld\n", - id, SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK); - continue; - } - tmp = shmd->vm_start + (idx << PAGE_SHIFT) - shmd->vm_offset; - if (!(tmp >= shmd->vm_start && tmp < shmd->vm_end)) - continue; - page_dir = pgd_offset(shmd->vm_mm,tmp); - if (pgd_none(*page_dir) || pgd_bad(*page_dir)) { - printk("shm_swap: bad pgtbl! id=%ld start=%lx idx=%ld\n", - id, shmd->vm_start, idx); - pgd_clear(page_dir); - continue; - } - page_middle = pmd_offset(page_dir,tmp); - if (pmd_none(*page_middle) || pmd_bad(*page_middle)) { - printk("shm_swap: bad pgmid! id=%ld start=%lx idx=%ld\n", - id, shmd->vm_start, idx); - pmd_clear(page_middle); - continue; - } - page_table = pte_offset(page_middle,tmp); - pte = *page_table; - if (!pte_present(pte)) - continue; - if (pte_young(pte)) { - set_pte(page_table, pte_mkold(pte)); - continue; - } - if (pte_page(pte) != pte_page(page)) - printk("shm_swap_out: page and pte mismatch %lx %lx\n", - pte_page(pte),pte_page(page)); - flush_cache_page(shmd, tmp); - set_pte(page_table, - __pte(shmd->vm_pte + SWP_ENTRY(0, idx << SHM_IDX_SHIFT))); - atomic_dec(&mem_map[MAP_NR(pte_page(pte))].count); - if (shmd->vm_mm->rss > 0) - shmd->vm_mm->rss--; - flush_tlb_page(shmd, tmp); - /* continue looping through the linked list */ - } while (0); - shmd = shmd->vm_next_share; - if (!shmd) - break; - } - if (atomic_read(&mem_map[MAP_NR(pte_page(page))].count) != 1) goto check_table; shp->shm_pages[idx] = swap_nr; diff -u --recursive --new-file v2.2.5/linux/kernel/fork.c linux/kernel/fork.c --- v2.2.5/linux/kernel/fork.c Mon Mar 29 11:09:12 1999 +++ linux/kernel/fork.c Mon Apr 12 12:44:26 1999 @@ -93,6 +93,18 @@ return up; } +/* + * For SMP, we need to re-test the user struct counter + * after having aquired the spinlock. This allows us to do + * the common case (not freeing anything) without having + * any locking. + */ +#ifdef __SMP__ + #define uid_hash_free(up) (!atomic_read(&(up)->count)) +#else + #define uid_hash_free(up) (1) +#endif + void free_uid(struct task_struct *p) { struct user_struct *up = p->user; @@ -101,9 +113,11 @@ p->user = NULL; if (atomic_dec_and_test(&up->count)) { spin_lock(&uidhash_lock); - uid_hash_remove(up); + if (uid_hash_free(up)) { + uid_hash_remove(up); + kmem_cache_free(uid_cachep, up); + } spin_unlock(&uidhash_lock); - kmem_cache_free(uid_cachep, up); } } } diff -u --recursive --new-file v2.2.5/linux/mm/memory.c linux/mm/memory.c --- v2.2.5/linux/mm/memory.c Tue Jan 19 11:32:53 1999 +++ linux/mm/memory.c Mon Apr 12 16:18:26 1999 @@ -585,7 +585,8 @@ return 0; } if (!pte_none(*pte)) { - printk("put_dirty_page: page already exists\n"); + printk("put_dirty_page: pte %08lx already exists\n", + pte_val(*pte)); free_page(page); return 0; } diff -u --recursive --new-file v2.2.5/linux/mm/mmap.c linux/mm/mmap.c --- v2.2.5/linux/mm/mmap.c Wed Mar 10 15:29:50 1999 +++ linux/mm/mmap.c Mon Apr 12 21:35:15 1999 @@ -490,8 +490,8 @@ * allocate a new one, and the return indicates whether the old * area was reused. */ -static int unmap_fixup(struct vm_area_struct *area, unsigned long addr, - size_t len, struct vm_area_struct **extra) +static struct vm_area_struct * unmap_fixup(struct vm_area_struct *area, + unsigned long addr, size_t len, struct vm_area_struct *extra) { struct vm_area_struct *mpnt; unsigned long end = addr + len; @@ -506,7 +506,8 @@ area->vm_ops->close(area); if (area->vm_file) fput(area->vm_file); - return 0; + kmem_cache_free(vm_area_cachep, area); + return extra; } /* Work out to one of the ends. */ @@ -518,8 +519,8 @@ } else { /* Unmapping a hole: area->vm_start < addr <= end < area->vm_end */ /* Add end mapping -- leave beginning for below */ - mpnt = *extra; - *extra = NULL; + mpnt = extra; + extra = NULL; mpnt->vm_mm = area->vm_mm; mpnt->vm_start = end; @@ -539,7 +540,7 @@ } insert_vm_struct(current->mm, area); - return 1; + return extra; } /* @@ -566,8 +567,8 @@ if (!prev) goto no_mmaps; if (prev->vm_end > start) { - if (last > prev->vm_end) - last = prev->vm_end; + if (last > prev->vm_start) + last = prev->vm_start; goto no_mmaps; } } @@ -674,8 +675,7 @@ /* * Fix the mapping, and free the old area if it wasn't reused. */ - if (!unmap_fixup(mpnt, st, size, &extra)) - kmem_cache_free(vm_area_cachep, mpnt); + extra = unmap_fixup(mpnt, st, size, extra); } /* Release the extra vma struct if it wasn't used */ diff -u --recursive --new-file v2.2.5/linux/net/README linux/net/README --- v2.2.5/linux/net/README Sun Jun 7 11:16:40 1998 +++ linux/net/README Mon Apr 12 16:18:27 1999 @@ -16,7 +16,7 @@ lapb g4klx@g4klx.demon.co.uk netrom g4klx@g4klx.demon.co.uk rose g4klx@g4klx.demon.co.uk -wanrouter genek@compuserve.com and dm@sangoma.com +wanrouter gene@compuserve.com, jaspreet@sangoma and dm@sangoma.com unix alan@lxorguk.ukuu.org.uk x25 g4klx@g4klx.demon.co.uk diff -u --recursive --new-file v2.2.5/linux/net/appletalk/aarp.c linux/net/appletalk/aarp.c --- v2.2.5/linux/net/appletalk/aarp.c Mon Dec 28 15:00:53 1998 +++ linux/net/appletalk/aarp.c Mon Apr 12 16:18:26 1999 @@ -128,6 +128,8 @@ skb_reserve(skb,dev->hard_header_len+aarp_dl->header_length); eah = (struct elapaarp *)skb_put(skb,sizeof(struct elapaarp)); + skb->protocol = htons(ETH_P_ATALK); + skb->nh.raw = skb->h.raw = (void *) eah; skb->dev = dev; /* @@ -186,6 +188,8 @@ skb_reserve(skb,dev->hard_header_len+aarp_dl->header_length); eah = (struct elapaarp *)skb_put(skb,sizeof(struct elapaarp)); + skb->protocol = htons(ETH_P_ATALK); + skb->nh.raw = skb->h.raw = (void *) eah; skb->dev = dev; /* @@ -246,7 +250,8 @@ skb_reserve(skb,dev->hard_header_len+aarp_dl->header_length); eah = (struct elapaarp *)skb_put(skb,sizeof(struct elapaarp)); - + skb->protocol = htons(ETH_P_ATALK); + skb->nh.raw = skb->h.raw = (void *) eah; skb->dev = dev; /* @@ -365,12 +370,10 @@ aarp_expire_timer(&unresolved[ct]); aarp_expire_timer(&proxies[ct]); } - del_timer(&aarp_timer); - if(unresolved_count==0) - aarp_timer.expires=jiffies+sysctl_aarp_expiry_time; - else - aarp_timer.expires=jiffies+sysctl_aarp_tick_time; - add_timer(&aarp_timer); + + mod_timer(&aarp_timer, jiffies + + (unresolved_count ? sysctl_aarp_tick_time: + sysctl_aarp_expiry_time)); } /* @@ -750,9 +753,7 @@ if(unresolved_count==1) { - del_timer(&aarp_timer); - aarp_timer.expires=jiffies+sysctl_aarp_tick_time; - add_timer(&aarp_timer); + mod_timer(&aarp_timer, jiffies + sysctl_aarp_tick_time); } /* @@ -939,9 +940,8 @@ aarp_resolved(&unresolved[hash],a,hash); if(unresolved_count==0) { - del_timer(&aarp_timer); - aarp_timer.expires=jiffies+sysctl_aarp_expiry_time; - add_timer(&aarp_timer); + mod_timer(&aarp_timer, jiffies + + sysctl_aarp_expiry_time); } break; diff -u --recursive --new-file v2.2.5/linux/net/ipv6/tcp_ipv6.c linux/net/ipv6/tcp_ipv6.c --- v2.2.5/linux/net/ipv6/tcp_ipv6.c Mon Mar 29 11:09:12 1999 +++ linux/net/ipv6/tcp_ipv6.c Fri Apr 16 08:20:23 1999 @@ -18,6 +18,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include diff -u --recursive --new-file v2.2.5/linux/net/irda/Config.in linux/net/irda/Config.in --- v2.2.5/linux/net/irda/Config.in Wed Jan 20 23:14:07 1999 +++ linux/net/irda/Config.in Thu Apr 15 05:42:42 1999 @@ -12,7 +12,6 @@ if [ "$CONFIG_IRDA" != "n" ] ; then comment 'IrDA protocols' source net/irda/irlan/Config.in - source net/irda/irobex/Config.in source net/irda/ircomm/Config.in source net/irda/irlpt/Config.in @@ -21,7 +20,6 @@ comment ' IrDA options' bool ' Cache last LSAP' CONFIG_IRDA_CACHE_LAST_LSAP bool ' Fast RRs' CONFIG_IRDA_FAST_RR - bool ' Recycle RRs' CONFIG_IRDA_RECYCLE_RR bool ' Debug information' CONFIG_IRDA_DEBUG fi fi diff -u --recursive --new-file v2.2.5/linux/net/irda/Makefile linux/net/irda/Makefile --- v2.2.5/linux/net/irda/Makefile Wed Mar 10 15:29:52 1999 +++ linux/net/irda/Makefile Thu Apr 15 05:42:42 1999 @@ -15,7 +15,8 @@ O_TARGET := irda.o O_OBJS := iriap.o iriap_event.o irlmp.o irlmp_event.o irlmp_frame.o \ irlap.o irlap_event.o irlap_frame.o timer.o qos.o irqueue.o \ - irttp.o irda_device.o irias_object.o crc.o wrapper.o af_irda.o + irttp.o irda_device.o irias_object.o crc.o wrapper.o af_irda.o \ + discovery.o OX_OBJS := irmod.o MOD_LIST_NAME := IRDA_MODULES @@ -51,15 +52,6 @@ else ifeq ($(CONFIG_IRLPT),m) MOD_IN_SUB_DIRS += irlpt - endif -endif - -ifeq ($(CONFIG_IROBEX),y) -SUB_DIRS += irobex -O_OBJS += irobex/irobex.o -else - ifeq ($(CONFIG_IROBEX),m) - MOD_SUB_DIRS += irobex endif endif diff -u --recursive --new-file v2.2.5/linux/net/irda/af_irda.c linux/net/irda/af_irda.c --- v2.2.5/linux/net/irda/af_irda.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/af_irda.c Fri Apr 16 08:20:23 1999 @@ -1,16 +1,16 @@ /********************************************************************* * * Filename: af_irda.c - * Version: 0.1 + * Version: 0.6 * Description: IrDA sockets implementation * Status: Experimental. * Author: Dag Brattli * Created at: Sun May 31 10:12:43 1998 - * Modified at: Sat Feb 20 01:31:15 1999 + * Modified at: Wed Apr 7 17:32:27 1999 * Modified by: Dag Brattli - * Sources: af_netroom.c, af_ax25.x + * Sources: af_netroom.c, af_ax25.c, af_rose.c, af_x25.c etc. * - * Copyright (c) 1997 Dag Brattli, All Rights Reserved. + * Copyright (c) 1999 Dag Brattli, 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 @@ -23,44 +23,365 @@ * ********************************************************************/ -#include #include #include #include #include #include #include +#include #include #include #include -#include +#include +#include #include -extern int irda_init(void); +extern int irda_init(void); extern void irda_cleanup(void); -extern int irlap_input(struct sk_buff *, struct device *, struct packet_type *); +extern int irlap_driver_rcv(struct sk_buff *, struct device *, + struct packet_type *); static struct proto_ops irda_proto_ops; +static hashbin_t *cachelog = NULL; +static struct wait_queue *discovery_wait; /* Wait for discovery */ #define IRDA_MAX_HEADER (TTP_HEADER+LMP_HEADER+LAP_HEADER) -#define IRDA_SOCKETS +/* + * Function irda_data_indication (instance, sap, skb) + * + * Received some data from TinyTP. Just queue it on the receive queue + * + */ +static int irda_data_indication(void *instance, void *sap, struct sk_buff *skb) +{ + struct irda_sock *self; + struct sock *sk; + int err; + + DEBUG(1, __FUNCTION__ "()\n"); + + self = (struct irda_sock *) instance; + ASSERT(self != NULL, return -1;); + + sk = self->sk; + ASSERT(sk != NULL, return -1;); + + err = sock_queue_rcv_skb(sk, skb); + if (err) { + DEBUG(1, __FUNCTION__ "(), error: no more mem!\n"); + self->rx_flow = FLOW_STOP; + + /* When we return error, TTP will need to requeue the skb */ + return err; + } + + return 0; +} + +/* + * Function irda_disconnect_indication (instance, sap, reason, skb) + * + * Connection has been closed. Chech reason to find out why + * + */ +static void irda_disconnect_indication(void *instance, void *sap, + LM_REASON reason, struct sk_buff *skb) +{ + struct irda_sock *self; + struct sock *sk; + + DEBUG(1, __FUNCTION__ "()\n"); + + self = (struct irda_sock *) instance; + + sk = self->sk; + if (sk == NULL) + return; + + sk->state = TCP_CLOSE; + sk->err = reason; + sk->shutdown |= SEND_SHUTDOWN; + if (!sk->dead) { + sk->state_change(sk); + sk->dead = 1; + } +} + +/* + * Function irda_connect_confirm (instance, sap, qos, max_sdu_size, skb) + * + * Connections has been confirmed by the remote device + * + */ +static void irda_connect_confirm(void *instance, void *sap, + struct qos_info *qos, + __u32 max_sdu_size, struct sk_buff *skb) +{ + struct irda_sock *self; + struct sock *sk; + + DEBUG(1, __FUNCTION__ "()\n"); + + self = (struct irda_sock *) instance; + + self->max_sdu_size_tx = max_sdu_size; + memcpy(&self->qos_tx, qos, sizeof(struct qos_info)); + + sk = self->sk; + if (sk == NULL) + return; + + /* We are now connected! */ + sk->state = TCP_ESTABLISHED; + sk->state_change(sk); +} + +/* + * Function irda_connect_indication(instance, sap, qos, max_sdu_size, userdata) + * + * Incomming connection + * + */ +static void irda_connect_indication(void *instance, void *sap, + struct qos_info *qos, __u32 max_sdu_size, + struct sk_buff *skb) +{ + struct irda_sock *self; + struct sock *sk; + + DEBUG(1, __FUNCTION__ "()\n"); + + self = (struct irda_sock *) instance; + + self->max_sdu_size_tx = max_sdu_size; + memcpy(&self->qos_tx, qos, sizeof(struct qos_info)); + + sk = self->sk; + if (sk == NULL) + return; + + skb_queue_tail(&sk->receive_queue, skb); + + sk->state_change(sk); +} + +/* + * Function irda_connect_response (handle) + * + * Accept incomming connection + * + */ +void irda_connect_response(struct irda_sock *self) +{ + struct sk_buff *skb; + + DEBUG(1, __FUNCTION__ "()\n"); + + ASSERT(self != NULL, return;); + + skb = dev_alloc_skb(64); + if (skb == NULL) { + DEBUG( 0, __FUNCTION__ "() Could not allocate sk_buff!\n"); + return; + } + + /* Reserve space for MUX_CONTROL and LAP header */ + skb_reserve(skb, TTP_HEADER+LMP_CONTROL_HEADER+LAP_HEADER); + + irttp_connect_response(self->tsap, self->max_sdu_size_rx, skb); +} + + +/* + * Function irda_flow_indication (instance, sap, flow) + * + * Used by TinyTP to tell us if it can accept more data or not + * + */ +static void irda_flow_indication(void *instance, void *sap, LOCAL_FLOW flow) +{ + struct irda_sock *self; + struct sock *sk; + + DEBUG(1, __FUNCTION__ "()\n"); + + self = (struct irda_sock *) instance; + ASSERT(self != NULL, return;); + + sk = self->sk; + ASSERT(sk != NULL, return;); + + switch (flow) { + case FLOW_STOP: + DEBUG( 0, __FUNCTION__ "(), IrTTP wants us to slow down\n"); + self->tx_flow = flow; + break; + case FLOW_START: + self->tx_flow = flow; + DEBUG(0, __FUNCTION__ "(), IrTTP wants us to start again\n"); + wake_up_interruptible(sk->sleep); + break; + default: + DEBUG( 0, __FUNCTION__ "(), Unknown flow command!\n"); + } +} + +/* + * Function irda_get_value_confirm (obj_id, value, priv) + * + * Got answer from remote LM-IAS + * + */ +static void irda_get_value_confirm(__u16 obj_id, struct ias_value *value, + void *priv) +{ + struct irda_sock *self; + + DEBUG(1, __FUNCTION__ "()\n"); + + ASSERT(priv != NULL, return;); + self = (struct irda_sock *) priv; + + if (!self) + return; + + /* Check if request succeeded */ + if (!value) { + DEBUG(0, __FUNCTION__ "(), IAS query failed!\n"); + + /* Wake up any processes waiting for result */ + wake_up_interruptible(&self->ias_wait); + return; + } + + switch (value->type) { + case IAS_INTEGER: + DEBUG(4, __FUNCTION__ "() int=%d\n", value->t.integer); + + if (value->t.integer != -1) { + self->dtsap_sel = value->t.integer; + } else + self->dtsap_sel = 0; + break; + default: + DEBUG(0, __FUNCTION__ "(), bad type!\n"); + break; + } + /* Wake up any processes waiting for result */ + wake_up_interruptible(&self->ias_wait); +} + +/* + * Function irda_discovery_indication (log) + * + * Got a discovery log from IrLMP, wake ut any process waiting for answer + * + */ +static void irda_discovery_indication(hashbin_t *log) +{ + DEBUG(1, __FUNCTION__ "()\n"); + + cachelog = log; + + /* Wake up process if its waiting for device to be discovered */ + wake_up_interruptible(&discovery_wait); +} + +/* + * Function irda_open_tsap (self) + * + * Open local Transport Service Access Point (TSAP) + * + */ +static int irda_open_tsap(struct irda_sock *self, __u8 tsap_sel, char *name) +{ + struct notify_t notify; + + DEBUG(1, __FUNCTION__ "()\n"); + + /* Initialize callbacks to be used by the IrDA stack */ + irda_notify_init(¬ify); + notify.connect_confirm = irda_connect_confirm; + notify.connect_indication = irda_connect_indication; + notify.disconnect_indication = irda_disconnect_indication; + notify.data_indication = irda_data_indication; + notify.flow_indication = irda_flow_indication; + notify.instance = self; + strncpy(notify.name, name, NOTIFY_MAX_NAME); + + self->tsap = irttp_open_tsap(tsap_sel, DEFAULT_INITIAL_CREDIT, + ¬ify); + if (self->tsap == NULL) { + DEBUG( 0, __FUNCTION__ "(), Unable to allocate TSAP!\n"); + return -1; + } + /* Remember which TSAP selector we actually got */ + self->stsap_sel = self->tsap->stsap_sel; -#ifdef IRDA_SOCKETS + return 0; +} + +/* + * Function irda_find_lsap_sel (self, name) + * + * Try to lookup LSAP selector in remote LM-IAS + * + */ +static int irda_find_lsap_sel(struct irda_sock *self, char *name) +{ + DEBUG(1, __FUNCTION__ "()\n"); + + ASSERT(self != NULL, return -1;); + + /* Query remote LM-IAS */ + iriap_getvaluebyclass_request(name, "IrDA:TinyTP:LsapSel", + self->saddr, self->daddr, + irda_get_value_confirm, self); + /* Wait for answer */ + interruptible_sleep_on(&self->ias_wait); + + if (self->dtsap_sel) + return 0; + + return -ENETUNREACH; /* May not be true */ +} /* * Function irda_getname (sock, uaddr, uaddr_len, peer) * - * + * Return the our own, or peers socket address (sockaddr_irda) * */ -static int irda_getname( struct socket *sock, struct sockaddr *uaddr, - int *uaddr_len, int peer) +static int irda_getname(struct socket *sock, struct sockaddr *uaddr, + int *uaddr_len, int peer) { - DEBUG( 0, __FUNCTION__ "(), Not implemented!\n"); + struct sockaddr_irda saddr; + struct sock *sk = sock->sk; + + if (peer) { + if (sk->state != TCP_ESTABLISHED) + return -ENOTCONN; + + saddr.sir_family = AF_IRDA; + saddr.sir_lsap_sel = sk->protinfo.irda->dtsap_sel; + saddr.sir_addr = sk->protinfo.irda->daddr; + } else { + saddr.sir_family = AF_IRDA; + saddr.sir_lsap_sel = sk->protinfo.irda->stsap_sel; + saddr.sir_addr = sk->protinfo.irda->saddr; + } + + DEBUG(1, __FUNCTION__ "(), tsap_sel = %#x\n", saddr.sir_lsap_sel); + DEBUG(1, __FUNCTION__ "(), addr = %08x\n", saddr.sir_addr); + + if (*uaddr_len > sizeof (struct sockaddr_irda)) + *uaddr_len = sizeof (struct sockaddr_irda); + memcpy(uaddr, &saddr, *uaddr_len); return 0; } @@ -68,22 +389,148 @@ /* * Function irda_listen (sock, backlog) * - * + * Just move to the listen state * */ static int irda_listen( struct socket *sock, int backlog) { struct sock *sk = sock->sk; - if (sk->type == SOCK_SEQPACKET && sk->state != TCP_LISTEN) { + DEBUG(1, __FUNCTION__ "()\n"); + + if (sk->type == SOCK_STREAM && sk->state != TCP_LISTEN) { sk->max_ack_backlog = backlog; sk->state = TCP_LISTEN; + return 0; } - + return -EOPNOTSUPP; } +/* + * Function irda_bind (sock, uaddr, addr_len) + * + * Used by servers to register their well known TSAP + * + */ +static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) +{ + struct sock *sk = sock->sk; + struct sockaddr_irda *addr = (struct sockaddr_irda *) uaddr; + struct irda_sock *self; + __u16 hints = 0; + int err; + + DEBUG(1, __FUNCTION__ "()\n"); + + self = sk->protinfo.irda; + ASSERT(self != NULL, return -1;); + + if ((addr_len < sizeof(struct sockaddr_irda)) || + (addr_len > sizeof(struct sockaddr_irda))) + return -EINVAL; + + err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name); + if (err < 0) + return -ENOMEM; + + /* Register with LM-IAS */ + self->ias_obj = irias_new_object(addr->sir_name, jiffies); + irias_add_integer_attrib(self->ias_obj, "IrDA:TinyTP:LsapSel", + self->stsap_sel); + irias_insert_object(self->ias_obj); + + /* Fill in some default hint bits values */ + if (strncmp(addr->sir_name, "OBEX", 4) == 0) + hints = irlmp_service_to_hint(S_OBEX); + + if (hints) + self->skey = irlmp_register_service(hints); + + return 0; +} + +/* + * Function irda_accept (sock, newsock, flags) + * + * Wait for incomming connection + * + */ +static int irda_accept(struct socket *sock, struct socket *newsock, int flags) +{ + struct irda_sock *self, *new; + struct sock *sk = sock->sk; + struct sock *newsk; + struct sk_buff *skb; + + self = sk->protinfo.irda; + ASSERT(self != NULL, return -1;); + + if (sock->state != SS_UNCONNECTED) + return -EINVAL; + + if ((sk = sock->sk) == NULL) + return -EINVAL; + + if (sk->type != SOCK_STREAM) + return -EOPNOTSUPP; + + if (sk->state != TCP_LISTEN) + return -EINVAL; + + /* + * The read queue this time is holding sockets ready to use + * hooked into the SABM we saved + */ + do { + if ((skb = skb_dequeue(&sk->receive_queue)) == NULL) { + if (flags & O_NONBLOCK) + return -EWOULDBLOCK; + + interruptible_sleep_on(sk->sleep); + if (signal_pending(current)) + return -ERESTARTSYS; + } + } while (skb == NULL); + + newsk = newsock->sk; + newsk->state = TCP_ESTABLISHED; + + new = newsk->protinfo.irda; + ASSERT(new != NULL, return -1;); + + /* Now attach up the new socket */ + new->tsap = irttp_dup(self->tsap, new); + if (!new->tsap) { + DEBUG(0, __FUNCTION__ "(), dup failed!\n"); + return -1; + } + + new->stsap_sel = new->tsap->stsap_sel; + new->dtsap_sel = new->tsap->dtsap_sel; + new->saddr = irttp_get_saddr(new->tsap); + new->saddr = irttp_get_saddr(new->tsap); + + new->max_sdu_size_tx = self->max_sdu_size_tx; + new->max_sdu_size_rx = self->max_sdu_size_rx; + memcpy(&new->qos_tx, &self->qos_tx, sizeof(struct qos_info)); + + /* Clean up the original one to keep it in listen state */ + self->tsap->dtsap_sel = self->tsap->lsap->dlsap_sel = LSAP_ANY; + self->tsap->lsap->lsap_state = LSAP_DISCONNECTED; + + skb->sk = NULL; + skb->destructor = NULL; + kfree_skb(skb); + sk->ack_backlog--; + + newsock->state = SS_CONNECTED; + + irda_connect_response(new); + + return 0; +} /* * Function irda_connect (sock, uaddr, addr_len, flags) @@ -91,17 +538,18 @@ * Connect to a IrDA device * */ -static int irda_connect( struct socket *sock, struct sockaddr *uaddr, - int addr_len, int flags) +static int irda_connect(struct socket *sock, struct sockaddr *uaddr, + int addr_len, int flags) { -#if 0 - struct sock *sk = (struct sock *)sock->data; - struct sockaddr_irda *addr = (struct sockaddr_irda *)uaddr; - irda_address *user, *source = NULL; - struct device *dev; + struct sock *sk = sock->sk; + struct sockaddr_irda *addr = (struct sockaddr_irda *) uaddr; + struct irda_sock *self; + int err; + + self = sk->protinfo.irda; + + DEBUG(1, __FUNCTION__ "()\n"); - DEBUG( 0, __FUNCTION__ "()\n"); - if (sk->state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) { sock->state = SS_CONNECTED; return 0; /* Connect completed during a ERESTARTSYS event */ @@ -121,6 +569,36 @@ if (addr_len != sizeof(struct sockaddr_irda)) return -EINVAL; + /* Check if user supplied the required destination device address */ + if (!addr->sir_addr) + return -EINVAL; + + self->daddr = addr->sir_addr; + DEBUG(1, __FUNCTION__ "(), daddr = %08x\n", self->daddr); + + /* Query remote LM-IAS */ + err = irda_find_lsap_sel(self, addr->sir_name); + if (err) { + DEBUG(0, __FUNCTION__ "(), connect failed!\n"); + return err; + } + + /* Check if we have opened a local TSAP */ + if (!self->tsap) + irda_open_tsap(self, LSAP_ANY, addr->sir_name); + + /* Move to connecting socket, start sending Connect Requests */ + sock->state = SS_CONNECTING; + sk->state = TCP_SYN_SENT; + + /* Connect to remote device */ + err = irttp_connect_request(self->tsap, self->dtsap_sel, + self->saddr, self->daddr, NULL, + self->max_sdu_size_rx, NULL); + if (err) { + DEBUG(0, __FUNCTION__ "(), connect failed!\n"); + return err; + } /* Now the loop */ if (sk->state != TCP_ESTABLISHED && (flags & O_NONBLOCK)) @@ -130,9 +608,9 @@ /* A Connect Ack with Choke or timeout or failed routing will go to * closed. */ - while ( sk->state == TCP_SYN_SENT) { - interruptible_sleep_on( sk->sleep); - if (current->signal & ~current->blocked) { + while (sk->state == TCP_SYN_SENT) { + interruptible_sleep_on(sk->sleep); + if (signal_pending(current)) { sti(); return -ERESTARTSYS; } @@ -141,13 +619,13 @@ if (sk->state != TCP_ESTABLISHED) { sti(); sock->state = SS_UNCONNECTED; - return sock_error( sk); /* Always set at this point */ + return sock_error(sk); /* Always set at this point */ } sock->state = SS_CONNECTED; - + sti(); -#endif + return 0; } @@ -160,51 +638,79 @@ static int irda_create(struct socket *sock, int protocol) { struct sock *sk; + struct irda_sock *self; - DEBUG( 0, __FUNCTION__ "()\n"); - - /* Compatibility */ - if (sock->type == SOCK_PACKET) { - static int warned; - if (net_families[PF_PACKET]==NULL) - { -#if defined(CONFIG_KMOD) && defined(CONFIG_PACKET_MODULE) - char module_name[30]; - sprintf(module_name,"net-pf-%d", PF_PACKET); - request_module(module_name); - if (net_families[PF_PACKET] == NULL) -#endif - return -ESOCKTNOSUPPORT; - } - if (!warned++) - printk(KERN_INFO "%s uses obsolete (PF_INET,SOCK_PACKET)\n", current->comm); - return net_families[PF_PACKET]->create(sock, protocol); - } + DEBUG(2, __FUNCTION__ "()\n"); -/* if (sock->type != SOCK_SEQPACKET || protocol != 0) */ -/* return -ESOCKTNOSUPPORT; */ + /* Check for valid socket type */ + switch (sock->type) { + case SOCK_STREAM: /* FALLTHROUGH */ + case SOCK_SEQPACKET: + break; + default: + return -ESOCKTNOSUPPORT; + } /* Allocate socket */ if ((sk = sk_alloc(PF_IRDA, GFP_ATOMIC, 1)) == NULL) return -ENOMEM; + self = kmalloc(sizeof(struct irda_sock), GFP_ATOMIC); + if (self == NULL) + return -ENOMEM; + memset(self, 0, sizeof(struct irda_sock)); + + self->sk = sk; + sk->protinfo.irda = self; + sock_init_data(sock, sk); sock->ops = &irda_proto_ops; sk->protocol = protocol; + /* Register as a client with IrLMP */ + self->ckey = irlmp_register_client(0, NULL, NULL); + self->mask = 0xffff; + self->rx_flow = self->tx_flow = FLOW_START; + self->max_sdu_size_rx = SAR_DISABLE; /* Default value */ + self->nslots = 6; /* Default for now */ + + /* Notify that we are using the irda module, so nobody removes it */ + irda_mod_inc_use_count(); + return 0; } /* - * Function irda_destroy_socket (tsap) + * Function irda_destroy_socket (self) * * Destroy socket * */ -void irda_destroy_socket(struct tsap_cb *tsap) +void irda_destroy_socket(struct irda_sock *self) { - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(2, __FUNCTION__ "()\n"); + + ASSERT(self != NULL, return;); + + /* Unregister with IrLMP */ + irlmp_unregister_client(self->ckey); + irlmp_unregister_service(self->skey); + + /* Unregister with LM-IAS */ + if (self->ias_obj) + irias_delete_object(self->ias_obj->name); + + if (self->tsap) { + irttp_disconnect_request(self->tsap, NULL, P_NORMAL); + irttp_close_tsap(self->tsap); + self->tsap = NULL; + } + + kfree(self); + + /* Notify that we are not using the irda module anymore */ + irda_mod_dec_use_count(); return; } @@ -215,41 +721,108 @@ * * */ -static int irda_release( struct socket *sock, struct socket *peer) +static int irda_release(struct socket *sock, struct socket *peer) { -#if 0 - struct sock *sk = (struct sock *)sock->data; + struct sock *sk = sock->sk; - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(1, __FUNCTION__ "()\n"); - - if (sk == NULL) return 0; + if (sk == NULL) + return 0; - if (sk->type == SOCK_SEQPACKET) { + sk->state = TCP_CLOSE; + sk->shutdown |= SEND_SHUTDOWN; + sk->state_change(sk); + sk->dead = 1; - - } else { - sk->state = TCP_CLOSE; - sk->shutdown |= SEND_SHUTDOWN; - sk->state_change(sk); - sk->dead = 1; - irda_destroy_socket( sk->protinfo.irda); - } + irda_destroy_socket(sk->protinfo.irda); + + sock->sk = NULL; + sk->socket = NULL; /* Not used, but we should do this. */ - sock->data = NULL; - sk->socket = NULL; /* Not used, but we should do this. **/ -#endif return 0; } +/* + * Function irda_sendmsg (sock, msg, len, scm) + * + * Send message down to TinyTP + * + */ +static int irda_sendmsg(struct socket *sock, struct msghdr *msg, int len, + struct scm_cookie *scm) +{ + struct sock *sk = sock->sk; +/* struct sockaddr_irda *addr = (struct sockaddr_irda *) msg->msg_name; */ + struct irda_sock *self; + struct sk_buff *skb; + unsigned char *asmptr; + int err; + + DEBUG(4, __FUNCTION__ "(), len=%d\n", len); + + if (msg->msg_flags & ~MSG_DONTWAIT) + return -EINVAL; + + if (sk->shutdown & SEND_SHUTDOWN) { + send_sig(SIGPIPE, current, 0); + return -EPIPE; + } + + self = sk->protinfo.irda; + ASSERT(self != NULL, return -1;); + + /* Check if IrTTP is wants us to slow down */ + while (self->tx_flow == FLOW_STOP) { + DEBUG(2, __FUNCTION__ "(), IrTTP is busy, going to sleep!\n"); + interruptible_sleep_on(sk->sleep); + + /* Check if we are still connected */ + if (sk->state != TCP_ESTABLISHED) + return -ENOTCONN; + } + + skb = sock_alloc_send_skb(sk, len + IRDA_MAX_HEADER, 0, + msg->msg_flags & MSG_DONTWAIT, &err); + if (!skb) + return -ENOBUFS; + + skb_reserve(skb, IRDA_MAX_HEADER); + + DEBUG(4, __FUNCTION__ "(), appending user data\n"); + asmptr = skb->h.raw = skb_put(skb, len); + memcpy_fromiovec(asmptr, msg->msg_iov, len); + + /* + * Just send the message to TinyTP, and let it deal with possible + * errors. No need to duplicate all that here + */ + err = irttp_data_request(self->tsap, skb); + if (err) { + DEBUG(0, __FUNCTION__ "(), err=%d\n", err); + return err; + } + return len; +} + +/* + * Function irda_recvmsg (sock, msg, size, flags, scm) + * + * Try to receive message and copy it to user + * + */ static int irda_recvmsg(struct socket *sock, struct msghdr *msg, int size, int flags, struct scm_cookie *scm) { + struct irda_sock *self; struct sock *sk = sock->sk; struct sk_buff *skb; int copied, err; - DEBUG(0, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); + + self = sk->protinfo.irda; + ASSERT(self != NULL, return -1;); skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, flags & MSG_DONTWAIT, &err); @@ -267,6 +840,20 @@ skb_free_datagram(sk, skb); + /* + * Check if we have previously stopped IrTTP and we know + * have more free space in our rx_queue. If so tell IrTTP + * to start delivering frames again before our rx_queue gets + * empty + */ + if (self->rx_flow == FLOW_STOP) { + if ((atomic_read(&sk->rmem_alloc) << 2) <= sk->rcvbuf) { + DEBUG(2, __FUNCTION__ "(), Starting IrTTP\n"); + self->rx_flow = FLOW_START; + irttp_flow_request(self->tsap, FLOW_START); + } + } + return copied; } @@ -279,10 +866,11 @@ } -unsigned int irda_poll( struct file *file, struct socket *sock, - struct poll_table_struct *wait) +unsigned int irda_poll(struct file *file, struct socket *sock, + struct poll_table_struct *wait) { DEBUG(0, __FUNCTION__ "()\n"); + return 0; } @@ -296,7 +884,7 @@ { struct sock *sk = sock->sk; - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(0, __FUNCTION__ "(), cmd=%#x\n", cmd); switch (cmd) { case TIOCOUTQ: { @@ -343,13 +931,163 @@ return -EINVAL; default: - return dev_ioctl(cmd, (void *)arg); + return dev_ioctl(cmd, (void *) arg); } /*NOTREACHED*/ return 0; } +/* + * Function irda_setsockopt (sock, level, optname, optval, optlen) + * + * Set some options for the socket + * + */ +static int irda_setsockopt(struct socket *sock, int level, int optname, + char *optval, int optlen) +{ + struct sock *sk = sock->sk; + struct irda_sock *self; + int opt; + + DEBUG(0, __FUNCTION__ "()\n"); + + self = sk->protinfo.irda; + ASSERT(self != NULL, return -1;); + + if (level != SOL_IRLMP) + return -ENOPROTOOPT; + + if (optlen < sizeof(int)) + return -EINVAL; + + if (get_user(opt, (int *)optval)) + return -EFAULT; + + switch (optname) { + case IRLMP_IAS_SET: + DEBUG(0, __FUNCTION__ "(), sorry not impl. yet!\n"); + return 0; + case IRTTP_MAX_SDU_SIZE: + DEBUG(0, __FUNCTION__ "(), setting max_sdu_size = %d\n", opt); + self->max_sdu_size_rx = opt; + break; + default: + return -ENOPROTOOPT; + } + return 0; +} + +/* + * Function irda_getsockopt (sock, level, optname, optval, optlen) + * + * + * + */ +static int irda_getsockopt(struct socket *sock, int level, int optname, + char *optval, int *optlen) +{ + struct sock *sk = sock->sk; + struct irda_sock *self; + struct irda_device_list *list; + __u8 optbuf[sizeof(struct irda_device_list) + + sizeof(struct irda_device_info)*10]; + discovery_t *discovery; + int val = 0; + int len = 0; + int i = 0; + + DEBUG(1, __FUNCTION__ "()\n"); + + self = sk->protinfo.irda; + + if (level != SOL_IRLMP) + return -ENOPROTOOPT; + + if (get_user(len, optlen)) + return -EFAULT; + + switch (optname) { + case IRLMP_ENUMDEVICES: + DEBUG(1, __FUNCTION__ "(), IRLMP_ENUMDEVICES\n"); + + /* Tell IrLMP we want to be notified */ + irlmp_update_client(self->ckey, self->mask, NULL, + irda_discovery_indication); + + /* Do some discovery */ + irlmp_discovery_request(self->nslots); + + /* Devices my be discovered already */ + if (!cachelog) { + DEBUG(2, __FUNCTION__ "(), no log!\n"); + + /* Sleep until device(s) discovered */ + interruptible_sleep_on(&discovery_wait); + if (!cachelog) + return -1; + } + + list = (struct irda_device_list *) optbuf; + /* + * Now, check all discovered devices (if any), and notify + * client only about the services that the client is + * interested in + */ + discovery = (discovery_t *) hashbin_get_first(cachelog); + while (discovery != NULL) { + /* Mask out the ones we don't want */ + if (discovery->hints.word & self->mask) { + /* Copy discovery information */ + list->dev[i].saddr = discovery->saddr; + list->dev[i].daddr = discovery->daddr; + list->dev[i].charset = discovery->charset; + list->dev[i].hints[0] = discovery->hints.byte[0]; + list->dev[i].hints[1] = discovery->hints.byte[1]; + strncpy(list->dev[i].info, discovery->info, 22); + if (++i >= 10) + break; + } + discovery = (discovery_t *) hashbin_get_next(cachelog); + } + cachelog = NULL; + + list->len = i; + len = sizeof(struct irda_device_list) + + sizeof(struct irda_device_info) * i; + + DEBUG(1, __FUNCTION__ "(), len=%d, i=%d\n", len, i); + + if (put_user(len, optlen)) + return -EFAULT; + + if (copy_to_user(optval, &optbuf, len)) + return -EFAULT; + break; + case IRTTP_MAX_SDU_SIZE: + if (self->max_sdu_size_tx != SAR_DISABLE) + val = self->max_sdu_size_tx; + else + /* SAR is disabled, so use the IrLAP data size + * instead */ + val = self->qos_tx.data_size.value - IRDA_MAX_HEADER; + + DEBUG(0, __FUNCTION__ "(), getting max_sdu_size = %d\n", val); + len = sizeof(int); + if (put_user(len, optlen)) + return -EFAULT; + + if (copy_to_user(optval, &val, len)) + return -EFAULT; + break; + default: + return -ENOPROTOOPT; + } + + return 0; +} + static struct net_proto_family irda_family_ops = { PF_IRDA, @@ -361,24 +1099,28 @@ sock_no_dup, irda_release, - sock_no_bind, + irda_bind, irda_connect, sock_no_socketpair, - sock_no_accept, + irda_accept, irda_getname, irda_poll, irda_ioctl, irda_listen, irda_shutdown, - sock_no_setsockopt, - sock_no_getsockopt, + irda_setsockopt, + irda_getsockopt, sock_no_fcntl, - sock_no_sendmsg, + irda_sendmsg, irda_recvmsg }; -#endif /* IRDA_SOCKETS */ - +/* + * Function irda_device_event (this, event, ptr) + * + * + * + */ static int irda_device_event(struct notifier_block *this, unsigned long event, void *ptr) { @@ -412,7 +1154,7 @@ { 0, /* MUTTER ntohs(ETH_P_IRDA),*/ NULL, - irlap_input, /* irda_driver_rcv, */ + irlap_driver_rcv, NULL, NULL, }; @@ -449,6 +1191,7 @@ * Remove IrDA protocol layer * */ +#ifdef MODULE void irda_proto_cleanup(void) { DEBUG( 4, __FUNCTION__ "\n"); @@ -463,4 +1206,4 @@ return; } - +#endif /* MODULE */ diff -u --recursive --new-file v2.2.5/linux/net/irda/discovery.c linux/net/irda/discovery.c --- v2.2.5/linux/net/irda/discovery.c Wed Dec 31 16:00:00 1969 +++ linux/net/irda/discovery.c Thu Apr 15 05:42:42 1999 @@ -0,0 +1,245 @@ +/********************************************************************* + * + * Filename: discovery.c + * Version: 0.1 + * Description: Routines for handling discoveries at the IrLMP layer + * Status: Experimental. + * Author: Dag Brattli + * Created at: Tue Apr 6 15:33:50 1999 + * Modified at: Tue Apr 6 20:26:46 1999 + * Modified by: Dag Brattli + * + * Copyright (c) 1999 Dag Brattli, 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. + * + * 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 + * + ********************************************************************/ + +#include +#include + +#include +#include + +#include + +/* + * Function irlmp_add_discovery (cachelog, discovery) + * + * + * + */ +void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *discovery) +{ + discovery_t *old; + + DEBUG(2, __FUNCTION__ "()\n"); + + /* Check if we have discovered this device before */ + old = hashbin_remove(cachelog, discovery->daddr, NULL); + if (old) + kfree(old); + + /* Insert the new and updated version */ + hashbin_insert(cachelog, (QUEUE *) discovery, discovery->daddr, NULL); +} + +/* + * Function irlmp_add_discovery_log (cachelog, log) + * + * + * + */ +void irlmp_add_discovery_log(hashbin_t *cachelog, hashbin_t *log) +{ + discovery_t *discovery; + + DEBUG(2, __FUNCTION__ "()\n"); + + /* + * If log is missing this means that IrLAP was unable to perform the + * discovery, so restart discovery again with just the half timeout + * of the normal one. + */ + if (log == NULL) { + /* irlmp_start_discovery_timer(irlmp, 150); */ + return; + } + + discovery = (discovery_t *) hashbin_remove_first(log); + while (discovery != NULL) { + irlmp_add_discovery(cachelog, discovery); + + discovery = (discovery_t *) hashbin_remove_first(log); + } + + /* Delete the now empty log */ + hashbin_delete(log, (FREE_FUNC) kfree); +} + +/* + * Function irlmp_expire_discoveries (log, saddr, force) + * + * Go through all discoveries and expire all that has stayed to long + * + */ +void irlmp_expire_discoveries(hashbin_t *log, int saddr, int force) +{ + discovery_t *discovery, *curr; + + DEBUG(3, __FUNCTION__ "()\n"); + + discovery = (discovery_t *) hashbin_get_first(log); + while (discovery != NULL) { + curr = discovery; + + /* Be sure to be one item ahead */ + discovery = (discovery_t *) hashbin_get_next(log); + + /* Test if it's time to expire this discovery */ + if ((curr->saddr == saddr) && (force || + ((jiffies - curr->timestamp) > DISCOVERY_EXPIRE_TIMEOUT))) + { + curr = hashbin_remove(log, curr->daddr, NULL); + if (curr) + kfree(curr); + } + } +} + +/* + * Function irlmp_dump_discoveries (log) + * + * Print out all discoveries in log + * + */ +void irlmp_dump_discoveries(hashbin_t *log) +{ + discovery_t *discovery; + + ASSERT(log != NULL, return;); + + discovery = (discovery_t *) hashbin_get_first(log); + while (discovery != NULL) { + DEBUG(0, "Discovery:\n"); + DEBUG(0, " daddr=%08x\n", discovery->daddr); + DEBUG(0, " saddr=%08x\n", discovery->saddr); + DEBUG(0, " name=%s\n", discovery->info); + + discovery = (discovery_t *) hashbin_get_next(log); + } +} + +/* + * Function irlmp_find_device (name, saddr) + * + * Look through the discovery log at each of the links and try to find + * the device with the given name. Return daddr and saddr. If saddr is + * specified, that look at that particular link only (not impl). + */ +__u32 irlmp_find_device(hashbin_t *cachelog, char *name, __u32 *saddr) +{ + discovery_t *d; + unsigned long flags; + + spin_lock_irqsave(&irlmp->lock, flags); + + /* Look at all discoveries for that link */ + d = (discovery_t *) hashbin_get_first(cachelog); + while (d != NULL) { + DEBUG(1, "Discovery:\n"); + DEBUG(1, " daddr=%08x\n", d->daddr); + DEBUG(1, " name=%s\n", d->info); + + if (strcmp(name, d->info) == 0) { + *saddr = d->saddr; + + spin_unlock_irqrestore(&irlmp->lock, flags); + return d->daddr; + } + d = (discovery_t *) hashbin_get_next(cachelog); + } + + spin_unlock_irqrestore(&irlmp->lock, flags); + + return 0; +} + +/* + * Function proc_discovery_read (buf, start, offset, len, unused) + * + * Print discovery information in /proc file system + * + */ +int discovery_proc_read(char *buf, char **start, off_t offset, int len, + int unused) +{ + discovery_t *discovery; + unsigned long flags; + hashbin_t *cachelog = irlmp_get_cachelog(); + + if (!irlmp) + return len; + + len = sprintf(buf, "IrLMP: Discovery log:\n\n"); + + save_flags(flags); + cli(); + + discovery = (discovery_t *) hashbin_get_first(cachelog); + while ( discovery != NULL) { + len += sprintf( buf+len, " name: %s,", + discovery->info); + + len += sprintf( buf+len, " hint: "); + if ( discovery->hints.byte[0] & HINT_PNP) + len += sprintf( buf+len, "PnP Compatible "); + if ( discovery->hints.byte[0] & HINT_PDA) + len += sprintf( buf+len, "PDA/Palmtop "); + if ( discovery->hints.byte[0] & HINT_COMPUTER) + len += sprintf( buf+len, "Computer "); + if ( discovery->hints.byte[0] & HINT_PRINTER) + len += sprintf( buf+len, "Printer "); + if ( discovery->hints.byte[0] & HINT_MODEM) + len += sprintf( buf+len, "Modem "); + if ( discovery->hints.byte[0] & HINT_FAX) + len += sprintf( buf+len, "Fax "); + if ( discovery->hints.byte[0] & HINT_LAN) + len += sprintf( buf+len, "LAN Access "); + + if ( discovery->hints.byte[1] & HINT_TELEPHONY) + len += sprintf( buf+len, "Telephony "); + if ( discovery->hints.byte[1] & HINT_FILE_SERVER) + len += sprintf( buf+len, "File Server "); + if ( discovery->hints.byte[1] & HINT_COMM) + len += sprintf( buf+len, "IrCOMM "); + if ( discovery->hints.byte[1] & HINT_OBEX) + len += sprintf( buf+len, "IrOBEX "); + + len += sprintf(buf+len, ", saddr: 0x%08x", + discovery->saddr); + + len += sprintf(buf+len, ", daddr: 0x%08x\n", + discovery->daddr); + + len += sprintf( buf+len, "\n"); + + discovery = (discovery_t *) hashbin_get_next(cachelog); + } + restore_flags(flags); + + return len; +} diff -u --recursive --new-file v2.2.5/linux/net/irda/ircomm/Makefile linux/net/irda/ircomm/Makefile --- v2.2.5/linux/net/irda/ircomm/Makefile Tue Dec 22 14:16:59 1998 +++ linux/net/irda/ircomm/Makefile Thu Apr 15 05:42:42 1999 @@ -8,9 +8,9 @@ # Note 2! The CFLAGS definition is now in the main makefile... O_TARGET := ircomm_n_vtd.o -O_OBJS := ircomm_common.o attach.o irvtd.o irvtd_driver.o +O_OBJS := ircomm_common.o irvtd_driver.o M_OBJS := ircomm.o ircomm_tty.o -MI_OBJS := ircomm_common.o attach.o irvtd.o irvtd_driver.o +MI_OBJS := ircomm_common.o irvtd_driver.o OX_OBJS += @@ -18,10 +18,10 @@ ifeq ($(CONFIG_IRCOMM),m) ircomm.o: $(MI_OBJS) - $(LD) $(LD_RFLAG) -r -o $@ ircomm_common.o attach.o + $(LD) $(LD_RFLAG) -r -o $@ ircomm_common.o ircomm_tty.o: $(MI_OBJS) - $(LD) $(LD_RFLAG) -r -o $@ irvtd.o irvtd_driver.o + $(LD) $(LD_RFLAG) -r -o $@ irvtd_driver.o endif include $(TOPDIR)/Rules.make diff -u --recursive --new-file v2.2.5/linux/net/irda/ircomm/attach.c linux/net/irda/ircomm/attach.c --- v2.2.5/linux/net/irda/ircomm/attach.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/ircomm/attach.c Wed Dec 31 16:00:00 1969 @@ -1,360 +0,0 @@ -/********************************************************************* - * - * Filename: attach.c - * Version: - * Description: An implementation of IrCOMM service interface. - * Status: Experimental. - * Author: Takahide Higuchi - * - * Copyright (c) 1998, Takahide Higuchi, , - * 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. - * - * I, Takahide Higuchi, provide no warranty for any of this software. - * This material is provided "AS-IS" and at no charge. - * - ********************************************************************/ - - -/* - * ---------------------------------------------------------------------- - * IrIAS related things for IrCOMM - * If you are to use ircomm layer, use ircomm_attach_cable to - * setup it and register your program. - * ---------------------------------------------------------------------- - */ - - -#include -#include - -#include -#include -#include -#include - -#include - -extern struct ircomm_cb **ircomm; -struct ircomm_cb *discovering_instance; - -static void got_lsapsel(struct ircomm_cb * info); -static void query_lsapsel(struct ircomm_cb * self); -void ircomm_getvalue_confirm( __u16 obj_id, struct ias_value *value, - void *priv); - -#if 0 -static char *rcsid = "$Id: attach.c,v 1.11 1998/10/22 12:02:20 dagb Exp $"; -#endif - - -/* - * handler for iriap_getvaluebyclass_request() - * - */ -void ircomm_getvalue_confirm( __u16 obj_id, struct ias_value *value,void *priv) -{ - struct ircomm_cb *self = (struct ircomm_cb *) priv; - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRCOMM_MAGIC, return;); - - /* Check if request succeeded */ - if ( !value) { - DEBUG( 0, __FUNCTION__ "(), got NULL value!\n"); - - return; - } - - DEBUG(0, __FUNCTION__"type(%d)\n", value->type); - - switch(value->type){ - - case IAS_OCT_SEQ: - /* - * FIXME:we should use data which came here - * it is used for nothing at this time - */ - -#if 1 - DEBUG(0, "octet sequence is:\n"); - { - int i; - for ( i=0;ilen;i++) - printk("%02x", - (int)(*value->t.oct_seq + i) ); - printk("\n"); - } -#endif - query_lsapsel(self); - break; - - case IAS_INTEGER: - /* LsapSel seems to be sent to me */ - - if ( value->t.integer == -1){ - DEBUG( 0, "ircomm_getvalue_confirm: invalid value!\n"); - return; - } - if(self->state == COMM_IDLE){ - self->dlsap = value->t.integer; - got_lsapsel(self); - } - break; - - case IAS_STRING: - DEBUG(0, __FUNCTION__":STRING is not implemented\n"); - DEBUG(0, __FUNCTION__":received string:%s\n", value->t.string); - query_lsapsel(self); /* experiment */ - break; - - case IAS_MISSING: - DEBUG( 0, __FUNCTION__":MISSING is not implemented\n"); - break; - - default: - DEBUG( 0, __FUNCTION__":unknown type!\n"); - break; - } -} - -static void got_lsapsel(struct ircomm_cb * self) -{ - struct notify_t notify; - - DEBUG(0, "ircomm:got_lsapsel: got peersap!(%d)\n", self->dlsap ); - - /* remove tsap for server */ - irttp_close_tsap(self->tsap); - - /* create TSAP for initiater ... */ - irda_notify_init(¬ify); - notify.data_indication = ircomm_accept_data_indication; - notify.connect_confirm = ircomm_accept_connect_confirm; - notify.connect_indication = ircomm_accept_connect_indication; - notify.flow_indication = ircomm_accept_flow_indication; - notify.disconnect_indication = ircomm_accept_disconnect_indication; - strncpy( notify.name, "IrCOMM cli", NOTIFY_MAX_NAME); - notify.instance = self; - - self->tsap = irttp_open_tsap(LSAP_ANY, DEFAULT_INITIAL_CREDIT, - ¬ify); - ASSERT(self->tsap != NULL, return;); - - /* - * invoke state machine - * and notify that I'm ready to accept connect_request - */ - - ircomm_next_state(self, COMM_IDLE); - if(self->d_handler) - self->d_handler(self); -} - -static void query_lsapsel(struct ircomm_cb * self) -{ - DEBUG(0, "ircomm:query_lsapsel..\n"); - - /* - * since we've got Parameters field of IAS, we are to get peersap. - */ - - if (!(self->servicetype & THREE_WIRE_RAW)) { - iriap_getvaluebyclass_request( - "IrDA:IrCOMM", "IrDA:TinyTP:LsapSel", - self->saddr, self->daddr, - ircomm_getvalue_confirm, self ); - } else { - DEBUG(0, __FUNCTION__ "THREE_WIRE_RAW is not implemented!\n"); - } -} - - - -/* - * ircomm_discovery_indication() - * Remote device is discovered, try query the remote IAS to see which - * device it is, and which services it has. - */ - -void ircomm_discovery_indication( DISCOVERY *discovery) -{ - struct ircomm_cb *self; - - DEBUG( 0, "ircomm_discovery_indication\n"); - - self = discovering_instance; - ASSERT(self != NULL, return;); - ASSERT(self->magic == IRCOMM_MAGIC, return;); - - self->daddr = discovery->daddr; - self->saddr = discovery->saddr; - - DEBUG( 0, "ircomm_discovery_indication:daddr=%08x\n", self->daddr); - - /* query "Parameters" attribute of LM-IAS */ - - DEBUG(0, "ircomm:querying parameters..\n"); -#if 0 - iriap_getvaluebyclass_request(self->daddr, "IrDA:IrCOMM", - "Parameters", - ircomm_getvalue_confirm, - self); -#else - query_lsapsel(self); -#endif - return; -} - - -struct ircomm_cb * ircomm_attach_cable( __u8 servicetype, - struct notify_t notify, - void *handler ) -{ - int i; - struct ircomm_cb *self = NULL; - struct notify_t server_notify; - struct ias_object* obj; - - /* FIXME: it should not be hard coded */ - __u8 oct_seq[6] = { 0,1,4,1,1,1 }; - - ASSERT(ircomm != NULL,return NULL;); - DEBUG(0,"ircomm_attach_cable:\n"); - - - /* find free handle */ - - for(i = 0; i < IRCOMM_MAX_CONNECTION; i++){ - ASSERT(ircomm[i] != NULL,return(NULL);); - if(!ircomm[i]->in_use){ - self = ircomm[i]; - break; - } - } - - if (!self){ - DEBUG(0,"ircomm_attach_cable:no free handle!\n"); - return (NULL); - } - - self->in_use = 1; - self->servicetype = servicetype; - - DEBUG(0,"attach_cable:servicetype:%d\n",servicetype); - self->d_handler = handler; - self->notify = notify; - - /* register server.. */ - - /* - * TODO: since server TSAP is currentry hard coded, - * we can use *only one* IrCOMM connection. - * We have to create one more TSAP and register IAS entry dynamically - * each time when we are to allocate new server here. - */ - irda_notify_init(&server_notify); - server_notify.data_indication = ircomm_accept_data_indication; - server_notify.connect_confirm = ircomm_accept_connect_confirm; - server_notify.connect_indication = ircomm_accept_connect_indication; - server_notify.flow_indication = ircomm_accept_flow_indication; - server_notify.disconnect_indication = ircomm_accept_disconnect_indication; - server_notify.instance = self; - strncpy( server_notify.name, "IrCOMM srv", NOTIFY_MAX_NAME); - - self->tsap = irttp_open_tsap(LSAP_ANY, DEFAULT_INITIAL_CREDIT, - &server_notify); - if(!self->tsap){ - DEBUG(0,"ircomm:Sorry, failed to allocate server_tsap\n"); - return NULL; - } - - /* - * Register with LM-IAS - */ - obj = irias_new_object( "IrDA:IrCOMM", IAS_IRCOMM_ID); - irias_add_integer_attrib( obj, "IrDA:TinyTP:LsapSel", - self->tsap->stsap_sel ); - - /* FIXME: it should not be hard coded */ - - irias_add_octseq_attrib( obj, "Parameters", - &oct_seq[0], 6); - irias_insert_object( obj); - -/* obj = irias_new_object( "IrDA:IrCOMM", IAS_IRCOMM_ID); */ -/* irias_add_octseq_attrib( obj, "Parameters", len, &octseq); */ -/* irias_insert_object( obj); */ - - - - /* and start discovering .. */ - discovering_instance = self; - - switch(servicetype){ - case NINE_WIRE: - DEBUG(0,"ircomm_attach_cable:discovering..\n"); - irlmp_register_layer(S_COMM , CLIENT|SERVER, TRUE, - ircomm_discovery_indication); - break; - -/* case CENTRONICS: */ -/* case THREE_WIRE: */ -/* case THREE_WIRE_RAW: */ - - default: - DEBUG(0,"ircomm_attach_cable:requested servicetype is not " - "implemented!\n"); - return NULL; - } - - ircomm_next_state(self, COMM_IDLE); - return (self); -} - -int ircomm_detach_cable(struct ircomm_cb *self) -{ - ASSERT( self != NULL, return -EIO;); - ASSERT( self->magic == IRCOMM_MAGIC, return -EIO;); - - DEBUG(0,"ircomm_detach_cable:\n"); - - /* shutdown ircomm layer */ - if(self->state != COMM_IDLE ){ - DEBUG(0,"ircomm:detach_cable:not IDLE\n"); - if(self->state != COMM_WAITI) - ircomm_disconnect_request(self, NULL); - } - - - switch(self->servicetype){ -/* case CENTRONICS: */ - case NINE_WIRE: -/* case THREE_WIRE: */ - irlmp_unregister_layer( S_COMM, CLIENT|SERVER ); - break; - -/* case THREE_WIRE_RAW: */ -/* irlmp_unregister( S_COMM ) */ -/* irlmp_unregister( S_PRINTER) */ -/* break; */ - - default: - DEBUG(0,"ircomm_detach_cable:requested servicetype is not " - "implemented!\n"); - return -ENODEV; - } - - /* remove tsaps */ - if(self->tsap) - irttp_close_tsap(self->tsap); - - self->tsap = NULL; - self->in_use = 0; - - return 0; -} diff -u --recursive --new-file v2.2.5/linux/net/irda/ircomm/ircomm_common.c linux/net/irda/ircomm/ircomm_common.c --- v2.2.5/linux/net/irda/ircomm/ircomm_common.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/ircomm/ircomm_common.c Thu Apr 15 05:42:42 1999 @@ -33,23 +33,19 @@ #include #include -#include +#include #include #include #include +#include #include -#if 0 -static char *rcsid = "$Id: ircomm_common.c,v 1.13 1998/10/13 12:59:05 takahide Exp $"; -#endif -static char *version = "IrCOMM_common, $Revision: 1.13 $ $Date: 1998/10/13 12:59:05 $ (Takahide Higuchi)"; - - +static char *revision_date = "Tue Mar 2 02:03:58 1999"; -static void ircomm_state_discovery( struct ircomm_cb *self, - IRCOMM_EVENT event, struct sk_buff *skb ); +static void ircomm_state_discovery(struct ircomm_cb *self, + IRCOMM_EVENT event, struct sk_buff *skb ); static void ircomm_state_idle( struct ircomm_cb *self, IRCOMM_EVENT event, struct sk_buff *skb ); static void ircomm_state_waiti( struct ircomm_cb *self, IRCOMM_EVENT event, @@ -60,12 +56,35 @@ struct sk_buff *skb ); static void ircomm_do_event( struct ircomm_cb *self, IRCOMM_EVENT event, struct sk_buff *skb); -void ircomm_next_state( struct ircomm_cb *self, IRCOMM_STATE state); +static void ircomm_next_state( struct ircomm_cb *self, IRCOMM_STATE state); + +static void ircomm_discovery_indication(discovery_t *discovery); +static void ircomm_tx_controlchannel(struct ircomm_cb *self ); +static int ircomm_proc_read(char *buf, char **start, off_t offset, + int len, int unused); + +static void query_lsapsel(struct ircomm_cb * self); +static void ircomm_getvalue_confirm( __u16 obj_id, struct ias_value *value, + void *priv); + + +static __u32 ckey; +static __u32 skey; +struct ircomm_cb *discovering_instance; + +/* + * debug parameter ircomm_cs: + * 0 = client/server, 1 = client only 2 = server only + * usage for example: + * insmod ircomm ircomm_cs=1 + * LILO boot : Linux ircomm_cs=2 etc. + */ + +static int ircomm_cs = 0; +MODULE_PARM(ircomm_cs, "i"); + -int ircomm_check_handle(int handle); -static void ircomm_parse_control(struct ircomm_cb *self, struct sk_buff *skb, - int type); static char *ircommstate[] = { "DISCOVERY", "IDLE", @@ -109,9 +128,6 @@ "IRCOMM_CONTROL_REQUEST", }; -int ircomm_proc_read(char *buf, char **start, off_t offset, - int len, int unused); - #ifdef CONFIG_PROC_FS extern struct proc_dir_entry proc_irda; struct proc_dir_entry proc_ircomm = { @@ -132,13 +148,13 @@ ircomm_state_conn, }; - __initfunc(int ircomm_init(void)) { int i; - printk( KERN_INFO "%s\n", version); - DEBUG( 4, "ircomm_common:init_module\n"); + printk( "Linux-IrDA: IrCOMM protocol ( revision:%s ) \n", + revision_date); + DEBUG( 4, __FUNCTION__"()\n"); /* allocate master array */ @@ -146,7 +162,7 @@ IRCOMM_MAX_CONNECTION, GFP_KERNEL); if ( ircomm == NULL) { - printk( KERN_WARNING "IrCOMM: Can't allocate ircomm array!\n"); + printk( KERN_ERR __FUNCTION__"(): kmalloc failed!\n"); return -ENOMEM; } @@ -158,7 +174,7 @@ ircomm[i] = kmalloc( sizeof(struct ircomm_cb), GFP_KERNEL ); if(!ircomm[i]){ - printk(KERN_ERR "ircomm:kmalloc failed!\n"); + printk( KERN_ERR __FUNCTION__"(): kmalloc failed!\n"); return -ENOMEM; } @@ -194,14 +210,17 @@ proc_register( &proc_irda, &proc_ircomm); #endif /* CONFIG_PROC_FS */ + + discovering_instance = NULL; return 0; } +#ifdef MODULE void ircomm_cleanup(void) { int i; - DEBUG( 4, "ircomm_common:cleanup_module\n"); + DEBUG( 4, "ircomm:cleanup_module\n"); /* * free some resources */ @@ -227,8 +246,9 @@ #ifdef CONFIG_PROC_FS proc_unregister( &proc_irda, proc_ircomm.low_ino); -#endif +#endif /* CONFIG_PROC_FS */ } +#endif /* MODULE */ /* * ---------------------------------------------------------------------- @@ -236,23 +256,26 @@ * ---------------------------------------------------------------------- */ -void ircomm_accept_data_indication(void *instance, void *sap, - struct sk_buff *skb) +static int ircomm_accept_data_indication(void *instance, void *sap, + struct sk_buff *skb) { struct ircomm_cb *self = (struct ircomm_cb *)instance; - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRCOMM_MAGIC, return;); - ASSERT( skb != NULL, return;); + ASSERT( self != NULL, return -1;); + ASSERT( self->magic == IRCOMM_MAGIC, return -1;); + ASSERT( skb != NULL, return -1;); - DEBUG(4,"ircomm_accept_data_indication:\n"); + DEBUG(4,__FUNCTION__"():\n"); ircomm_do_event( self, TTP_DATA_INDICATION, skb); + self->rx_packets++; + + return 0; } -void ircomm_accept_connect_confirm(void *instance, void *sap, +static void ircomm_accept_connect_confirm(void *instance, void *sap, struct qos_info *qos, - int maxsdusize, struct sk_buff *skb) + __u32 maxsdusize, struct sk_buff *skb) { struct ircomm_cb *self = (struct ircomm_cb *)instance; @@ -262,7 +285,7 @@ ASSERT( skb != NULL, return;); ASSERT( qos != NULL, return;); - DEBUG(0,"ircomm_accept_connect_confirm:\n"); + DEBUG(0,__FUNCTION__"(): got connected!\n"); if(maxsdusize == SAR_DISABLE) self->max_txbuff_size = qos->data_size.value; @@ -277,9 +300,9 @@ ircomm_do_event( self, TTP_CONNECT_CONFIRM, skb); } -void ircomm_accept_connect_indication(void *instance, void *sap, +static void ircomm_accept_connect_indication(void *instance, void *sap, struct qos_info *qos, - int maxsdusize, + __u32 maxsdusize, struct sk_buff *skb ) { struct ircomm_cb *self = (struct ircomm_cb *)instance; @@ -289,7 +312,7 @@ ASSERT( skb != NULL, return;); ASSERT( qos != NULL, return;); - DEBUG(0,"ircomm_accept_connect_indication:\n"); + DEBUG(0,__FUNCTION__"()\n"); if(maxsdusize == SAR_DISABLE) self->max_txbuff_size = qos->data_size.value; @@ -298,9 +321,14 @@ self->qos = qos; ircomm_do_event( self, TTP_CONNECT_INDICATION, skb); + + /* stop connecting */ + wake_up_interruptible( &self->discovery_wait); + wake_up_interruptible( &self->ias_wait); + } -void ircomm_accept_disconnect_indication(void *instance, void *sap, +static void ircomm_accept_disconnect_indication(void *instance, void *sap, LM_REASON reason, struct sk_buff *skb) { @@ -308,15 +336,16 @@ ASSERT( self != NULL, return;); ASSERT( self->magic == IRCOMM_MAGIC, return;); - ASSERT( skb != NULL, return;); - DEBUG(0,"ircomm_accept_disconnect_indication:\n"); + DEBUG(0,__FUNCTION__"():\n"); ircomm_do_event( self, TTP_DISCONNECT_INDICATION, skb); + } -void ircomm_accept_flow_indication( void *instance, void *sap, LOCAL_FLOW cmd) +static void ircomm_accept_flow_indication( void *instance, void *sap, + LOCAL_FLOW cmd) { - + IRCOMM_CMD command; struct ircomm_cb *self = (struct ircomm_cb *)instance; ASSERT( self != NULL, return;); @@ -324,34 +353,32 @@ switch(cmd){ case FLOW_START: - DEBUG(0,"ircomm_accept_flow_indication:START\n"); - - self->pi = TX_READY; + DEBUG(4,__FUNCTION__"():START\n"); + command = TX_READY; self->ttp_stop = 0; if(self->notify.flow_indication) self->notify.flow_indication( self->notify.instance, - self, cmd); - ircomm_control_request(self); + self, command); break; case FLOW_STOP: - DEBUG(0,"ircomm_accept_flow_indication:STOP\n"); - self->pi = TX_BUSY; + DEBUG(4,__FUNCTION__":STOP\n"); + command = TX_BUSY; self->ttp_stop = 1; if(self->notify.flow_indication) self->notify.flow_indication( self->notify.instance, - self, cmd); + self, command); break; default: - DEBUG(0,"ircomm_accept_flow_indication:unknown status!\n"); + DEBUG(0,__FUNCTION__"();unknown status!\n"); } } /* * ---------------------------------------------------------------------- - * Implementation of actions,descrived in section 7.4 of the reference. + * Impl. of actions (descrived in section 7.4 of the reference) * ---------------------------------------------------------------------- */ @@ -360,33 +387,25 @@ { /* TODO: we have to send/build userdata field which contains InitialControlParameters */ - /* but userdata field is not implemeted in irttp.c.. */ switch(self->servicetype){ case THREE_WIRE_RAW: - /* not implemented yet! Do nothing */ - DEBUG(0, "ircomm:issue_connect_request:" - "not implemented servicetype!"); + DEBUG(0, __FUNCTION__"():THREE_WIRE_RAW is not implemented\n"); break; case DEFAULT: - irttp_connect_request(self->tsap, self->dlsap, - self->saddr, self->daddr, - NULL, self->maxsdusize, NULL); - break; - case THREE_WIRE: case NINE_WIRE: case CENTRONICS: irttp_connect_request(self->tsap, self->dlsap, self->saddr, self->daddr, - NULL, self->maxsdusize, NULL); + NULL, self->maxsdusize, userdata); break; default: - DEBUG(0,"ircomm:issue_connect_request:Illegal servicetype %d\n" - ,self->servicetype); + printk(KERN_ERR __FUNCTION__"():Illegal servicetype %d\n" + ,self->servicetype); } } @@ -401,7 +420,7 @@ if(self->notify.disconnect_indication) self->notify.disconnect_indication( self->notify.instance, self, - self->reason,skb); + self->reason, skb); } @@ -429,6 +448,7 @@ static void connect_confirmation(struct ircomm_cb *self, struct sk_buff *skb) { + DEBUG(4 ,__FUNCTION__"()\n"); /* give a connect_confirm to the client */ if( self->notify.connect_confirm ) @@ -440,11 +460,10 @@ struct sk_buff *skb) { - DEBUG(0,"ircomm:issue_connect_response:\n"); + DEBUG(0,__FUNCTION__"()\n"); if( self->servicetype == THREE_WIRE_RAW){ - DEBUG(0,"ircomm:issue_connect_response():3WIRE-RAW is not " - "implemented yet !\n"); + DEBUG(0,__FUNCTION__"():THREE_WIRE_RAW is not implemented yet\n"); /* irlmp_connect_rsp(); */ } else { irttp_connect_response(self->tsap, self->maxsdusize, skb); @@ -455,10 +474,11 @@ struct sk_buff *userdata) { if(self->servicetype == THREE_WIRE_RAW){ - DEBUG(0,"ircomm:issue_disconnect_request():3wireraw is not implemented!"); + DEBUG(0,__FUNCTION__"():3wireraw is not implemented\n"); } else - irttp_disconnect_request(self->tsap, NULL, P_NORMAL); + irttp_disconnect_request(self->tsap, userdata, + self->disconnect_priority); } static void issue_data_request(struct ircomm_cb *self, @@ -468,52 +488,74 @@ if(self->servicetype == THREE_WIRE_RAW){ /* irlmp_data_request(self->lmhandle,userdata); */ - DEBUG(0,"ircomm:issue_data_request():not implemented!"); + DEBUG(0,__FUNCTION__"():not implemented!"); return; } - DEBUG(4,"ircomm:issue_data_request():sending frame\n"); + DEBUG(4,__FUNCTION__"():sending frame\n"); err = irttp_data_request(self->tsap , userdata ); - if(err) - DEBUG(0,"ircomm:ttp_data_request failed\n"); - if(userdata && err) - dev_kfree_skb( userdata); - + if(err){ + printk(KERN_ERR __FUNCTION__":ttp_data_request failed\n"); + if(userdata) + dev_kfree_skb( userdata); + } + self->tx_packets++; } static void issue_control_request(struct ircomm_cb *self, struct sk_buff *userdata ) { - if(self->servicetype == THREE_WIRE_RAW){ - DEBUG(0,"THREE_WIRE_RAW is not implemented\n"); + int err; + + DEBUG(4,__FUNCTION__"()\n"); + if(self->servicetype == THREE_WIRE_RAW) + { + DEBUG(0,__FUNCTION__"():THREE_WIRE_RAW is not implemented\n"); - }else { - irttp_data_request(self->tsap,userdata); + } + else + { + err = irttp_data_request(self->tsap,userdata); + if(err) + { + printk( __FUNCTION__"():ttp_data_request failed\n"); + if(userdata) + dev_kfree_skb( userdata); + } + else + self->tx_controls++; + + self->pending_control_tuples = 0; } } static void process_data(struct ircomm_cb *self, struct sk_buff *skb ) { - DEBUG(4,"ircomm:process_data:skb_len is(%d),clen_is(%d)\n", + DEBUG(4,__FUNCTION__":skb->len=%d, ircomm header = 1, clen=%d\n", (int)skb->len ,(int)skb->data[0]); - /* - * we always have to parse control channel - * (see page17 of IrCOMM standard) + /* we have to parse control channel when receiving. (see + * page17 of IrCOMM standard) but it is not parsed here since + * upper layer may have some receive buffer. + * + * hence upper layer have to parse it when it consumes a packet. + * -- TH */ - ircomm_parse_control(self, skb, CONTROL_CHANNEL); + /* ircomm_parse_control(self, skb, CONTROL_CHANNEL); */ if(self->notify.data_indication && skb->len) self->notify.data_indication(self->notify.instance, self, skb); } -void ircomm_data_indication(struct ircomm_cb *self, struct sk_buff *skb) +int ircomm_data_indication(struct ircomm_cb *self, struct sk_buff *skb) { /* Not implemented yet:THREE_WIRE_RAW service uses this function. */ DEBUG(0,"ircomm_data_indication:not implemented yet!\n"); + + return 0; } @@ -528,15 +570,15 @@ struct sk_buff *skb) { - DEBUG( 4, "ircomm_do_event: STATE = %s, EVENT = %s\n", + DEBUG( 4, __FUNCTION__": STATE = %s, EVENT = %s\n", ircommstate[self->state], ircommevent[event]); (*state[ self->state ]) ( self, event, skb); } -void ircomm_next_state( struct ircomm_cb *self, IRCOMM_STATE state) +static void ircomm_next_state( struct ircomm_cb *self, IRCOMM_STATE state) { self->state = state; - DEBUG( 0, "ircomm_next_state: NEXT STATE = %d(%s), sv(%d)\n", + DEBUG( 0, __FUNCTION__": NEXT STATE=%d(%s), servicetype=(%d)\n", (int)state, ircommstate[self->state],self->servicetype); } @@ -549,8 +591,7 @@ static void ircomm_state_discovery( struct ircomm_cb *self, IRCOMM_EVENT event, struct sk_buff *skb ) { - DEBUG(0,"ircomm_state_discovery: " - "why call me? \n"); + printk(KERN_ERR __FUNCTION__"():why call me? something is wrong..\n"); if(skb) dev_kfree_skb( skb); } @@ -578,15 +619,13 @@ case LMP_CONNECT_INDICATION: - /* I think this is already done in irlpt_event.c */ - - DEBUG(0,"ircomm_state_idle():LMP_CONNECT_IND is notimplemented!"); + DEBUG(0,__FUNCTION__"():LMP_CONNECT_IND is notimplemented!"); /* connect_indication_three_wire_raw(); */ /* ircomm_next_state(self, COMM_WAITR); */ break; default: - DEBUG(0,"ircomm_state_idle():unknown event =%d(%s)\n", + DEBUG(0,__FUNCTION__"():unknown event =%d(%s)\n", event, ircommevent[event]); } } @@ -616,7 +655,7 @@ /* ircomm_next_state(self, COMM_IDLE); */ /* break; */ default: - DEBUG(0,"ircomm_state_waiti:unknown event =%d(%s)\n", + DEBUG(0,__FUNCTION__"():unknown event =%d(%s)\n", event, ircommevent[event]); } } @@ -636,8 +675,7 @@ /* issue_connect_response */ if(self->servicetype==THREE_WIRE_RAW){ - DEBUG(0,"ircomm:issue_connect_response:" - "THREE_WIRE_RAW is not implemented!\n"); + DEBUG(0,__FUNCTION__"():3WIRE_RAW is not implemented\n"); /* irlmp_connect_response(Vpeersap, * ACCEPT,null); */ @@ -677,19 +715,15 @@ switch(event){ case TTP_DATA_INDICATION: process_data(self, skb); - /* stay CONN state*/ break; case IRCOMM_DATA_REQUEST: issue_data_request(self, skb); - /* stay CONN state*/ break; /* case LMP_DATA_INDICATION: */ /* ircomm_data_indicated(); */ -/* stay CONN state */ /* break; */ case IRCOMM_CONTROL_REQUEST: issue_control_request(self, skb); - /* stay CONN state*/ break; case TTP_DISCONNECT_INDICATION: ircomm_next_state(self, COMM_IDLE); @@ -712,16 +746,189 @@ /* * ---------------------------------------------------------------------- - * ircomm requests + * IrCOMM service interfaces and supporting functions * * ---------------------------------------------------------------------- */ - -void ircomm_connect_request(struct ircomm_cb *self, int maxsdusize) +int ircomm_query_ias_and_connect(struct ircomm_cb *self, __u8 servicetype) { + int retval=0; + __u16 hints; + + ASSERT( self != NULL, return -EFAULT;); + ASSERT( self->magic == IRCOMM_MAGIC, return -EFAULT;); + DEBUG(4,__FUNCTION__"():servicetype = %d\n",servicetype); /* + * wait if another instance is discovering now + */ + if(discovering_instance){ + interruptible_sleep_on( &self->discovery_wait); + if(signal_pending(current)){ + return -EINTR; /* cought a signal */ + } + if(self->state == COMM_CONN) + return 0; /* got connected */ + } + ASSERT(discovering_instance == NULL, return -EFAULT;); + discovering_instance = self; + + /* + * start discovering + */ + hints = irlmp_service_to_hint(S_COMM); + + DEBUG(0,__FUNCTION__"():start discovering..\n"); + switch (ircomm_cs) { + case 0: + skey = irlmp_register_service(hints); + ckey = irlmp_register_client(hints, ircomm_discovery_indication, + NULL); + break; + + case 1: /* client only */ + DEBUG( 0, __FUNCTION__"():client only mode\n"); + ckey = irlmp_register_client(hints, ircomm_discovery_indication, + NULL); + break; + + case 2: /* server only */ + default: + DEBUG( 0, __FUNCTION__"():server only mode\n"); + skey = irlmp_register_service(hints); + discovering_instance = NULL; + return 0; + } + + + /* + * waiting for discovery + */ + interruptible_sleep_on( &self->discovery_wait); + if(signal_pending(current)){ + retval = -EINTR; goto bailout; /* cought a signal */ + } + if(self->state == COMM_CONN) + goto bailout; /* got connected */ + + /* + * query Parameters field of IAS and waiting for answer + */ + + self->servicetype = 0; + DEBUG(0, __FUNCTION__"():querying IAS: Parameters..\n"); + iriap_getvaluebyclass_request( "IrDA:IrCOMM", "Parameters", + self->saddr, self->daddr, + ircomm_getvalue_confirm, self ); + + interruptible_sleep_on( &self->ias_wait); + if(signal_pending(current)){ + retval = -EINTR; goto bailout; /* cought a signal */ + } + if(self->state == COMM_CONN) + goto bailout; /* got connected */ + + + /* really got Parameters field? */ + if(self->ias_type != IAS_OCT_SEQ){ + retval = -EFAULT; + goto bailout; + } + + /* + * check if servicetype we want is available + */ + self->peer_cap = self->servicetype; + + DEBUG(0,__FUNCTION__"():peer capability is:\n"); + DEBUG(0,"3wire raw: %s\n",((self->servicetype & THREE_WIRE_RAW) ? "yes":"no")); + DEBUG(0,"3wire : %s\n",((self->servicetype & THREE_WIRE) ? "yes":"no")); + DEBUG(0,"9wire : %s\n",((self->servicetype & NINE_WIRE) ? "yes":"no")); + DEBUG(0,"IEEE1284 : %s\n",((self->servicetype & CENTRONICS) ? "yes":"no")); + + self->servicetype &= servicetype; + if(!(self->servicetype)){ + retval = -ENODEV; + goto bailout; + } + + /* + * then choose better one + */ + + if(self->servicetype & THREE_WIRE_RAW) + servicetype = THREE_WIRE_RAW; + if(self->servicetype & THREE_WIRE) + servicetype = THREE_WIRE; + if(self->servicetype & NINE_WIRE) + servicetype = NINE_WIRE; + if(self->servicetype & CENTRONICS) + servicetype = CENTRONICS; + + self->servicetype = servicetype; +#if 1 + /* + * waiting for discovery again + */ + interruptible_sleep_on( &self->discovery_wait); + if(signal_pending(current)){ + retval = -EINTR; goto bailout; /* cought a signal */ + } + if(self->state == COMM_CONN) + goto bailout; /* got connected */ +#endif + /* + * query lsapsel field and waiting for answer + */ + query_lsapsel(self); + interruptible_sleep_on( &self->ias_wait); + if(signal_pending(current)){ + retval = -EINTR; goto bailout; /* cought a signal */ + } + if(self->state == COMM_CONN) + goto bailout; /* got connected */ + + /* really got Lsapsel field? */ + if(self->ias_type != IAS_INTEGER){ + retval = -EFAULT; + goto bailout; + } +#if 1 + /* + * waiting for discovery again... + */ + interruptible_sleep_on( &self->discovery_wait); + if(signal_pending(current)){ + retval = -EINTR; goto bailout; /* cought a signal */ + } + if(self->state == COMM_CONN) + goto bailout; /* got connected */ +#endif + + /* succeed! ready to connect */ + discovering_instance = NULL; + ircomm_connect_request(self); + return 0; + + bailout: + /* failed. not ready to connect */ + discovering_instance = NULL; + irlmp_unregister_service(skey); + irlmp_unregister_client(ckey); + return retval; +} + +/* + * ircomm_connect_request() + * Impl. of this function is differ from one of the reference. + * This functin does discovery as well as sending connect request + */ + + +void ircomm_connect_request(struct ircomm_cb *self) +{ + /* * TODO:build a packet which contains "initial control parameters" * and send it with connect_request */ @@ -729,14 +936,17 @@ ASSERT( self != NULL, return;); ASSERT( self->magic == IRCOMM_MAGIC, return;); - DEBUG(0,"ircomm_connect_request:\n"); - self->maxsdusize = maxsdusize; + DEBUG(0, __FUNCTION__"():sending connect_request...\n"); + + ircomm_control_request(self, SERVICETYPE); /*servictype*/ + + self->maxsdusize = SAR_DISABLE; ircomm_do_event( self, IRCOMM_CONNECT_REQUEST, NULL); } void ircomm_connect_response(struct ircomm_cb *self, struct sk_buff *userdata, - int maxsdusize) + __u32 maxsdusize) { ASSERT( self != NULL, return;); @@ -753,11 +963,8 @@ if(!userdata){ /* FIXME: check for errors and initialize? DB */ userdata = dev_alloc_skb(COMM_DEFAULT_DATA_SIZE); - if(!userdata){ - DEBUG(0, __FUNCTION__"alloc_skb failed\n"); - return; - } - IS_SKB(userdata, return;); + ASSERT(userdata != NULL, return;); + skb_reserve(userdata,COMM_HEADER_SIZE); } @@ -771,33 +978,70 @@ } void ircomm_disconnect_request(struct ircomm_cb *self, - struct sk_buff *userdata) + struct sk_buff *userdata, + int priority) { ASSERT( self != NULL, return;); ASSERT( self->magic == IRCOMM_MAGIC, return;); + DEBUG(0,__FUNCTION__"()\n"); + + /* unregister layer */ + switch (ircomm_cs) { + case 1: /* client only */ + irlmp_unregister_client(ckey); + break; + + case 2: /* server only */ + irlmp_unregister_service(skey); + break; + case 0: + default: + irlmp_unregister_client(ckey); + irlmp_unregister_service(skey); + break; + } - DEBUG(0,"ircomm_disconnect_request\n"); - ircomm_do_event(self, IRCOMM_DISCONNECT_REQUEST, NULL); + self->disconnect_priority = priority; + if(priority != P_HIGH) + self->disconnect_priority = P_NORMAL; + + ircomm_do_event(self, IRCOMM_DISCONNECT_REQUEST, userdata); } -void ircomm_data_request(struct ircomm_cb *self, struct sk_buff *userdata) +int ircomm_data_request(struct ircomm_cb *self, struct sk_buff *userdata) { + __u8 * frame; - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRCOMM_MAGIC, return;); - ASSERT( userdata != NULL, return;); + DEBUG(4,__FUNCTION__"()\n"); + ASSERT( self != NULL, return -EFAULT;); + ASSERT( self->magic == IRCOMM_MAGIC, return -EFAULT;); + ASSERT( userdata != NULL, return -EFAULT;); + if(self->state != COMM_CONN){ - DEBUG(4,"ignore IRCOMM_DATA_REQUEST:not connected\n"); - if(userdata) - dev_kfree_skb(userdata); - return; + DEBUG(4,__FUNCTION__"():not connected, data is ignored\n"); + return -EINVAL; } - DEBUG(4,"ircomm_data_request\n"); + if(self->ttp_stop) + return -EBUSY; + + if(self->control_ch_pending){ + /* send control_channel */ + ircomm_tx_controlchannel(self); + } + + if(self->ttp_stop) + return -EBUSY; + + /* add "clen" field */ + frame = skb_push(userdata,1); + frame[0]=0; /* without control channel */ + ircomm_do_event(self, IRCOMM_DATA_REQUEST, userdata); + return 0; } /* @@ -807,20 +1051,25 @@ * ---------------------------------------------------------------------- */ -static void ircomm_tx_ctrlbuffer(struct ircomm_cb *self ) + +static void ircomm_tx_controlchannel(struct ircomm_cb *self ) { __u8 clen; struct sk_buff *skb = self->ctrl_skb; - DEBUG(4,"ircomm_tx_ctrlbuffer:\n"); + DEBUG(4,__FUNCTION__"()\n"); + /* 'self' should have been checked */ + ASSERT(!self->ttp_stop, return ;); + ASSERT(self->state == COMM_CONN, return ;); /* add "clen" field */ clen=skb->len; - if(clen){ - skb_push(skb,1); - skb->data[0]=clen; + ASSERT(clen != 0,return;); + + skb_push(skb,1); + skb->data[0]=clen; #if 0 printk("tx_ctrl:"); @@ -831,148 +1080,106 @@ printk("\n"); } #endif - - ircomm_do_event(self, IRCOMM_CONTROL_REQUEST, skb); - - skb = dev_alloc_skb(COMM_DEFAULT_DATA_SIZE); - if (skb==NULL){ - DEBUG(0,"ircomm_tx_ctrlbuffer:alloc_skb failed!\n"); - return; - } - skb_reserve(skb,COMM_HEADER_SIZE); - self->ctrl_skb = skb; - } -} - - -void ircomm_control_request(struct ircomm_cb *self) -{ - struct sk_buff *skb; + ircomm_do_event(self, IRCOMM_CONTROL_REQUEST, skb); + self->control_ch_pending = 0; - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRCOMM_MAGIC, return;); + skb = dev_alloc_skb(COMM_DEFAULT_DATA_SIZE); + ASSERT(skb != NULL, return ;); - DEBUG(0, "ircomm_control_request:\n"); - - if(self->ttp_stop || self->state != COMM_CONN){ - DEBUG(0,"ircomm_control_request:can't send it.. ignore it\n"); - return; - } - - skb = self->ctrl_skb; - IS_SKB(skb,return;); - - if(skb->len) - ircomm_tx_ctrlbuffer(self); + skb_reserve(skb,COMM_HEADER_SIZE); + self->ctrl_skb = skb; } static void append_tuple(struct ircomm_cb *self, __u8 instruction, __u8 pl , __u8 *value) { - __u8 *frame; struct sk_buff *skb; - int i,c; + int i,c = 0; + unsigned long flags; + + save_flags(flags);cli(); skb = self->ctrl_skb; ASSERT(skb != NULL, return;); - IS_SKB(skb,return;); - /*if there is little room in the packet... */ - - if(skb->len > COMM_DEFAULT_DATA_SIZE - COMM_HEADER_SIZE - (pl+2)){ - if(!self->ttp_stop && self->state == COMM_CONN){ - - /* send a packet if we can */ - ircomm_tx_ctrlbuffer(self); - skb = self->ctrl_skb; - } else { - DEBUG(0, "ircomm_append_ctrl:there's no room.. ignore it\n"); - - /* TODO: we have to detect whether we have to resend some - information after ttp_stop is cleared */ - - /* self->resend_ctrl = 1; */ - return; - } + if(skb_tailroom(skb) < (pl+2)){ + DEBUG(0, __FUNCTION__"there's no room.. ignore it\n"); + self->ignored_control_tuples++; + restore_flags(flags); + return; } frame = skb_put(skb,pl+2); - c = 0; frame[c++] = instruction; /* PI */ frame[c++] = pl; /* PL */ for(i=0; i < pl ; i++) frame[c++] = *value++; /* PV */ - + restore_flags(flags); + self->pending_control_tuples++; + self->control_ch_pending = 1; } /* - * ircomm_append_ctrl(); + * ircomm_control_request(); * this function is exported as a request to send some control-channel tuples * to peer device */ -void ircomm_append_ctrl(struct ircomm_cb *self, __u8 instruction) +void ircomm_control_request(struct ircomm_cb *self, __u8 instruction) { - __u8 pv[70]; + __u8 pv[32]; /* 32 max, for PORT_NAME */ __u8 *value = &pv[0]; __u32 temp; + int notsupp=0; ASSERT( self != NULL, return;); ASSERT( self->magic == IRCOMM_MAGIC, return;); - if(self->state != COMM_CONN) - return; - if(self->servicetype == THREE_WIRE_RAW){ - DEBUG(0,"THREE_WIRE_RAW shuold not use me!\n"); + DEBUG(0,__FUNCTION__"():THREE_WIRE_RAW shuold not use me!\n"); return; } - DEBUG(4,"ircomm_append_ctrl:\n"); + DEBUG(4,__FUNCTION__"()\n"); /* find parameter and its length */ - switch(instruction){ + if(self->servicetype == THREE_WIRE) goto threewire; + if(self->servicetype == NINE_WIRE) goto ninewire; - case POLL_FOR_LINE_SETTINGS: - case STATUS_QUERY: + + /* FIXME: centronics service is not fully implemented yet*/ + switch(instruction){ case IEEE1284_MODE_SUPPORT: case IEEE1284_DEVICEID: append_tuple(self,instruction,0,NULL); break; - - case SERVICETYPE: - value[0] = self->servicetype; - append_tuple(self,instruction,1,value); + case STATUS_QUERY: + append_tuple(self,instruction,0,NULL); break; - case DATA_FORMAT: - value[0] = self->data_format; + case SET_BUSY_TIMEOUT: + value[0] = self->busy_timeout; append_tuple(self,instruction,1,value); break; - case FLOW_CONTROL: - if(self->null_modem_mode){ + case IEEE1284_ECP_EPP_DATA_TRANSFER: + value[0] = self->ecp_epp_mode; + value[1] = self->channel_or_addr; + append_tuple(self,instruction,2,value); + break; + default: + notsupp=1; + } - /* inside out */ - value[0] = (self->flow_ctrl & 0x55) << 1; - value[0] |= (self->flow_ctrl & 0xAA) >> 1; - }else{ - value[0] = self->flow_ctrl; - } - append_tuple(self,instruction,1,value); - break; - case LINESTATUS: - value[0] = self->line_status; - append_tuple(self,instruction,1,value); - break; - case BREAK_SIGNAL: - value[0] = self->break_signal; - append_tuple(self,instruction,1,value); + ninewire: + switch(instruction){ + case POLL_FOR_LINE_SETTINGS: + append_tuple(self,instruction,0,NULL); break; case DTELINE_STATE: if(self->null_modem_mode){ @@ -1003,8 +1210,42 @@ value[0] = self->dce; append_tuple(self,instruction,1,value); break; - case SET_BUSY_TIMEOUT: - value[0] = self->busy_timeout; + + default: + notsupp=1; + } + + threewire: + switch(instruction){ + + case SERVICETYPE: + value[0] = self->servicetype; + append_tuple(self,instruction,1,value); + break; + + case DATA_FORMAT: + value[0] = self->data_format; + append_tuple(self,instruction,1,value); + break; + + case FLOW_CONTROL: + if(self->null_modem_mode){ + /* inside out */ + value[0] = (self->flow_ctrl & 0x55) << 1; + value[0] |= (self->flow_ctrl & 0xAA) >> 1; + }else{ + value[0] = self->flow_ctrl; + } + append_tuple(self,instruction,1,value); + break; + + case LINESTATUS: + value[0] = self->line_status; + append_tuple(self,instruction,1,value); + break; + + case BREAK_SIGNAL: + value[0] = self->break_signal; append_tuple(self,instruction,1,value); break; @@ -1020,12 +1261,6 @@ append_tuple(self,instruction,2,value); break; - case IEEE1284_ECP_EPP_DATA_TRANSFER: - value[0] = self->ecp_epp_mode; - value[1] = self->channel_or_addr; - append_tuple(self,instruction,2,value); - break; - case DATA_RATE: temp = self->data_rate; value[3] = (__u8)((temp >> 24) & 0x000000ff); @@ -1034,203 +1269,422 @@ value[0] = (__u8)(temp & 0x000000ff); append_tuple(self,instruction,4,value); break; - #if 0 case PORT_NAME: case FIXED_PORT_NAME: temp = strlen(&self->port_name); - if(temp < 70){ + if(temp < 32){ value = (__u8) (self->port_name); append_tuple(self,instruction,temp,value); - } - break; + }else + DEBUG(0,__FUNCTION__"() PORT_NAME:too long\n"); #endif - -/* TODO: control tuples for centronics emulation is not implemented */ -/* case IEEE1284_MODE: */ + break; default: - DEBUG(0,"ircomm_append_ctrl:instruction(0x%02x)is not" - "implemented\n",instruction); + if(notsupp) + DEBUG(0,__FUNCTION__"():instruction(0x%02x)is not" + "implemented\n",instruction); } } -static void ircomm_parse_control(struct ircomm_cb *self, - struct sk_buff *skb, - int type) +void ircomm_parse_tuples(struct ircomm_cb *self, struct sk_buff *skb, int type) { __u8 *data; - __u8 pi,pl,pv[64]; + __u8 pi,plen; int clen = 0; - int i,indicate,count = 0; + int indicate=0; - - data = skb->data; - if(type == IAS_PARAM) - clen = ((data[count++] << 8) & data[count++]); /* MSB first */ - else /* CONTROL_CHANNEL */ - clen = data[count++]; + ASSERT(skb != NULL, return;); + ASSERT(self != NULL, return ;); + ASSERT(self->magic == IRCOMM_MAGIC, return ;); - if(clen == 0){ - skb_pull( skb, 1); /* remove clen field */ - return; +#ifdef IRCOMM_DEBUG_TUPLE + DEBUG(0, __FUNCTION__"():tuple sequence is:\n"); + { + int i; + for ( i=0;i< skb->len;i++) + printk("%02x", (__u8)(skb->data[i])); + printk("\n"); } +#endif + data = skb->data; + if(type == IAS_PARAM) + { + clen = (data[0] << 8) & 0xff00; + clen |= data[1] & 0x00ff; + ASSERT( clen <= (skb->len - 2) && clen <= 1024, goto corrupted;); + DEBUG(4, __FUNCTION__"():IAS_PARAM len = %d\n",clen ); + skb_pull( skb, 2); + } + else + { + /* CONTROL_CHANNEL */ + clen = data[0]; + ASSERT( clen < skb->len, goto corrupted;); + DEBUG(4, __FUNCTION__"():CONTROL_CHANNEL:len = %d\n",clen ); + skb_pull( skb, 1); + } + while( clen >= 2 ){ + data = skb->data; + indicate = 0; - - while( count < clen ){ /* * parse controlparameters and set value into structure */ - pi = data[count++]; - pl = data[count++]; - - DEBUG(0, "parse_control:instruction(0x%02x)\n",pi) ; + pi = data[0]; + plen = data[1]; + ASSERT( clen >= 2+plen, goto corrupted; ); + DEBUG(4, __FUNCTION__"():instruction=0x%02x,len=%d\n", + pi, plen) ; - /* copy a tuple into pv[] */ -#ifdef IRCOMM_DEBUG_TUPLE - printk("data:"); - for(i=0; i < pl; i++){ - pv[i] = data[count++]; - printk("%02x",pv[i]); - } - printk("\n"); -#else - for(i=0; i < pl; i++) - pv[i] = data[count++]; -#endif + switch(pi) + { + case POLL_FOR_LINE_SETTINGS: + ircomm_control_request(self, DTELINE_STATE); + break; - - /* parse pv */ - indicate = 0; - - switch(pi){ - - /* - * for 3-wire/9-wire/centronics - */ - case SERVICETYPE: - self->peer_servicetype = pv[0]; + self->servicetype = data[2]; break; + case PORT_TYPE: - self->peer_port_type = pv[0]; - break; -#if 0 - case PORT_NAME: - self->peer_port_name = *pv; - break; - case FIXED_PORT_NAME: - self->peer_port_name = *pv; - /* - * We should not connect if user of IrCOMM can't - * recognize the port name - */ - self->port_name_critical = TRUE; - break; -#endif - case DATA_RATE: - self->peer_data_rate = (pv[3]<<24) & (pv[2]<<16) - & (pv[1]<<8) & pv[0]; - indicate = 1; + self->peer_port_type = data[2]; break; + case DATA_FORMAT: - self->peer_data_format = pv[0]; + self->peer_data_format = data[2]; break; + case FLOW_CONTROL: - self->peer_flow_ctrl = pv[0]; - indicate = 1; - break; - case XON_XOFF_CHAR: - self->peer_xon_char = pv[0]; - self->peer_xoff_char = pv[1]; - indicate = 1; - break; - case ENQ_ACK_CHAR: - self->peer_enq_char = pv[0]; - self->peer_ack_char = pv[1]; + self->peer_flow_ctrl = data[2]; indicate = 1; break; + case LINESTATUS: - self->peer_line_status = pv[0]; + self->peer_line_status = data[2]; indicate = 1; break; + case BREAK_SIGNAL: - self->peer_break_signal = pv[0]; + self->peer_break_signal = data[2]; /* indicate = 1; */ break; - - /* - * for 9-wire - */ + + case DCELINE_STATE: + self->peer_dce = data[2]; + indicate = 1; + break; case DTELINE_STATE: if(self->null_modem_mode){ /* input DTR as {DSR & CD & RI} */ self->peer_dce = 0; - if(pv[0] & DELTA_DTR) - self->peer_dce |= DELTA_DSR|DELTA_RI|DELTA_DCD; - if(pv[0] & MCR_DTR) - self->peer_dce |= MSR_DSR|MSR_RI|MSR_DCD; - + if(data[2] & DELTA_DTR) + self->peer_dce |= (DELTA_DSR| + DELTA_RI| + DELTA_DCD); + if(data[2] & MCR_DTR) + self->peer_dce |= (MSR_DSR| + MSR_RI| + MSR_DCD); /* rts as cts */ - if(pv[0] & DELTA_RTS) + if(data[2] & DELTA_RTS) self->peer_dce |= DELTA_CTS; - if(pv[0] & MCR_RTS) + if(data[2] & MCR_RTS) self->peer_dce |= MSR_CTS; }else{ - self->peer_dte = pv[0]; + self->peer_dte = data[2]; } indicate = 1; break; + + case XON_XOFF_CHAR: + self->peer_xon_char = data[2]; + self->peer_xoff_char = data[3]; + indicate = 1; + break; - case DCELINE_STATE: - self->peer_dce = pv[0]; + case ENQ_ACK_CHAR: + self->peer_enq_char = data[2]; + self->peer_ack_char = data[3]; indicate = 1; break; - case POLL_FOR_LINE_SETTINGS: - ircomm_append_ctrl(self, DTELINE_STATE); - ircomm_control_request(self); + case DATA_RATE: + self->peer_data_rate = ( data[5]<<24 + & data[4]<<16 + & data[3]<<8 + & data[2]); + indicate = 1; + break; + + case PORT_NAME: + ASSERT(plen <= 32 , goto corrupted;); + memcpy(self->port_name, data + 2, plen); + *(__u8 *)(self->port_name+plen) = 0; break; - /* - * for centronics .... not implemented yet + case FIXED_PORT_NAME: + ASSERT(plen <= 32 , goto corrupted;); + memcpy(self->port_name, data + 2, plen); + *(__u8 *)(self->port_name+plen) = 0; + /* + * We should not connect if user of IrCOMM can't + * recognize the port name */ -/* case STATUS_QUERY: */ -/* case SET_BUSY_TIMEOUT: */ -/* case IEEE1284_MODE_SUPPORT: */ -/* case IEEE1284_DEVICEID: */ -/* case IEEE1284_MODE: */ -/* case IEEE1284_ECP_EPP_DATA_TRANSFER: */ - - default: - DEBUG(0, "ircomm_parse_control:not implemented " - "instruction(%d)\n", pi); + self->port_name_critical = TRUE; break; + + default: + DEBUG(0, __FUNCTION__ + "():not implemented (PI=%d)\n", pi); } - if(indicate && self->notify.flow_indication - && type == CONTROL_CHANNEL){ - - DEBUG(0,"ircomm:parse_control:indicating..:\n"); + + if(indicate && + self->notify.flow_indication && type == CONTROL_CHANNEL) + { + DEBUG(4,__FUNCTION__":indicating..:\n"); self->pi = pi; if(self->notify.flow_indication) - self->notify.flow_indication(self->notify.instance, self, 0); - indicate = 0; + self->notify.flow_indication(self->notify.instance, + self, + CONTROL_CHANNEL); + } + skb_pull(skb, 2+plen); + clen -= (2+plen); + } + + return; + + corrupted: + skb_pull(skb, skb->len); /* remove suspicious data */ + return; +} + +/* + * ---------------------------------------------------------------------- + * Function ircomm_open_instance() ,ircomm_close_instance() and friends + * + * ircomm_open_instance discoveres the peer device and then issues a + * connect request + * ---------------------------------------------------------------------- + */ + + + +/* + * ircomm_getvalue_confirm() + * handler for iriap_getvaluebyclass_request() + */ + +static void ircomm_getvalue_confirm( __u16 obj_id, struct ias_value *value, + void *priv) +{ + struct ircomm_cb *self = (struct ircomm_cb *) priv; + struct sk_buff *skb= NULL; + __u8 *frame; + ASSERT( self != NULL, return;); + ASSERT( self->magic == IRCOMM_MAGIC, return;); + + /* Check if request succeeded */ + if ( !value) { + DEBUG( 0, __FUNCTION__ "(), got NULL value!\n"); + return; + } + + DEBUG(4, __FUNCTION__"():type(%d)\n", value->type); + + self->ias_type = value->type; + switch(value->type){ + case IAS_OCT_SEQ: + + DEBUG(4, __FUNCTION__"():got octet sequence:\n"); +#if 0 + { + int i; + for ( i=0;ilen;i++) + printk("%02x", + (__u8)(*(value->t.oct_seq + i))); + printk("\n"); } +#endif + skb = dev_alloc_skb((value->len) + 2); + ASSERT(skb != NULL, return;); + frame = skb_put(skb,2); + /* MSB first */ + frame[0] = ( value->len >> 8 ) & 0xff; + frame[1] = value->len & 0xff; + + frame = skb_put(skb,value->len); + memcpy(frame, value->t.oct_seq, value->len); + ircomm_parse_tuples(self, skb, IAS_PARAM); + kfree_skb(skb); + + wake_up_interruptible( &self->ias_wait); + break; + + case IAS_INTEGER: + /* LsapSel seems to be sent to me */ + DEBUG(0, __FUNCTION__"():got lsapsel = %d\n", value->t.integer); + + if ( value->t.integer == -1){ + DEBUG( 0, __FUNCTION__"():invalid value!\n"); + return; + } + + if(self->state == COMM_IDLE){ + self->dlsap = value->t.integer; + + wake_up_interruptible( &self->ias_wait); + } + break; + + case IAS_MISSING: + DEBUG( 0, __FUNCTION__":got IAS_MISSING\n"); + break; + + default: + DEBUG( 0, __FUNCTION__":got unknown (strange?)type!\n"); + break; + } +} + + +/* + * query_lsapsel() + * quering the remote IAS to ask which + * dlsap we should use + */ + +static void query_lsapsel(struct ircomm_cb * self) +{ + DEBUG(0, __FUNCTION__"():querying IAS: Lsapsel...\n"); + + if (!(self->servicetype & THREE_WIRE_RAW)) { + iriap_getvaluebyclass_request( + "IrDA:IrCOMM", "IrDA:TinyTP:LsapSel", + self->saddr, self->daddr, + ircomm_getvalue_confirm, self ); + } else { + DEBUG(0, __FUNCTION__ "THREE_WIRE_RAW is not implemented!\n"); } - skb_pull( skb, 1+clen); +} + +/* + * ircomm_discovery_indication() + * Remote device is discovered, try query the remote IAS to see which + * device it is, and which services it has. + */ + +static void ircomm_discovery_indication(discovery_t *discovery) +{ + struct ircomm_cb *self; + + self = discovering_instance; + ASSERT(self != NULL, return;); + ASSERT(self->magic == IRCOMM_MAGIC, return;); + + self->daddr = discovery->daddr; + self->saddr = discovery->saddr; + + DEBUG( 0, __FUNCTION__"():daddr=%08x\n", self->daddr); + + wake_up_interruptible( &self->discovery_wait); return; } + +struct ircomm_cb * ircomm_open_instance( struct notify_t client_notify) +{ + int i; + struct ircomm_cb *self = NULL; + struct notify_t notify; + unsigned long flags; + + ASSERT(ircomm != NULL,return NULL;); + DEBUG(0,__FUNCTION__"():\n"); + + /* find free handle */ + + save_flags(flags); + cli(); + for(i = 0; i < IRCOMM_MAX_CONNECTION; i++){ + ASSERT(ircomm[i] != NULL,return(NULL);); + if(!ircomm[i]->in_use){ + self = ircomm[i]; + break; + } + } + + if (!self){ + DEBUG(0,__FUNCTION__"():no free handle!\n"); + return (NULL); + } + + self->in_use = 1; + restore_flags(flags); + + self->notify = client_notify; + self->ttp_stop = 0; + self->control_ch_pending = 0; + + /* register callbacks */ + + irda_notify_init(¬ify); + notify.data_indication = ircomm_accept_data_indication; + notify.connect_confirm = ircomm_accept_connect_confirm; + notify.connect_indication = ircomm_accept_connect_indication; + notify.flow_indication = ircomm_accept_flow_indication; + notify.disconnect_indication = ircomm_accept_disconnect_indication; + notify.instance = self; + strncpy( notify.name, "IrCOMM", NOTIFY_MAX_NAME); + + self->tsap = irttp_open_tsap(LSAP_ANY, DEFAULT_INITIAL_CREDIT, + ¬ify); + if(!self->tsap){ + DEBUG(0,__FUNCTION__"failed to allocate tsap\n"); + return NULL; + } + + ircomm_next_state(self, COMM_IDLE); + return (self); +} + +int ircomm_close_instance(struct ircomm_cb *self) +{ + ASSERT( self != NULL, return -EIO;); + ASSERT( self->magic == IRCOMM_MAGIC, return -EIO;); + ASSERT( self->ctrl_skb != NULL, return -EIO;); + + DEBUG(0,__FUNCTION__"()\n"); + + /* shutdown ircomm layer */ + if(self->state != COMM_IDLE && self->state != COMM_WAITI) + { + DEBUG(0,__FUNCTION__"():force disconnecting..\n"); + ircomm_disconnect_request(self, NULL, P_HIGH); + } + + skb_trim(self->ctrl_skb,0); + /* remove a tsap */ + if(self->tsap) + irttp_close_tsap(self->tsap); + self->tsap = NULL; + self->in_use = 0; + return 0; +} + + /* * ---------------------------------------------------------------------- * Function init_module(void) ,cleanup_module() @@ -1241,21 +1695,21 @@ */ #ifdef MODULE - int init_module(void) { - ircomm_init(); + int err; - DEBUG( 4, "ircomm:init_module:done\n"); - return 0; + err = ircomm_init(); + + DEBUG( 4, __FUNCTION__"():done.\n"); + return err; } void cleanup_module(void) { ircomm_cleanup(); - DEBUG( 0, "ircomm_common:cleanup_module:done.\n"); + DEBUG( 4, __FUNCTION__"():done.\n"); } - #endif /* MODULE */ /************************************************************ @@ -1278,46 +1732,85 @@ len = 0; for (i=0; iin_use == 0){ + len += sprintf(buf+len, "\tunused\n"); + continue; + } + if (ircomm[i] == NULL || ircomm[i]->magic != IRCOMM_MAGIC) { - len += sprintf(buf+len, "???\t"); - }else { - switch (ircomm[i]->servicetype) { - case UNKNOWN: - index = 0; - break; - case THREE_WIRE_RAW: - index = 1; - break; - case THREE_WIRE: - index = 2; - break; - case NINE_WIRE: - index = 3; - break; - case CENTRONICS: - index = 4; - break; - default: - index = 0; - break; - } - len += sprintf(buf+len, "service: %s\t", - ircommservicetype[index]); - if(index){ - len += sprintf(buf+len, "porttype: %s ", - ircommporttype[ircomm[i]->port_type]); - len += sprintf(buf+len, "state: %s ", - ircommstate[ircomm[i]->state]); - len += sprintf(buf+len, "user: %s ", - ircomm[i]->notify.name); - len += sprintf(buf+len, "nullmodem emulation: %s", - (ircomm[i]->null_modem_mode ? "yes":"no")); - } + len += sprintf(buf+len, "\tbroken???\n"); + continue; + } + + switch (ircomm[i]->servicetype) { + case UNKNOWN: + index = 0; + break; + case THREE_WIRE_RAW: + index = 1; + break; + case THREE_WIRE: + index = 2; + break; + case NINE_WIRE: + index = 3; + break; + case CENTRONICS: + index = 4; + break; + default: + index = 0; + break; } - len += sprintf(buf+len, "\n"); + len += sprintf(buf+len, " service: %s ", + ircommservicetype[index]); + if(!index) + continue; + + len += sprintf(buf+len, "porttype: %s ", + ircommporttype[ircomm[i]->port_type]); + len += sprintf(buf+len, "state: %s ", + ircommstate[ircomm[i]->state]); + len += sprintf(buf+len, "user: %s\n", + ircomm[i]->notify.name); + + len += sprintf(buf+len, " tx packets: %d ", + ircomm[i]->tx_packets); + len += sprintf(buf+len, "rx packets: %d ", + ircomm[i]->rx_packets); + len += sprintf(buf+len, "tx controls: %d\n", + ircomm[i]->tx_controls); + + len += sprintf(buf+len, " pending tuples: %d ", + ircomm[i]->pending_control_tuples); + len += sprintf(buf+len, " ignored tuples: %d\n", + ircomm[i]->ignored_control_tuples); + + len += sprintf(buf+len, " nullmodem emulation: %s ", + (ircomm[i]->null_modem_mode ? "yes":"no")); + len += sprintf(buf+len, "IrTTP: %s\n", + (ircomm[i]->ttp_stop ? "BUSY":"READY")); + + len += sprintf(buf+len, " Peer capability: "); + if(ircomm[i]->peer_cap & THREE_WIRE_RAW) + len += sprintf(buf+len, "3wire-raw "); + if(ircomm[i]->peer_cap & THREE_WIRE) + len += sprintf(buf+len, "3wire "); + if(ircomm[i]->peer_cap & NINE_WIRE) + len += sprintf(buf+len, "9wire "); + if(ircomm[i]->peer_cap & CENTRONICS) + len += sprintf(buf+len, "centronics"); + + len += sprintf(buf+len, "\n Port name: %s\n", + (ircomm[i]->port_name)); } + return len; } #endif /* CONFIG_PROC_FS */ + + + diff -u --recursive --new-file v2.2.5/linux/net/irda/ircomm/irvtd.c linux/net/irda/ircomm/irvtd.c --- v2.2.5/linux/net/irda/ircomm/irvtd.c Tue Dec 22 14:16:59 1998 +++ linux/net/irda/ircomm/irvtd.c Wed Dec 31 16:00:00 1969 @@ -1,153 +0,0 @@ -/********************************************************************* - * - * Filename: irvtd.c - * Version: - * Description: A virtual tty driver implementaion, - * which also may be called as "Port Emulation Entity" - * in IrCOMM specification. - * Status: Experimental. - * Author: Takahide Higuchi - * Source: irlpt.c - * - * Copyright (c) 1998, Takahide Higuchi, , - * 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. - * - * I, Takahide Higuchi, provide no warranty for any of this software. - * This material is provided "AS-IS" and at no charge. - * - ********************************************************************/ - -/* #include */ - -#include - -#include -#include - -#include -#include - -struct irvtd_cb **irvtd = NULL; -extern struct ircomm_cb **ircomm; - -#if 0 -static char *rcsid = "$Id: irvtd.c,v 1.2 1998/09/27 08:37:04 takahide Exp $"; -#endif -static char *version = "IrVTD, $Revision: 1.2 $ $Date: 1998/09/27 08:37:04 $ (Takahide Higuchi)"; - - -/************************************************************ - * init & cleanup this module - ************************************************************/ - -/* - * Function init_module(void) - * - * Initializes the ircomm control structure - * This Function is called when you do insmod. - */ - -__initfunc(int irvtd_init(void)) -{ - int i; - - DEBUG( 4, "irvtd:init_module:\n"); - printk( KERN_INFO "%s\n", version); - - /* we allocate master array */ - - irvtd = (struct irvtd_cb **) kmalloc( sizeof(void *) * - COMM_MAX_TTY,GFP_KERNEL); - if ( irvtd == NULL) { - printk( KERN_WARNING "irvtd: Can't allocate array!\n"); - return -ENOMEM; - } - - memset( irvtd, 0, sizeof(void *) * COMM_MAX_TTY); - - - /* we initialize structure */ - - for (i=0; i < COMM_MAX_TTY; i++){ - irvtd[i] = kmalloc( sizeof(struct irvtd_cb), GFP_KERNEL); - if(irvtd[i] == NULL){ - printk(KERN_ERR "ircomm_open(): kmalloc failed!\n"); - return -ENOMEM; - } - - memset( irvtd[i], 0, sizeof(struct irvtd_cb)); - irvtd[i]->magic = IRVTD_MAGIC; - } - - /* - * initialize a "port emulation entity" - */ - - if(irvtd_register_ttydriver()){ - printk( KERN_WARNING "IrCOMM: Error in ircomm_register_device\n"); - return -ENODEV; - } - - - DEBUG( 4, "irvtd:init_module:done\n"); - return 0; -} - -void irvtd_cleanup(void) -{ - int i; - DEBUG( 4, "--> ircomm:cleanup_module\n"); - - /* - * free some resources - */ - if (irvtd) { - for (i=0; i\n"); -} - -#ifdef MODULE - -int init_module(void) -{ - irvtd_init(); - return 0; -} - - -/* - * Function ircomm_cleanup (void) - * This is called when you rmmod. - */ - -void cleanup_module(void) -{ - irvtd_cleanup(); -} - -#endif /* MODULE */ - - - diff -u --recursive --new-file v2.2.5/linux/net/irda/ircomm/irvtd_driver.c linux/net/irda/ircomm/irvtd_driver.c --- v2.2.5/linux/net/irda/ircomm/irvtd_driver.c Tue Dec 22 14:16:59 1998 +++ linux/net/irda/ircomm/irvtd_driver.c Thu Apr 15 05:42:42 1999 @@ -2,7 +2,7 @@ * * Filename: irvtd_driver.c * Version: - * Description: An implementation of "port emulation entity" of IrCOMM + * Description: Virtual tty driver (the "port emulation entity" of IrCOMM) * Status: Experimental. * Author: Takahide Higuchi * Source: serial.c by Linus Torvalds @@ -22,17 +22,20 @@ ********************************************************************/ #include +#include + #include #include #include +#include #include #include #include #include +#include #include -#include #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) @@ -41,14 +44,15 @@ #define DO_RESTART #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) -static char *irvtd_ttyname = "irnine"; -struct tty_driver irvtd_drv, irvtd_callout_driver; +struct tty_driver irvtd_drv; struct tty_struct *irvtd_table[COMM_MAX_TTY]; struct termios *irvtd_termios[COMM_MAX_TTY]; struct termios *irvtd_termios_locked[COMM_MAX_TTY]; -static int ircomm_vsd_refcount; -extern struct ircomm_cb **ircomm; -extern struct irvtd_cb **irvtd; +static int irvtd_refcount; +struct irvtd_cb **irvtd = NULL; + +static char *revision_date = "Wed Mar 10 15:33:03 1999"; + /* * prototypes @@ -71,157 +75,38 @@ void irvtd_hangup(struct tty_struct *tty); void irvtd_flush_buffer(struct tty_struct *tty); -static void flush_txbuff(struct irvtd_cb *info); static void change_speed(struct irvtd_cb *driver); -static void irvtd_write_to_tty( void *instance ); - +static void irvtd_write_to_tty( struct irvtd_cb *); +static void irvtd_send_data_request( struct irvtd_cb *); static void irvtd_break(struct tty_struct *tty, int break_state); static void irvtd_send_xchar(struct tty_struct *tty, char ch); +static void irvtd_wait_until_sent(struct tty_struct *tty, int timeout); -#if 0 -static char *rcsid = "$Id: irvtd_driver.c,v 1.13 1998/12/06 10:09:07 takahide Exp $"; -#endif - - - - -/* - * Function ircomm_register_device(void) - * we register "port emulation entity"(see IrCOMM specification) here - * as a tty device. - * it will be called when you insmod. - * ( This function derives from linux/drivers/char/serial.c ) - */ - -int irvtd_register_ttydriver(void){ - - DEBUG( 4, "-->irvtd_register_ttydriver\n"); - - /* setup virtual serial port device */ - - /* Initialize the tty_driver structure ,which is defined in - tty_driver.h */ - - memset(&irvtd_drv, 0, sizeof(struct tty_driver)); - irvtd_drv.magic = IRVTD_MAGIC; - irvtd_drv.name = irvtd_ttyname; - irvtd_drv.major = IRCOMM_MAJOR; - irvtd_drv.minor_start = IRVTD_MINOR; - irvtd_drv.num = COMM_MAX_TTY; - irvtd_drv.type = TTY_DRIVER_TYPE_SERIAL; /* see tty_driver.h */ - irvtd_drv.subtype = IRVTD_TYPE_NORMAL; /* private type */ - - /* - * see drivers/char/tty_io.c and termios(3) - */ - - irvtd_drv.init_termios = tty_std_termios; - irvtd_drv.init_termios.c_cflag = - B9600 | CS8 | CREAD | HUPCL | CLOCAL; - irvtd_drv.flags = TTY_DRIVER_REAL_RAW; /* see tty_driver.h */ - irvtd_drv.refcount = &ircomm_vsd_refcount; - - /* pointer to the tty data structures */ - - irvtd_drv.table = irvtd_table; - irvtd_drv.termios = irvtd_termios; - irvtd_drv.termios_locked = irvtd_termios_locked; - - /* - * Interface table from the kernel(tty driver) to the ircomm - * layer - */ - - irvtd_drv.open = irvtd_open; - irvtd_drv.close = irvtd_close; - irvtd_drv.write = irvtd_write; - irvtd_drv.put_char = irvtd_put_char; - irvtd_drv.flush_chars = irvtd_flush_chars; - irvtd_drv.write_room = irvtd_write_room; - irvtd_drv.chars_in_buffer = irvtd_chars_in_buffer; - irvtd_drv.flush_buffer = irvtd_flush_buffer; - irvtd_drv.ioctl = irvtd_ioctl; - irvtd_drv.throttle = irvtd_throttle; - irvtd_drv.unthrottle = irvtd_unthrottle; - irvtd_drv.set_termios = irvtd_set_termios; - irvtd_drv.stop = NULL; /* irvtd_stop; */ - irvtd_drv.start = NULL; /* irvtd_start; */ - irvtd_drv.hangup = irvtd_hangup; - - irvtd_drv.send_xchar = irvtd_send_xchar; - irvtd_drv.break_ctl = irvtd_break; - irvtd_drv.read_proc = NULL; - irvtd_drv.wait_until_sent = NULL; - - /* - * The callout device is just like normal device except for - * minor number and the subtype. - */ - - /* What is difference between callout device and normal device? */ - /* My system dosen't have /dev/cua??, so we don't need it? :{| */ - irvtd_callout_driver = irvtd_drv; - irvtd_callout_driver.name = "irninecua"; - irvtd_callout_driver.minor_start = IRVTD_CALLOUT_MINOR; - irvtd_callout_driver.subtype = IRVTD_TYPE_CALLOUT; - - - if (tty_register_driver(&irvtd_drv)){ - DEBUG(0,"IrCOMM:Couldn't register tty driver\n"); - return(1); - } - if (tty_register_driver(&irvtd_callout_driver)) - DEBUG(0,"IrCOMM:Couldn't register callout tty driver\n"); - - DEBUG( 4, "irvtd_register_ttydriver: done.\n"); - return(0); -} - - -/* - * Function irvtd_unregister_device(void) - * it will be called when you rmmod - */ - -void irvtd_unregister_ttydriver(void){ - - int err; - DEBUG( 4, "--> irvtd_unregister_device\n"); - - /* unregister tty device */ - - err = tty_unregister_driver(&irvtd_drv); - if (err) - printk("IrCOMM: failed to unregister vtd driver(%d)\n",err); - err = tty_unregister_driver(&irvtd_callout_driver); - if (err) - printk("IrCOMM: failed to unregister vtd_callout driver(%d)\n", err); - - DEBUG( 4, "irvtd_unregister_device -->\n"); - return; -} +static void irvtd_start_timer( struct irvtd_cb *driver); +static void irvtd_timer_expired(unsigned long data); +static int line_info(char *buf, struct irvtd_cb *driver); +static int irvtd_read_proc(char *buf, char **start, off_t offset, int len, + int *eof, void *unused); /* * ---------------------------------------------------------------------- - * Routines for Virtual tty driver + * * - * most of infomation is descrived in linux/tty_driver.h, but - * a function ircomm_receive() derives from receive_chars() which is - * in 2.0.30 kernel (driver/char/serial.c). - * if you want to understand them, please see related kernel source - * (and my comments :). + * ---------------------------------------------------------------------- */ /* - * ---------------------------------------------------------------------- - * ircomm_receive_data() + ********************************************************************** + * + * ircomm_receive_data() and friends * * like interrupt handler in the serial.c,we receive data when * ircomm_data_indication comes - * ---------------------------------------------------------------------- + * + ********************************************************************** */ @@ -231,25 +116,22 @@ * send incoming/queued data to tty */ -static void irvtd_write_to_tty( void *instance ){ - +static void irvtd_write_to_tty( struct irvtd_cb *driver) +{ int status, c, flag; - struct sk_buff *skb; - struct irvtd_cb *driver = (struct irvtd_cb *)instance; struct tty_struct *tty = driver->tty; - /* does instance still exist ? should be checked */ - ASSERT(driver->magic == IRVTD_MAGIC, return;); - - if(driver->rx_disable ){ - DEBUG(0,__FUNCTION__"rx_disable is true:do_nothing..\n"); - return; - } - skb = skb_dequeue(&driver->rxbuff); - ASSERT(skb != NULL, return;); /* there's nothing */ - IS_SKB(skb, return;); + if(skb == NULL) + return; /* there's nothing */ + + + /* + * we should parse controlchannel field here. + * (see process_data() in ircomm.c) + */ + ircomm_parse_tuples(driver->comm, skb, CONTROL_CHANNEL); #ifdef IRVTD_DEBUG_RX printk("received data:"); @@ -264,12 +146,6 @@ status = driver->comm->peer_line_status & driver->read_status_mask; /* - * FIXME: we must do ircomm_parse_ctrl() here, instead of - * ircomm_common.c!! - */ - - - /* * if there are too many errors which make a character ignored, * drop characters */ @@ -289,7 +165,7 @@ DEBUG(0,"handling break....\n"); flag = TTY_BREAK; - if (driver->flags & IRVTD_ASYNC_SAK) + if (driver->flags & ASYNC_SAK) /* * do_SAK() seems to be an implementation of the * idea called "Secure Attention Key", @@ -311,7 +187,8 @@ flag = TTY_NORMAL; if(c){ - DEBUG(0,"writing %d chars to tty\n",c); + DEBUG(4,"writing %d chars to tty\n",c); + driver->icount.rx += c; memset(tty->flip.flag_buf_ptr, flag, c); memcpy(tty->flip.char_buf_ptr, skb->data, c); tty->flip.flag_buf_ptr += c; @@ -325,205 +202,207 @@ else { /* queue rest of data again */ - DEBUG(0,__FUNCTION__":retrying frame!\n"); + DEBUG(4,__FUNCTION__":retrying frame!\n"); + + /* build a dummy control channel */ + skb_push(skb,1); + *skb->data = 0; /* clen is 0 */ skb_queue_head( &driver->rxbuff, skb ); } - /* - * in order to optimize this routine, these two tasks should be - * queued in following order - * ( see run_task_queue() and queue_task() in tqueue.h - */ - if(skb_queue_len(&driver->rxbuff)) - /* let me try again! */ - queue_task(&driver->rx_tqueue, &tq_timer); if(c) - /* read your buffer! */ - queue_task(&tty->flip.tqueue, &tq_timer); + /* let the process read its buffer! */ + tty_flip_buffer_push(tty); - - if(skb_queue_len(&driver->rxbuff)< IRVTD_RX_QUEUE_LOW - && driver->ttp_stoprx){ + if(skb_queue_len(&driver->rxbuff)< IRVTD_RX_QUEUE_LOW && + driver->ttp_stoprx){ irttp_flow_request(driver->comm->tsap, FLOW_START); driver->ttp_stoprx = 0; } + + if(skb_queue_empty(&driver->rxbuff) && driver->disconnect_pend){ + /* disconnect */ + driver->disconnect_pend = 0; + driver->rx_disable = 1; + tty_hangup(driver->tty); + } } -void irvtd_receive_data(void *instance, void *sap, struct sk_buff *skb){ - +static int irvtd_receive_data(void *instance, void *sap, struct sk_buff *skb) +{ struct irvtd_cb *driver = (struct irvtd_cb *)instance; - ASSERT(driver != NULL, return;); - ASSERT(driver->magic == IRVTD_MAGIC, return;); + ASSERT(driver != NULL, return -1;); + ASSERT(driver->magic == IRVTD_MAGIC, return -1;); + DEBUG(4, __FUNCTION__"(): queue frame\n"); /* queue incoming data and make bottom half handler ready */ skb_queue_tail( &driver->rxbuff, skb ); - if(skb_queue_len(&driver->rxbuff) == 1) - irvtd_write_to_tty(driver); + if(skb_queue_len(&driver->rxbuff) > IRVTD_RX_QUEUE_HIGH){ irttp_flow_request(driver->comm->tsap, FLOW_STOP); driver->ttp_stoprx = 1; } - return; + return 0; } -#if 0 -void irvtd_receive_data(void *instance, void *sap, struct sk_buff *skb){ +/* + *********************************************************************** + * + * irvtd_send_data() and friends + * + * like interrupt handler in the serial.c,we send data when + * a timer is expired + * + *********************************************************************** + */ + + +static void irvtd_start_timer( struct irvtd_cb *driver) +{ + ASSERT( driver != NULL, return;); + ASSERT( driver->magic == IRVTD_MAGIC, return;); + + del_timer( &driver->timer); - int flag,status; - __u8 c; - struct tty_struct *tty; - struct irvtd_cb *driver = (struct irvtd_cb *)instance; + driver->timer.data = (unsigned long) driver; + driver->timer.function = &irvtd_timer_expired; + driver->timer.expires = jiffies + (HZ / 20); /* 50msec */ + + add_timer( &driver->timer); +} - ASSERT(driver != NULL, return;); - ASSERT(driver->magic == IRVTD_MAGIC, return;); - if(driver->rx_disable ){ - DEBUG(0,__FUNCTION__"rx_disable is true:do nothing\n"); - return; +static void irvtd_timer_expired(unsigned long data) +{ + struct irvtd_cb *driver = (struct irvtd_cb *)data; + + ASSERT(driver != NULL,return;); + ASSERT(driver->magic == IRVTD_MAGIC,return;); + DEBUG(4, __FUNCTION__"()\n"); + + if(!(driver->tty->hw_stopped) && !(driver->tx_disable)) + irvtd_send_data_request(driver); + + if(!(driver->rx_disable)){ + irvtd_write_to_tty(driver); } + + /* start our timer again and again */ + irvtd_start_timer(driver); +} - tty = driver->tty; - status = driver->comm->peer_line_status & driver->read_status_mask; - c = MIN(skb->len, (TTY_FLIPBUF_SIZE - tty->flip.count)); - DEBUG(0, __FUNCTION__"skb_len=%d, tty->flip.count=%d \n" - ,(int)skb->len, tty->flip.count); +static void irvtd_send_data_request(struct irvtd_cb *driver) +{ + int err; + struct sk_buff *skb = driver->txbuff; -#ifdef IRVTD_DEBUG_RX - printk("received data:"); + ASSERT(skb != NULL,return;); + DEBUG(4, __FUNCTION__"()\n"); + + if(!skb->len) + return; /* no data to send */ + +#ifdef IRVTD_DEBUG_TX + DEBUG(4, "flush_txbuff:count(%d)\n",(int)skb->len); { int i; for ( i=0;ilen;i++) - printk("%02x ", skb->data[i]); + printk("%02x", skb->data[i]); printk("\n"); } #endif - /* - * if there are too many errors which make a character ignored, - * drop characters - */ - - if(status & driver->ignore_status_mask){ - DEBUG(0,__FUNCTION__"I/O error:ignore characters.\n"); - dev_kfree_skb(skb, FREE_READ); - return; - } - - if (driver->comm->peer_break_signal ) { - driver->comm->peer_break_signal = 0; - DEBUG(0,"handling break....\n"); - - flag = TTY_BREAK; - if (driver->flags & IRVTD_ASYNC_SAK) - /* - * do_SAK() seems to be an implementation of the - * idea called "Secure Attention Key", - * which seems to be discribed in "Orange book". - * (which is published by U.S.military!!?? ) - * see source of do_SAK() but what is "Orange book"!? - */ - do_SAK(tty); - }else if (status & LSR_PE) - flag = TTY_PARITY; - else if (status & LSR_FE) - flag = TTY_FRAME; - else if (status & LSR_OE) - flag = TTY_OVERRUN; - else - flag = TTY_NORMAL; + DEBUG(4, __FUNCTION__"():sending %d bytes\n",(int)skb->len ); + driver->icount.tx += skb->len; + err = ircomm_data_request(driver->comm, driver->txbuff); + if (err){ + ASSERT(err == 0,;); + DEBUG(0,"%d chars are lost\n",(int)skb->len); + skb_trim(skb, 0); + } - if(c){ - DEBUG(0,"writing %d chars to tty\n",c); - memset(tty->flip.flag_buf_ptr, flag, c); - memcpy(tty->flip.char_buf_ptr, skb->data, c); - tty->flip.flag_buf_ptr += c; - tty->flip.char_buf_ptr += c; - tty->flip.count += c; - skb_pull(skb,c); - queue_task_irq_off(&tty->flip.tqueue, &tq_timer); + /* allocate a new frame */ + skb = driver->txbuff = dev_alloc_skb(driver->comm->max_txbuff_size); + if (skb == NULL){ + printk(__FUNCTION__"():flush_txbuff():alloc_skb failed!\n"); + } else { + skb_reserve(skb, COMM_HEADER_SIZE); } - if(skb->len >0) - DEBUG(0,__FUNCTION__":dropping frame!\n"); - dev_kfree_skb(skb, FREE_READ); - DEBUG(4,__FUNCTION__":done\n"); + + wake_up_interruptible(&driver->tty->write_wait); } -#endif + /* - * ---------------------------------------------------------------------- + *********************************************************************** + * * indication/confirmation handlers: - * they will be registerd in irvtd_startup() to know that we - * discovered (or we are discovered by) remote device. - * ---------------------------------------------------------------------- + * + * these routines are handlers for IrCOMM protocol stack + * + *********************************************************************** */ -/* this function is called whed ircomm_attach_cable succeed */ - -void irvtd_attached(struct ircomm_cb *comm){ - - ASSERT(comm != NULL, return;); - ASSERT(comm->magic == IRCOMM_MAGIC, return;); - - DEBUG(0,"irvtd_attached:sending connect_request" - " for servicetype(%d)..\n",comm->servicetype); - ircomm_connect_request(comm, SAR_DISABLE ); -} - /* - * irvtd_connect_confirm() - * ircomm_connect_request which we have send have succeed! + * Function irvtd_connect_confirm (instance, sap, qos, max_sdu_size, skb) + * + * ircomm_connect_request which we have send have succeed! + * */ - void irvtd_connect_confirm(void *instance, void *sap, struct qos_info *qos, - int max_sdu_size, struct sk_buff *skb){ - + __u32 max_sdu_size, struct sk_buff *skb) +{ struct irvtd_cb *driver = (struct irvtd_cb *)instance; ASSERT(driver != NULL, return;); ASSERT(driver->magic == IRVTD_MAGIC, return;); /* + * set default value + */ + + driver->msr |= (MSR_DCD|MSR_RI|MSR_DSR|MSR_CTS); + + /* * sending initial control parameters here - * - * TODO: it must be done in ircomm_connect_request() */ #if 1 if(driver->comm->servicetype == THREE_WIRE_RAW) return; /* do nothing */ - ircomm_append_ctrl(driver->comm, SERVICETYPE); - /* ircomm_append_ctrl(self, DATA_RATE); */ - ircomm_append_ctrl(driver->comm, DATA_FORMAT); - ircomm_append_ctrl(driver->comm, FLOW_CONTROL); - ircomm_append_ctrl(driver->comm, XON_XOFF_CHAR); - /* ircomm_append_ctrl(driver->comm, ENQ_ACK_CHAR); */ + ircomm_control_request(driver->comm, SERVICETYPE); + ircomm_control_request(driver->comm, DATA_RATE); + ircomm_control_request(driver->comm, DATA_FORMAT); + ircomm_control_request(driver->comm, FLOW_CONTROL); + ircomm_control_request(driver->comm, XON_XOFF_CHAR); + /* ircomm_control_request(driver->comm, ENQ_ACK_CHAR); */ switch(driver->comm->servicetype){ case CENTRONICS: break; case NINE_WIRE: - ircomm_append_ctrl(driver->comm, DTELINE_STATE); + ircomm_control_request(driver->comm, DTELINE_STATE); break; default: } - ircomm_control_request(driver->comm); #endif - + driver->tx_disable = 0; wake_up_interruptible(&driver->open_wait); } /* - * irvtd_connect_indication() - * we are discovered and being requested to connect by remote device ! + * Function irvtd_connect_indication (instance, sap, qos, max_sdu_size, skb) + * + * we are discovered and being requested to connect by remote device ! + * */ - void irvtd_connect_indication(void *instance, void *sap, struct qos_info *qos, - int max_sdu_size, struct sk_buff *skb) + __u32 max_sdu_size, struct sk_buff *skb) { struct irvtd_cb *driver = (struct irvtd_cb *)instance; @@ -539,42 +418,81 @@ ircomm_connect_response(comm, NULL, SAR_DISABLE ); + /* + * set default value + */ + driver->msr |= (MSR_DCD|MSR_RI|MSR_DSR|MSR_CTS); + driver->tx_disable = 0; wake_up_interruptible(&driver->open_wait); } - - +/* + * Function irvtd_disconnect_indication (instance, sap, reason, skb) + * + * This is a handler for ircomm_disconnect_indication. since this + * function is called in the context of interrupt handler, + * interruptible_sleep_on() MUST not be used. + */ void irvtd_disconnect_indication(void *instance, void *sap , LM_REASON reason, - struct sk_buff *skb){ - + struct sk_buff *skb) +{ struct irvtd_cb *driver = (struct irvtd_cb *)instance; + ASSERT(driver != NULL, return;); ASSERT(driver->tty != NULL, return;); ASSERT(driver->magic == IRVTD_MAGIC, return;); DEBUG(4,"irvtd_disconnect_indication:\n"); - tty_hangup(driver->tty); + + driver->tx_disable = 1; + driver->disconnect_pend = 1; } /* - * irvtd_control_indication + * Function irvtd_control_indication (instance, sap, cmd) + * + * * */ - - -void irvtd_control_indication(void *instance, void *sap, LOCAL_FLOW flow){ - +void irvtd_control_indication(void *instance, void *sap, IRCOMM_CMD cmd) +{ struct irvtd_cb *driver = (struct irvtd_cb *)instance; - __u8 pi; /* instruction of control channel */ ASSERT(driver != NULL, return;); ASSERT(driver->magic == IRVTD_MAGIC, return;); - DEBUG(0,"irvtd_control_indication:\n"); + DEBUG(4,__FUNCTION__"()\n"); - pi = driver->comm->pi; + if(cmd == TX_READY){ + driver->ttp_stoptx = 0; + driver->tty->hw_stopped = driver->cts_stoptx; + irvtd_start_timer( driver); - switch(pi){ + if(driver->cts_stoptx) + return; + + /* + * driver->tty->write_wait will keep asleep if + * our txbuff is full. + * now that we can send packets to IrTTP layer, + * we kick it here. + */ + if ((driver->tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && + driver->tty->ldisc.write_wakeup) + (driver->tty->ldisc.write_wakeup)(driver->tty); + return; + } + + if(cmd == TX_BUSY){ + driver->ttp_stoptx = driver->tty->hw_stopped = 1; + del_timer( &driver->timer); + return; + } + + + ASSERT(cmd == CONTROL_CHANNEL,return;); + + switch(driver->comm->pi){ case DCELINE_STATE: driver->msr = driver->comm->peer_dce; @@ -591,19 +509,23 @@ wake_up_interruptible(&driver->delta_msr_wait); } - if ((driver->flags & IRVTD_ASYNC_CHECK_CD) && (driver->msr & DELTA_DCD)) { + if ((driver->flags & ASYNC_CHECK_CD) && (driver->msr & DELTA_DCD)) { DEBUG(0,"CD now %s...\n", (driver->msr & MSR_DCD) ? "on" : "off"); - if (driver->msr & DELTA_DCD) + if (driver->msr & MSR_DCD) + { + /* DCD raised! */ wake_up_interruptible(&driver->open_wait); - else if (!((driver->flags & IRVTD_ASYNC_CALLOUT_ACTIVE) && - (driver->flags & IRVTD_ASYNC_CALLOUT_NOHUP))) { - - DEBUG(0,"irvtd_control_indication:hangup..\n"); + } + else + { + /* DCD falled */ + DEBUG(0,__FUNCTION__"():hangup..\n"); tty_hangup(driver->tty); } + } if (driver->comm->flow_ctrl & USE_CTS) { @@ -632,102 +554,44 @@ driver->cts_stoptx = 1; driver->tty->hw_stopped = 1; -/* driver->IER &= ~UART_IER_THRI; */ -/* serial_out(info, UART_IER, info->IER); */ } } } - - break; - case TX_READY: - driver->ttp_stoptx = 0; - driver->tty->hw_stopped = driver->cts_stoptx; - - /* - * driver->tty->write_wait will keep asleep if - * our txbuff is not empty. - * so if we can really send a packet now, - * send it and then wake it up. - */ - - if(driver->cts_stoptx) - break; - - flush_txbuff(driver); - if ((driver->tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && - driver->tty->ldisc.write_wakeup) - (driver->tty->ldisc.write_wakeup)(driver->tty); - break; - - case TX_BUSY: - driver->ttp_stoptx = driver->tty->hw_stopped = 1; - break; default: - DEBUG(0,"irvtd:unknown control..\n"); - + DEBUG(0,__FUNCTION__"():PI = 0x%02x is not implemented\n", + (int)driver->comm->pi); } } +/* + *********************************************************************** + * + * driver kernel interfaces + * these functions work as an interface between the kernel and this driver + * + *********************************************************************** + */ + + /* * ---------------------------------------------------------------------- * irvtd_open() and friends * - * * ---------------------------------------------------------------------- */ -static int irvtd_block_til_ready(struct tty_struct *tty, struct file * filp, - struct irvtd_cb *driver) -{ - - struct wait_queue wait = { current, NULL }; - int retval; - int do_clocal = 0; - - /* - * If the device is in the middle of being closed, then block - * (sleep) until it's done, and (when being woke up)then try again. - */ - - if (tty_hung_up_p(filp) || - (driver->flags & IRVTD_ASYNC_CLOSING)) { - if (driver->flags & IRVTD_ASYNC_CLOSING) - interruptible_sleep_on(&driver->close_wait); -#ifdef DO_RESTART - if (driver->flags & IRVTD_ASYNC_HUP_NOTIFY) - return -EAGAIN; - else - return -ERESTARTSYS; -#else - return -EAGAIN; -#endif - } - - /* - * If this is a callout device, then just make sure the normal - * device isn't being used. - */ +static int irvtd_block_til_ready(struct tty_struct *tty, struct file * filp, + struct irvtd_cb *driver) +{ - if (tty->driver.subtype == IRVTD_TYPE_CALLOUT) { - if (driver->flags & IRVTD_ASYNC_NORMAL_ACTIVE) - return -EBUSY; - if ((driver->flags & IRVTD_ASYNC_CALLOUT_ACTIVE) && - (driver->flags & IRVTD_ASYNC_SESSION_LOCKOUT) && - (driver->session != current->session)) - return -EBUSY; - if ((driver->flags & IRVTD_ASYNC_CALLOUT_ACTIVE) && - (driver->flags & IRVTD_ASYNC_PGRP_LOCKOUT) && - (driver->pgrp != current->pgrp)) - return -EBUSY; + struct wait_queue wait = { current, NULL }; + int retval = 0; + int do_clocal = 0; - driver->flags |= IRVTD_ASYNC_CALLOUT_ACTIVE; - return 0; - } - /* * If non-blocking mode is set, or the port is not enabled, * then make the check up front and then exit. @@ -735,64 +599,48 @@ if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) { - if (driver->flags & IRVTD_ASYNC_CALLOUT_ACTIVE) - return -EBUSY; - driver->flags |= IRVTD_ASYNC_NORMAL_ACTIVE; return 0; } - if (driver->flags & IRVTD_ASYNC_CALLOUT_ACTIVE) { - if (driver->normal_termios.c_cflag & CLOCAL) - do_clocal = 1; - } else { - if (tty->termios->c_cflag & CLOCAL) - do_clocal = 1; - } - + if (tty->termios->c_cflag & CLOCAL) + do_clocal = 1; + + /* * We wait until ircomm_connect_request() succeed or * ircomm_connect_indication comes - * - * This is what is written in serial.c: - * "Block waiting for the carrier detect and the line to become - * free (i.e., not in use by the callout). While we are in - * this loop, driver->count is dropped by one, so that - * rs_close() knows when to free things. We restore it upon - * exit, either normal or abnormal." */ - retval = 0; + add_wait_queue(&driver->open_wait, &wait); - DEBUG(0,"block_til_ready before block: line%d, count = %d\n", - driver->line, driver->count); + DEBUG(0,__FUNCTION__"():before block( line = %d, count = %d )\n", + driver->line, driver->count); - cli(); - if (!tty_hung_up_p(filp)) - driver->count--; - sti(); driver->blocked_open++; - + /* wait for a connection established */ while (1) { current->state = TASK_INTERRUPTIBLE; + + if (driver->comm->state == COMM_CONN){ + /* + * signal DTR and RTS + */ + driver->comm->dte = driver->mcr |= (MCR_DTR | + MCR_RTS | + DELTA_DTR| + DELTA_RTS ); - if (!(driver->flags & IRVTD_ASYNC_CALLOUT_ACTIVE) && - (driver->comm->state == COMM_CONN)){ - /* - * signal DTR and RTS - */ - driver->comm->dte = driver->mcr |= (MCR_DTR | MCR_RTS |DELTA_DTR|DELTA_RTS); + ircomm_control_request(driver->comm, DTELINE_STATE); + } - ircomm_append_ctrl(driver->comm, DTELINE_STATE); - ircomm_control_request(driver->comm); - } if (tty_hung_up_p(filp) || - !(driver->flags & IRVTD_ASYNC_INITIALIZED)) { + !(driver->flags & ASYNC_INITIALIZED)) { #ifdef DO_RESTART - if (driver->flags & IRVTD_ASYNC_HUP_NOTIFY) + if (driver->flags & ASYNC_HUP_NOTIFY) retval = -EAGAIN; else retval = -ERESTARTSYS; @@ -802,15 +650,9 @@ break; } - /* - * if clocal == 0 or received DCD or state become CONN,then break - */ - - if (!(driver->flags & IRVTD_ASYNC_CALLOUT_ACTIVE) && - !(driver->flags & IRVTD_ASYNC_CLOSING) && + if (!(driver->flags & ASYNC_CLOSING) && (driver->comm->state == COMM_CONN) && - ( do_clocal || (driver->msr & MSR_DCD) ) - ) + ( do_clocal || (driver->msr & MSR_DCD))) break; if(signal_pending(current)){ @@ -818,63 +660,51 @@ break; } -#ifdef IRVTD_DEBUG_OPEN - printk(KERN_INFO"block_til_ready blocking:" - " ttys%d, count = %d\n", driver->line, driver->count); -#endif + + DEBUG(4,__FUNCTION__"():blocking( %s%d, count = %d )\n", + tty->driver.name, driver->line, driver->count); + schedule(); } current->state = TASK_RUNNING; remove_wait_queue(&driver->open_wait, &wait); - if (!tty_hung_up_p(filp)) - driver->count++; driver->blocked_open--; -#ifdef IRVTD_DEBUG_OPEN - printk("block_til_ready after blocking: ttys%d, count = %d\n", - driver->line, driver->count); -#endif + + DEBUG(0, __FUNCTION__"():after blocking\n"); + if (retval) return retval; - driver->flags |= IRVTD_ASYNC_NORMAL_ACTIVE; return 0; } -static void change_speed(struct irvtd_cb *driver){ - +static void change_speed(struct irvtd_cb *driver) +{ unsigned cflag,cval; if (!driver->tty || !driver->tty->termios || !driver->comm) return; cflag = driver->tty->termios->c_cflag; - - - /* - * change baud rate here. but not implemented now - */ - - - - /* * byte size and parity */ - switch (cflag & CSIZE) { - case CS5: cval = 0x00; break; - case CS6: cval = 0x01; break; - case CS7: cval = 0x02; break; - case CS8: cval = 0x03; break; - default: cval = 0x00; break; /* too keep GCC shut... */ + switch (cflag & CSIZE) + { + case CS5: cval = IRCOMM_WLEN5; break; + case CS6: cval = IRCOMM_WLEN6; break; + case CS7: cval = IRCOMM_WLEN7; break; + case CS8: cval = IRCOMM_WLEN8; break; + default: cval = IRCOMM_WLEN5; break; /* too keep GCC shut... */ } if (cflag & CSTOPB) { /* use 2 stop bit mode */ - cval |= 0x04; + cval |= IRCOMM_STOP2; } if (cflag & PARENB) - cval |= 0x08; + cval |= IRCOMM_PARENB; /* enable parity check */ if (!(cflag & PARODD)) - cval |= 0x10; + cval |= IRCOMM_PAREVEN; /* even parity */ /* CTS flow control flag and modem status interrupts */ @@ -884,74 +714,69 @@ driver->comm->flow_ctrl |= ~USE_CTS; if (cflag & CLOCAL) - driver->flags &= ~IRVTD_ASYNC_CHECK_CD; + driver->flags &= ~ASYNC_CHECK_CD; else - driver->flags |= IRVTD_ASYNC_CHECK_CD; + driver->flags |= ASYNC_CHECK_CD; /* * Set up parity check flag */ - driver->read_status_mask = LSR_OE ; + driver->read_status_mask = LSR_OE; if (I_INPCK(driver->tty)) driver->read_status_mask |= LSR_FE | LSR_PE; if (I_BRKINT(driver->tty) || I_PARMRK(driver->tty)) driver->read_status_mask |= LSR_BI; + /* + * Characters to ignore + */ driver->ignore_status_mask = 0; + if (I_IGNPAR(driver->tty)) + driver->ignore_status_mask |= LSR_PE | LSR_FE; if (I_IGNBRK(driver->tty)) { driver->ignore_status_mask |= LSR_BI; - driver->read_status_mask |= LSR_BI; /* * If we're ignore parity and break indicators, ignore * overruns too. (For real raw support). */ - if (I_IGNPAR(driver->tty)) { - driver->ignore_status_mask |= LSR_OE | \ - LSR_PE | LSR_FE; - driver->read_status_mask |= LSR_OE | \ - LSR_PE | LSR_FE; - } + if (I_IGNPAR(driver->tty)) + driver->ignore_status_mask |= LSR_OE; } - driver->comm->data_format = cval; - ircomm_append_ctrl(driver->comm, DATA_FORMAT); - ircomm_append_ctrl(driver->comm, FLOW_CONTROL); - ircomm_control_request(driver->comm); - /* output to IrCOMM here*/ + driver->comm->data_format = cval; + ircomm_control_request(driver->comm, DATA_FORMAT); + ircomm_control_request(driver->comm, FLOW_CONTROL); } -static int irvtd_startup(struct irvtd_cb *driver){ - +static int irvtd_startup(struct irvtd_cb *driver) +{ + int retval = 0; + struct ias_object* obj; struct notify_t irvtd_notify; + /* FIXME: it should not be hard coded */ + __u8 oct_seq[6] = { 0,1,4,1,1,1 }; - DEBUG(4,"irvtd_startup:\n" ); + DEBUG(4,__FUNCTION__"()\n" ); + if(driver->flags & ASYNC_INITIALIZED) + return 0; /* * initialize our tx/rx buffer */ - if(driver->flags & IRVTD_ASYNC_INITIALIZED) - return(0); - skb_queue_head_init(&driver->rxbuff); - driver->rx_tqueue.data = driver; - driver->rx_tqueue.routine = irvtd_write_to_tty; - - if(!driver->txbuff){ - driver->txbuff = dev_alloc_skb(COMM_DEFAULT_DATA_SIZE); - if (!driver->txbuff){ - DEBUG(0,"irvtd_open():alloc_skb failed!\n"); - return -ENOMEM; - } - - skb_reserve(driver->txbuff, COMM_HEADER_SIZE); + driver->txbuff = dev_alloc_skb(COMM_DEFAULT_DATA_SIZE); + if (!driver->txbuff){ + DEBUG(0,__FUNCTION__"():alloc_skb failed!\n"); + return -ENOMEM; } + skb_reserve(driver->txbuff, COMM_HEADER_SIZE); irda_notify_init(&irvtd_notify); irvtd_notify.data_indication = irvtd_receive_data; @@ -959,19 +784,38 @@ irvtd_notify.connect_indication = irvtd_connect_indication; irvtd_notify.disconnect_indication = irvtd_disconnect_indication; irvtd_notify.flow_indication = irvtd_control_indication; + strncpy( irvtd_notify.name, "ircomm_tty", NOTIFY_MAX_NAME); irvtd_notify.instance = driver; - strncpy( irvtd_notify.name, "irvtd", NOTIFY_MAX_NAME); + driver->comm = ircomm_open_instance(irvtd_notify); + if(!driver->comm){ + return -ENODEV; + } + + + /* + * Register with LM-IAS as a server + */ + + obj = irias_new_object( "IrDA:IrCOMM", IAS_IRCOMM_ID); + irias_add_integer_attrib( obj, "IrDA:TinyTP:LsapSel", + driver->comm->tsap->stsap_sel ); + + irias_add_octseq_attrib( obj, "Parameters", &oct_seq[0], 6); + irias_insert_object( obj); + + driver->flags |= ASYNC_INITIALIZED; /* - * register ourself as a service user of IrCOMM - * TODO: other servicetype(i.e. 3wire,3wireraw) + * discover a peer device + * TODO: other servicetype(i.e. 3wire,3wireraw) support */ + retval = ircomm_query_ias_and_connect(driver->comm, NINE_WIRE); + if(retval){ + DEBUG(0, __FUNCTION__"(): ircomm_query_ias returns %d\n", + retval); + return retval; + } - driver->comm = ircomm_attach_cable(NINE_WIRE, irvtd_notify, - irvtd_attached); - if(driver->comm == NULL) - return -ENODEV; - /* * TODO:we have to initialize control-channel here! * i.e.set something into RTS,CTS and so on.... @@ -981,63 +825,83 @@ clear_bit(TTY_IO_ERROR, &driver->tty->flags); change_speed(driver); + irvtd_start_timer( driver); - driver->flags |= IRVTD_ASYNC_INITIALIZED; + driver->rx_disable = 0; + driver->tx_disable = 1; + driver->disconnect_pend = 0; return 0; } -int irvtd_open(struct tty_struct * tty, struct file * filp){ - +int irvtd_open(struct tty_struct * tty, struct file * filp) +{ struct irvtd_cb *driver; int retval; int line; - DEBUG(4, "irvtd_open():\n"); + DEBUG(4, __FUNCTION__"():\n"); + MOD_INC_USE_COUNT; line = MINOR(tty->device) - tty->driver.minor_start; - if ((line <0) || (line >= COMM_MAX_TTY)) + if ((line <0) || (line >= COMM_MAX_TTY)){ + MOD_DEC_USE_COUNT; return -ENODEV; + } + driver = irvtd[line]; - driver->line = line; + ASSERT(driver != NULL, MOD_DEC_USE_COUNT;return -ENOMEM;); + ASSERT(driver->magic == IRVTD_MAGIC, MOD_DEC_USE_COUNT;return -EINVAL;); + driver->count++; - DEBUG(0, "irvtd_open : %s%d count %d\n", tty->driver.name, line, + DEBUG(0, __FUNCTION__"():%s%d count %d\n", tty->driver.name, line, driver->count); tty->driver_data = driver; driver->tty = tty; - + driver->tty->low_latency = (driver->flags & ASYNC_LOW_LATENCY) ? 1 : 0; + + /* + * If the device is in the middle of being closed, then block + * (sleep) until it's done, then exit. + */ + + if (tty_hung_up_p(filp) || + (driver->flags & ASYNC_CLOSING)) { + if (driver->flags & ASYNC_CLOSING) + interruptible_sleep_on(&driver->close_wait); +#ifdef DO_RESTART + if (driver->flags & ASYNC_HUP_NOTIFY) + return -EAGAIN; + else + return -ERESTARTSYS; +#else + return -EAGAIN; +#endif + } + /* * start up discovering process and ircomm_layer */ retval = irvtd_startup(driver); - if (retval) + if (retval){ + DEBUG(0, __FUNCTION__"():irvtd_startup returns %d\n",retval); return retval; - MOD_INC_USE_COUNT; + } retval = irvtd_block_til_ready(tty, filp, driver); if (retval){ - DEBUG(0,"irvtd_open returning after block_til_ready with %d\n", - retval); + DEBUG(0,__FUNCTION__ + "():returning after block_til_ready (errno = %d)\n", retval); return retval; } - if ((driver->count == 1) && driver->flags & IRVTD_ASYNC_SPLIT_TERMIOS){ - if(tty->driver.subtype == IRVTD_TYPE_NORMAL) - *tty->termios = driver->normal_termios; - else - *tty->termios = driver->callout_termios; - - change_speed(driver); - } - driver->session = current->session; driver->pgrp = current->pgrp; - driver->rx_disable = 0; - return (0); + return 0; } @@ -1052,15 +916,55 @@ * ---------------------------------------------------------------------- */ +/* + * Function irvtd_wait_until_sent (tty, timeout) + * + * wait until Tx queue of IrTTP is empty + * + */ +static void irvtd_wait_until_sent(struct tty_struct *tty, int timeout) +{ + struct irvtd_cb *driver = (struct irvtd_cb *)tty->driver_data; + unsigned long orig_jiffies; + + ASSERT(driver != NULL, return;); + ASSERT(driver->magic == IRVTD_MAGIC, return;); + ASSERT(driver->comm != NULL, return;); + + DEBUG(0, __FUNCTION__"():\n"); + if(!tty->closing) + return; /* nothing to do */ + + /* + * at disconnection, we should wait until Tx queue of IrTTP is + * flushed + */ + + ircomm_disconnect_request(driver->comm, NULL, P_NORMAL); + orig_jiffies = jiffies; + + while (driver->comm->tsap->disconnect_pend) { + DEBUG(0, __FUNCTION__"():wait..\n"); + current->state = TASK_INTERRUPTIBLE; + current->counter = 0; /* make us low-priority */ + schedule_timeout(HZ); /* 1sec */ + if (signal_pending(current)) + break; + if (timeout && time_after(jiffies, orig_jiffies + timeout)) + break; + } + current->state = TASK_RUNNING; +} + static void irvtd_shutdown(struct irvtd_cb * driver) { unsigned long flags; - if (!(driver->flags & IRVTD_ASYNC_INITIALIZED)) + if (!(driver->flags & ASYNC_INITIALIZED)) return; - DEBUG(4,"irvtd_shutdown:\n"); + DEBUG(0,__FUNCTION__"()\n"); /* * This comment is written in serial.c: @@ -1075,8 +979,8 @@ driver->mcr &= ~(MCR_DTR|MCR_RTS); driver->comm->dte = driver->mcr; - ircomm_append_ctrl(driver->comm, DTELINE_STATE ); - ircomm_control_request(driver->comm); + ircomm_control_request(driver->comm, DTELINE_STATE ); + save_flags(flags); cli(); /* Disable interrupts */ @@ -1084,42 +988,49 @@ if (driver->tty) set_bit(TTY_IO_ERROR, &driver->tty->flags); - ircomm_detach_cable(driver->comm); + del_timer( &driver->timer); + + irias_delete_object("IrDA:IrCOMM"); /* * Free the transmit buffer here */ + + while(skb_queue_len(&driver->rxbuff)){ + struct sk_buff *skb; + skb = skb_dequeue( &driver->rxbuff); + dev_kfree_skb(skb); + } if(driver->txbuff){ - dev_kfree_skb(driver->txbuff); /* is it OK?*/ + dev_kfree_skb(driver->txbuff); driver->txbuff = NULL; } - - driver->flags &= ~IRVTD_ASYNC_INITIALIZED; + ircomm_close_instance(driver->comm); + driver->comm = NULL; + driver->flags &= ~ASYNC_INITIALIZED; restore_flags(flags); } - - -void irvtd_close(struct tty_struct * tty, struct file * filp){ - +void irvtd_close(struct tty_struct * tty, struct file * filp) +{ struct irvtd_cb *driver = (struct irvtd_cb *)tty->driver_data; int line; unsigned long flags; - DEBUG(0, "irvtd_close:refc(%d)\n",ircomm_vsd_refcount); + DEBUG(0, __FUNCTION__"():refcount= %d\n",irvtd_refcount); ASSERT(driver != NULL, return;); ASSERT(driver->magic == IRVTD_MAGIC, return;); save_flags(flags);cli(); - /* - * tty_hung_up_p() is defined as - * " return(filp->f_op == &hung_up_tty_fops); " - * see driver/char/tty_io.c - */ if(tty_hung_up_p(filp)){ + /* + * upper tty layer caught a HUP signal and called irvtd_hangup() + * before. so we do nothing here. + */ + DEBUG(0, __FUNCTION__"():tty_hung_up_p.\n"); MOD_DEC_USE_COUNT; restore_flags(flags); return; @@ -1127,7 +1038,7 @@ line = MINOR(tty->device) - tty->driver.minor_start; - DEBUG(0, "irvtd_close : %s%d count %d\n", tty->driver.name, line, + DEBUG(0, __FUNCTION__"():%s%d count %d\n", tty->driver.name, line, driver->count); if ((tty->count == 1) && (driver->count != 1)) { @@ -1143,313 +1054,207 @@ driver->count = 1; } if (--driver->count < 0) { - printk("irvtd_close: bad count for line%d: %d\n", + printk(KERN_ERR"irvtd_close: bad count for line%d: %d\n", line, driver->count); driver->count = 0; } if (driver->count) { /* do nothing */ + DEBUG(0, __FUNCTION__"():driver->count is not 0\n"); MOD_DEC_USE_COUNT; restore_flags(flags); return; } - driver->flags |= IRVTD_ASYNC_CLOSING; - - /* - * Save the termios structure, since this port may have - * separate termios for callout and dialin. - */ - - if (driver->flags & IRVTD_ASYNC_NORMAL_ACTIVE) - driver->normal_termios = *tty->termios; - if (driver->flags & IRVTD_ASYNC_CALLOUT_ACTIVE) - driver->callout_termios = *tty->termios; + driver->flags |= ASYNC_CLOSING; /* * Now we wait for the transmit buffer to clear; and we notify * the line discipline to only process XON/XOFF characters. */ tty->closing = 1; - if (driver->closing_wait != IRVTD_ASYNC_CLOSING_WAIT_NONE) + if (driver->closing_wait != ASYNC_CLOSING_WAIT_NONE){ + DEBUG(4, __FUNCTION__"():calling tty_wait_until_sent()\n"); tty_wait_until_sent(tty, driver->closing_wait); + } + /* + * we can send disconnect_request with P_HIGH since + * tty_wait_until_sent() and irvtd_wait_until_sent() should + * have disconnected the link + */ + ircomm_disconnect_request(driver->comm, NULL, P_HIGH); /* * Now we stop accepting input. */ driver->rx_disable = TRUE; - - /* - * Now we flush our buffer.., and shutdown ircomm service layer - */ - - /* drop our tx/rx buffer */ - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); - - while(skb_queue_len(&driver->rxbuff)){ - struct sk_buff *skb; - skb = skb_dequeue( &driver->rxbuff); - dev_kfree_skb(skb); - } - - /* drop users buffer? */ + /* drop ldisc's buffer */ if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); - + if (tty->driver.flush_buffer) + tty->driver.flush_buffer(driver->tty); tty->closing = 0; driver->tty = NULL; - /* - * ad-hoc coding: - * we wait 2 sec before ircomm_detach_cable so that - * irttp will send all contents of its queue - */ - -#if 0 - if (driver->blocked_open) { + if (driver->blocked_open) + { if (driver->close_delay) { -#endif - /* kill time */ current->state = TASK_INTERRUPTIBLE; - schedule_timeout(driver->close_delay + 2*HZ); -#if 0 + schedule_timeout(driver->close_delay); } wake_up_interruptible(&driver->open_wait); } -#endif - - driver->flags &= ~(IRVTD_ASYNC_NORMAL_ACTIVE| - IRVTD_ASYNC_CALLOUT_ACTIVE| - IRVTD_ASYNC_CLOSING); + irvtd_shutdown(driver); + driver->flags &= ~ASYNC_CLOSING; wake_up_interruptible(&driver->close_wait); - irvtd_shutdown(driver); MOD_DEC_USE_COUNT; restore_flags(flags); - DEBUG(4,"irvtd_close:done:refc(%d)\n",ircomm_vsd_refcount); + DEBUG(4, __FUNCTION__"():done\n"); } - - /* * ---------------------------------------------------------------------- * irvtd_write() and friends * This routine will be called when something data are passed from * kernel or user. - * - * NOTE:I have stolen copy_from_user() from 2.0.30 kernel(linux/isdnif.h) - * to access user space of memory carefully. Thanks a lot!:) * ---------------------------------------------------------------------- */ int irvtd_write(struct tty_struct * tty, int from_user, - const unsigned char *buf, int count){ - - struct irvtd_cb *driver = (struct irvtd_cb *)tty->driver_data; + const unsigned char *buf, int count) +{ + struct irvtd_cb *driver; int c = 0; int wrote = 0; - struct sk_buff *skb = NULL; + unsigned long flags; + struct sk_buff *skb; __u8 *frame; - DEBUG(4, "irvtd_write():\n"); + ASSERT(tty != NULL, return -EFAULT;); + driver = (struct irvtd_cb *)tty->driver_data; + ASSERT(driver != NULL, return -EFAULT;); + ASSERT(driver->magic == IRVTD_MAGIC, return -EFAULT;); - if (!tty || !driver->txbuff) - return 0; + DEBUG(4, __FUNCTION__"()\n"); - + save_flags(flags); while(1){ + cli(); skb = driver->txbuff; - - c = MIN(count, (skb_tailroom(skb) - COMM_HEADER_SIZE)); - if (c <= 0) + ASSERT(skb != NULL, break;); + c = MIN(count, (skb_tailroom(skb))); + if (c <= 0) break; /* write to the frame */ - frame = skb_put(skb,c); if(from_user){ copy_from_user(frame,buf,c); } else memcpy(frame, buf, c); - /* flush the frame */ - irvtd_flush_chars(tty); + restore_flags(flags); wrote += c; count -= c; + buf += c; } + restore_flags(flags); return (wrote); } /* - * ---------------------------------------------------------------------- - * irvtd_put_char() - * This routine is called by the kernel to pass a single character. - * If we exausted our buffer,we can ignore the character! - * ---------------------------------------------------------------------- + * Function irvtd_put_char (tty, ch) + * + * This routine is called by the kernel to pass a single character. + * If we exausted our buffer,we can ignore the character! + * */ -void irvtd_put_char(struct tty_struct *tty, unsigned char ch){ - +void irvtd_put_char(struct tty_struct *tty, unsigned char ch) +{ __u8 *frame ; struct irvtd_cb *driver = (struct irvtd_cb *)tty->driver_data; - struct sk_buff *skb = driver->txbuff; + struct sk_buff *skb; + unsigned long flags; - ASSERT(tty->driver_data != NULL, return;); + ASSERT(driver != NULL, return;); + DEBUG(4, __FUNCTION__"()\n"); - DEBUG(4, "irvtd_put_char:\n"); - if(!driver->txbuff) - return; + save_flags(flags);cli(); + skb = driver->txbuff; + ASSERT(skb != NULL,return;); + ASSERT(skb_tailroom(skb) > 0, return;); DEBUG(4, "irvtd_put_char(0x%02x) skb_len(%d) MAX(%d):\n", - (int)ch ,(int)skb->len, - driver->comm->maxsdusize - COMM_HEADER_SIZE); - - /* append a character */ - - frame = skb_put(skb,1); - frame[0] = ch; - return; -} - -/* - * ---------------------------------------------------------------------- - * irvtd_flush_chars() and friend - * This routine will be called after a series of characters was written using - * irvtd_put_char().We have to send them down to IrCOMM. - * ---------------------------------------------------------------------- - */ - -static void flush_txbuff(struct irvtd_cb *driver){ - - struct sk_buff *skb = driver->txbuff; - struct tty_struct *tty = driver->tty; - ASSERT(tty != NULL, return;); - -#ifdef IRVTD_DEBUG_TX - printk("flush_txbuff:"); - { - int i; - for ( i=0;ilen;i++) - printk("%02x", skb->data[i]); - printk("\n"); - } -#else - DEBUG(4, "flush_txbuff:count(%d)\n",(int)skb->len); -#endif - - /* add "clen" field */ - skb_push(skb,1); - skb->data[0]=0; /* without control channel */ - - ircomm_data_request(driver->comm, driver->txbuff); - - /* allocate new frame */ - skb = driver->txbuff = dev_alloc_skb(driver->comm->max_txbuff_size); - if (skb == NULL){ - printk(KERN_ERR"flush_txbuff():alloc_skb failed!\n"); - } else { - skb_reserve(skb, COMM_HEADER_SIZE); - } - wake_up_interruptible(&driver->tty->write_wait); -} - -void irvtd_flush_chars(struct tty_struct *tty){ - - struct irvtd_cb *driver = (struct irvtd_cb *)tty->driver_data; - if(!driver || driver->magic != IRVTD_MAGIC || !driver->txbuff){ - DEBUG(0,"irvtd_flush_chars:null structure:ignore\n"); - return; - } - DEBUG(4, "irvtd_flush_chars():\n"); - - while(tty->hw_stopped){ - DEBUG(4,"irvtd_flush_chars:hw_stopped:sleep..\n"); - tty_wait_until_sent(tty,0); - DEBUG(4,"irvtd_flush_chars:waken up!\n"); - if(!driver->txbuff->len) - return; - } - - flush_txbuff(driver); -} - + (int)ch ,(int)skb->len, + driver->comm->max_txbuff_size - COMM_HEADER_SIZE); + /* append a character */ + frame = skb_put(skb,1); + frame[0] = ch; + restore_flags(flags); + return; +} /* - * ---------------------------------------------------------------------- - * irvtd_write_room() - * This routine returns the room that our buffer has now. + * Function irvtd_write_room (tty) + * + * This routine returns the room that our buffer has now. * - * NOTE: - * driver/char/n_tty.c drops a character(s) when this routine returns 0, - * and then linux will be frozen after a few minutes :( why? bug? - * ( I found this on linux-2.0.33 ) - * So this routine flushes a buffer if there is few room, TH - * ---------------------------------------------------------------------- */ - int irvtd_write_room(struct tty_struct *tty){ int ret; - struct sk_buff *skb = (struct sk_buff *)((struct irvtd_cb *) tty->driver_data)->txbuff; - - if(!skb){ - DEBUG(0,"irvtd_write_room:NULL skb\n"); - return(0); - } - - ret = skb_tailroom(skb) - COMM_HEADER_SIZE; + struct sk_buff *skb = ((struct irvtd_cb *) tty->driver_data)->txbuff; - if(ret < 0){ - DEBUG(0,"irvtd_write_room:error:room is %d!",ret); - ret = 0; - } - DEBUG(4, "irvtd_write_room:\n"); - DEBUG(4, "retval(%d)\n",ret); + ASSERT(skb !=NULL, return 0;); + ret = skb_tailroom(skb); - /* flush buffer automatically to avoid kernel freeze :< */ - if(ret < 8) /* why 8? there's no reason :) */ - irvtd_flush_chars(tty); + DEBUG(4, __FUNCTION__"(): room is %d bytes\n",ret); return(ret); } /* - * ---------------------------------------------------------------------- - * irvtd_chars_in_buffer() - * This function returns how many characters which have not been sent yet - * are still in buffer. - * ---------------------------------------------------------------------- + * Function irvtd_chars_in_buffer (tty) + * + * This function returns how many characters which have not been sent yet + * are still in buffer. + * */ - int irvtd_chars_in_buffer(struct tty_struct *tty){ - struct sk_buff *skb = - (struct sk_buff *) ((struct irvtd_cb *)tty->driver_data) ->txbuff; - DEBUG(4, "irvtd_chars_in_buffer()\n"); - - if(!skb){ - printk(KERN_ERR"irvtd_chars_in_buffer:NULL skb\n"); - return(0); - } + struct sk_buff *skb; + unsigned long flags; + + DEBUG(4, __FUNCTION__"()\n"); + + save_flags(flags);cli(); + skb = ((struct irvtd_cb *) tty->driver_data)->txbuff; + if(skb == NULL) goto err; + + restore_flags(flags); return (skb->len ); +err: + ASSERT(skb != NULL, ;); + restore_flags(flags); + return 0; /* why not -EFAULT or such? see driver/char/serial.c */ } /* - * ---------------------------------------------------------------------- - * irvtd_break() - * routine which turns the break handling on or off - * ---------------------------------------------------------------------- + * Function irvtd_break (tty, break_state) + * + * Routine which turns the break handling on or off + * */ - static void irvtd_break(struct tty_struct *tty, int break_state){ struct irvtd_cb *driver = (struct irvtd_cb *)tty->driver_data; @@ -1463,14 +1268,14 @@ if (break_state == -1) { driver->comm->break_signal = 0x01; - ircomm_append_ctrl(driver->comm, BREAK_SIGNAL); - ircomm_control_request(driver->comm); + ircomm_control_request(driver->comm, BREAK_SIGNAL); + } else { driver->comm->break_signal = 0x00; - ircomm_append_ctrl(driver->comm, BREAK_SIGNAL); - ircomm_control_request(driver->comm); + ircomm_control_request(driver->comm, BREAK_SIGNAL); + } restore_flags(flags); @@ -1497,8 +1302,7 @@ | ((driver->msr & DELTA_RI) ? TIOCM_RNG : 0) | ((driver->msr & DELTA_DSR) ? TIOCM_DSR : 0) | ((driver->msr & DELTA_CTS) ? TIOCM_CTS : 0); - put_user(result,value); - return 0; + return put_user(result,value); } static int set_modem_info(struct irvtd_cb * driver, unsigned int cmd, @@ -1537,19 +1341,111 @@ } driver->comm->dte = driver->mcr; - ircomm_append_ctrl(driver->comm, DTELINE_STATE ); - ircomm_control_request(driver->comm); + ircomm_control_request(driver->comm, DTELINE_STATE ); + return 0; } -int irvtd_ioctl(struct tty_struct *tty, struct file * file, - unsigned int cmd, unsigned long arg){ +static int get_serial_info(struct irvtd_cb * driver, + struct serial_struct * retinfo) +{ + struct serial_struct tmp; + + if (!retinfo) + return -EFAULT; + memset(&tmp, 0, sizeof(tmp)); + tmp.line = driver->line; + tmp.flags = driver->flags; + tmp.baud_base = driver->comm->data_rate; + tmp.close_delay = driver->close_delay; + tmp.closing_wait = driver->closing_wait; + + /* for compatibility */ + + tmp.type = PORT_16550A; + tmp.port = 0; + tmp.irq = 0; + tmp.xmit_fifo_size = 0; + tmp.hub6 = 0; + tmp.custom_divisor = driver->custom_divisor; + + if (copy_to_user(retinfo,&tmp,sizeof(*retinfo))) + return -EFAULT; + return 0; +} + +static int set_serial_info(struct irvtd_cb * driver, + struct serial_struct * new_info) +{ + struct serial_struct new_serial; + struct irvtd_cb old_driver; + + if (copy_from_user(&new_serial,new_info,sizeof(new_serial))) + return -EFAULT; + + old_driver = *driver; + + if (!capable(CAP_SYS_ADMIN)) { + if ((new_serial.baud_base != driver->comm->data_rate) || + (new_serial.close_delay != driver->close_delay) || + ((new_serial.flags & ~ASYNC_USR_MASK) != + (driver->flags & ~ASYNC_USR_MASK))) + return -EPERM; + driver->flags = ((driver->flags & ~ASYNC_USR_MASK) | + (new_serial.flags & ASYNC_USR_MASK)); + driver->custom_divisor = new_serial.custom_divisor; + goto check_and_exit; + } + /* + * OK, past this point, all the error checking has been done. + * At this point, we start making changes..... + */ + + if(driver->comm->data_rate != new_serial.baud_base){ + driver->comm->data_rate = new_serial.baud_base; + if(driver->comm->state == COMM_CONN) + ircomm_control_request(driver->comm,DATA_RATE); + } + driver->close_delay = new_serial.close_delay * HZ/100; + driver->closing_wait = new_serial.closing_wait * HZ/100; + driver->custom_divisor = new_serial.custom_divisor; + + driver->flags = ((driver->flags & ~ASYNC_FLAGS) | + (new_serial.flags & ASYNC_FLAGS)); + driver->tty->low_latency = (driver->flags & ASYNC_LOW_LATENCY) ? 1 : 0; + + check_and_exit: + if (driver->flags & ASYNC_INITIALIZED) { + if (((old_driver.flags & ASYNC_SPD_MASK) != + (driver->flags & ASYNC_SPD_MASK)) || + (old_driver.custom_divisor != driver->custom_divisor)) { + if ((driver->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) + driver->tty->alt_speed = 57600; + if ((driver->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) + driver->tty->alt_speed = 115200; + if ((driver->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) + driver->tty->alt_speed = 230400; + if ((driver->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) + driver->tty->alt_speed = 460800; + change_speed(driver); + } + } + return 0; +} + + + + +int irvtd_ioctl(struct tty_struct *tty, struct file * file, + unsigned int cmd, unsigned long arg) +{ int error; + unsigned long flags; struct irvtd_cb *driver = (struct irvtd_cb *)tty->driver_data; - struct icounter_struct cnow; - struct icounter_struct *p_cuser; /* user space */ + struct serial_icounter_struct cnow,cprev; + struct serial_icounter_struct *p_cuser; /* user space */ DEBUG(4,"irvtd_ioctl:requested ioctl(0x%08x)\n",cmd); @@ -1557,7 +1453,6 @@ #ifdef IRVTD_DEBUG_IOCTL { /* kill time so that debug messages will come slowly */ - unsigned long flags; save_flags(flags);cli(); current->state = TASK_INTERRUPTIBLE; current->timeout = jiffies + HZ/4; /*0.25sec*/ @@ -1572,7 +1467,6 @@ (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) && (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { if (tty->flags & (1 << TTY_IO_ERROR)){ - DEBUG(0,"irvtd_ioctl:I/O error...\n"); return -EIO; } } @@ -1580,143 +1474,89 @@ switch (cmd) { case TIOCMGET: - error = verify_area(VERIFY_WRITE, (void *) arg, - sizeof(unsigned int)); - if (error) - return error; return get_modem_info(driver, (unsigned int *) arg); case TIOCMBIS: case TIOCMBIC: case TIOCMSET: return set_modem_info(driver, cmd, (unsigned int *) arg); -#if 0 - /* - * we wouldn't implement them since we don't use serial_struct - */ case TIOCGSERIAL: - error = verify_area(VERIFY_WRITE, (void *) arg, - sizeof(struct serial_struct)); - if (error) - return error; - return irvtd_get_serial_info(driver, - (struct serial_struct *) arg); + return get_serial_info(driver, (struct serial_struct *) arg); case TIOCSSERIAL: - error = verify_area(VERIFY_READ, (void *) arg, - sizeof(struct serial_struct)); - if (error) - return error; - return irvtd_set_serial_info(driver, - (struct serial_struct *) arg); - - - case TIOCSERGETLSR: /* Get line status register */ - error = verify_area(VERIFY_WRITE, (void *) arg, - sizeof(unsigned int)); - if (error) - return error; - else - return get_lsr_info(driver, (unsigned int *) arg); -#endif - -/* - * I think we don't need them - */ -/* case TIOCSERCONFIG: */ - + return set_serial_info(driver, (struct serial_struct *) arg); -/* - * They cannot be implemented because we don't use async_struct - * which is defined in serial.h - */ - -/* case TIOCSERGSTRUCT: */ -/* error = verify_area(VERIFY_WRITE, (void *) arg, */ -/* sizeof(struct async_struct)); */ -/* if (error) */ -/* return error; */ -/* memcpy_tofs((struct async_struct *) arg, */ -/* driver, sizeof(struct async_struct)); */ -/* return 0; */ - -/* case TIOCSERGETMULTI: */ -/* error = verify_area(VERIFY_WRITE, (void *) arg, */ -/* sizeof(struct serial_multiport_struct)); */ -/* if (error) */ -/* return error; */ -/* return get_multiport_struct(driver, */ -/* (struct serial_multiport_struct *) arg); */ -/* case TIOCSERSETMULTI: */ -/* error = verify_area(VERIFY_READ, (void *) arg, */ -/* sizeof(struct serial_multiport_struct)); */ -/* if (error) */ -/* return error; */ -/* return set_multiport_struct(driver, */ -/* (struct serial_multiport_struct *) arg); */ - /* - * 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 - */ case TIOCMIWAIT: + save_flags(flags); cli(); + /* note the counters on entry */ + cprev = driver->icount; + restore_flags(flags); while (1) { interruptible_sleep_on(&driver->delta_msr_wait); - /* see if a signal did it */ -/* if (current->signal & ~current->blocked) */ -/* return -ERESTARTSYS; */ - - if ( ((arg & TIOCM_RNG) && (driver->msr & DELTA_RI)) || - ((arg & TIOCM_DSR) && (driver->msr & DELTA_DSR)) || - ((arg & TIOCM_CD) && (driver->msr & DELTA_DCD)) || - ((arg & TIOCM_CTS) && (driver->msr & DELTA_CTS))) { + /* see if a signal did it */ + if (signal_pending(current)) + return -ERESTARTSYS; + save_flags(flags); cli(); + cnow = driver->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 */ - case TIOCGICOUNT: - /* - * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) - * Return: write counters to the user passed counter struct - * NB: both 1->0 and 0->1 transitions are counted except for - * RI where only 0->1 is counted. - */ - error = verify_area(VERIFY_WRITE, (void *) arg, - sizeof(struct icounter_struct)); - if (error) - return error; - cli(); + save_flags(flags); cli(); cnow = driver->icount; - sti(); - p_cuser = (struct icounter_struct *) arg; - put_user(cnow.cts, &p_cuser->cts); - put_user(cnow.dsr, &p_cuser->dsr); - put_user(cnow.rng, &p_cuser->rng); - put_user(cnow.dcd, &p_cuser->dcd); + restore_flags(flags); + p_cuser = (struct serial_icounter_struct *) arg; + error = put_user(cnow.cts, &p_cuser->cts); + if (error) return error; + error = put_user(cnow.dsr, &p_cuser->dsr); + if (error) return error; + error = put_user(cnow.rng, &p_cuser->rng); + if (error) return error; + error = put_user(cnow.dcd, &p_cuser->dcd); + if (error) return error; + error = put_user(cnow.rx, &p_cuser->rx); + if (error) return error; + error = put_user(cnow.tx, &p_cuser->tx); + if (error) return error; + error = put_user(cnow.frame, &p_cuser->frame); + if (error) return error; + error = put_user(cnow.overrun, &p_cuser->overrun); + if (error) return error; + error = put_user(cnow.parity, &p_cuser->parity); + if (error) return error; + error = put_user(cnow.brk, &p_cuser->brk); + if (error) return error; + error = put_user(cnow.buf_overrun, &p_cuser->buf_overrun); + if (error) return error; return 0; + + + /* ioctls which are imcompatible with serial.c */ - - case TIOCGSERIAL: - case TIOCSSERIAL: + case TIOCSERGSTRUCT: + DEBUG(0,__FUNCTION__"():sorry, TIOCSERGSTRUCT is not supported\n"); + return -ENOIOCTLCMD; case TIOCSERGETLSR: + DEBUG(0,__FUNCTION__"():sorry, TIOCSERGETLSR is not supported\n"); + return -ENOIOCTLCMD; case TIOCSERCONFIG: - case TIOCSERGWILD: - case TIOCSERSWILD: - case TIOCSERGSTRUCT: - case TIOCSERGETMULTI: - case TIOCSERSETMULTI: - DEBUG(0,"irvtd_ioctl:sorry, ioctl(0x%08x)is not implemented\n",cmd); - return -ENOIOCTLCMD; /* ioctls which are imcompatible with serial.c */ - - case TCSETS: - case TCGETS: - case TCFLSH: + DEBUG(0,__FUNCTION__"():sorry, TIOCSERCONFIG is not supported\n"); + return -ENOIOCTLCMD; + + default: - return -ENOIOCTLCMD; /* ioctls which we must not touch */ + return -ENOIOCTLCMD; /* ioctls which we must ignore */ } return 0; } @@ -1781,8 +1621,8 @@ driver->mcr &= ~MCR_RTS; driver->mcr |= DELTA_RTS; driver->comm->dte = driver->mcr; - ircomm_append_ctrl(driver->comm, DTELINE_STATE ); - ircomm_control_request(driver->comm); + ircomm_control_request(driver->comm, DTELINE_STATE ); + irttp_flow_request(driver->comm->tsap, FLOW_STOP); } @@ -1795,8 +1635,8 @@ driver->mcr |= (MCR_RTS|DELTA_RTS); driver->comm->dte = driver->mcr; - ircomm_append_ctrl(driver->comm, DTELINE_STATE ); - ircomm_control_request(driver->comm); + ircomm_control_request(driver->comm, DTELINE_STATE ); + irttp_flow_request(driver->comm->tsap, FLOW_START); } @@ -1829,19 +1669,17 @@ * ------------------------------------------------------------ * irvtd_hangup() * This routine notifies that tty layer have got HUP signal - * Is this routine right ? :{| * ------------------------------------------------------------ */ void irvtd_hangup(struct tty_struct *tty){ struct irvtd_cb *info = (struct irvtd_cb *)tty->driver_data; - DEBUG(0, "irvtd_hangup()\n"); + DEBUG(0, __FUNCTION__"()\n"); irvtd_flush_buffer(tty); irvtd_shutdown(info); info->count = 0; - info->flags &= ~(IRVTD_ASYNC_NORMAL_ACTIVE|IRVTD_ASYNC_CALLOUT_ACTIVE); info->tty = NULL; wake_up_interruptible(&info->open_wait); } @@ -1851,15 +1689,18 @@ struct irvtd_cb *driver = (struct irvtd_cb *)tty->driver_data; struct sk_buff *skb; - skb = (struct sk_buff *)driver->txbuff; + skb = driver->txbuff; + ASSERT(skb != NULL, return;); - DEBUG(4, "irvtd_flush_buffer:%d chars are gone..\n",(int)skb->len); - skb_trim(skb,0); + if(skb->len){ + DEBUG(0, __FUNCTION__"():%d chars in txbuff are lost..\n",(int)skb->len); + skb_trim(skb,0); + } /* write_wait is a wait queue of tty_wait_until_sent(). * see tty_io.c of kernel */ - wake_up_interruptible(&tty->write_wait); + wake_up_interruptible(&tty->write_wait); if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup) @@ -1867,3 +1708,275 @@ } + +/* + * Function ircomm_register_device(void), init_module() and friends + * + * we register "port emulation entity"(see IrCOMM specification) here + * as a tty device. + */ + +int irvtd_register_ttydriver(void){ + + DEBUG( 4, "-->irvtd_register_ttydriver\n"); + + /* setup virtual serial port device */ + + /* Initialize the tty_driver structure ,which is defined in + tty_driver.h */ + + memset(&irvtd_drv, 0, sizeof(struct tty_driver)); + irvtd_drv.magic = IRVTD_MAGIC; + irvtd_drv.driver_name = "IrCOMM_tty"; + irvtd_drv.name = "irnine"; + irvtd_drv.major = IRCOMM_MAJOR; + irvtd_drv.minor_start = IRVTD_MINOR; + irvtd_drv.num = COMM_MAX_TTY; + irvtd_drv.type = TTY_DRIVER_TYPE_SERIAL; /* see tty_driver.h */ + + + /* + * see drivers/char/tty_io.c and termios(3) + */ + + irvtd_drv.init_termios = tty_std_termios; + irvtd_drv.init_termios.c_cflag = + B9600 | CS8 | CREAD | HUPCL | CLOCAL; + irvtd_drv.flags = TTY_DRIVER_REAL_RAW; /* see tty_driver.h */ + irvtd_drv.refcount = &irvtd_refcount; + + /* pointer to the tty data structures */ + + irvtd_drv.table = irvtd_table; + irvtd_drv.termios = irvtd_termios; + irvtd_drv.termios_locked = irvtd_termios_locked; + + /* + * Interface table from the kernel(tty driver) to the ircomm + * layer + */ + + irvtd_drv.open = irvtd_open; + irvtd_drv.close = irvtd_close; + irvtd_drv.write = irvtd_write; + irvtd_drv.put_char = irvtd_put_char; + irvtd_drv.flush_chars = NULL; + irvtd_drv.write_room = irvtd_write_room; + irvtd_drv.chars_in_buffer = irvtd_chars_in_buffer; + irvtd_drv.flush_buffer = irvtd_flush_buffer; + irvtd_drv.ioctl = irvtd_ioctl; + irvtd_drv.throttle = irvtd_throttle; + irvtd_drv.unthrottle = irvtd_unthrottle; + irvtd_drv.set_termios = irvtd_set_termios; + irvtd_drv.stop = NULL; /* irvtd_stop; */ + irvtd_drv.start = NULL; /* irvtd_start; */ + irvtd_drv.hangup = irvtd_hangup; + + irvtd_drv.send_xchar = irvtd_send_xchar; + irvtd_drv.break_ctl = irvtd_break; + irvtd_drv.read_proc = irvtd_read_proc; + irvtd_drv.wait_until_sent = irvtd_wait_until_sent; + + + + if (tty_register_driver(&irvtd_drv)){ + DEBUG(0,"IrCOMM:Couldn't register tty driver\n"); + return(1); + } + + DEBUG( 4, "irvtd_register_ttydriver: done.\n"); + return(0); +} + + +/* + * Function irvtd_unregister_device(void) + * it will be called when you rmmod + */ + +void irvtd_unregister_ttydriver(void){ + + int err; + DEBUG( 4, "--> irvtd_unregister_device\n"); + + /* unregister tty device */ + + err = tty_unregister_driver(&irvtd_drv); + if (err) + printk("IrCOMM: failed to unregister vtd driver(%d)\n",err); + DEBUG( 4, "irvtd_unregister_device -->\n"); + return; +} + +/* + ********************************************************************** + * proc stuff + * + ********************************************************************** + */ + +static int line_info(char *buf, struct irvtd_cb *driver) +{ + int ret=0; + + ASSERT(driver != NULL,goto exit;); + ASSERT(driver->magic == IRVTD_MAGIC,goto exit;); + + ret += sprintf(buf, "tx: %d rx: %d" + ,driver->icount.tx, driver->icount.rx); + + if (driver->icount.frame) + ret += sprintf(buf+ret, " fe:%d", driver->icount.frame); + if (driver->icount.parity) + ret += sprintf(buf+ret, " pe:%d", driver->icount.parity); + if (driver->icount.brk) + ret += sprintf(buf+ret, " brk:%d", driver->icount.brk); + if (driver->icount.overrun) + ret += sprintf(buf+ret, " oe:%d", driver->icount.overrun); + + if (driver->mcr & MCR_RTS) + ret += sprintf(buf+ret, "|RTS"); + if (driver->msr & MSR_CTS) + ret += sprintf(buf+ret, "|CTS"); + if (driver->mcr & MCR_DTR) + ret += sprintf(buf+ret, "|DTR"); + if (driver->msr & MSR_DSR) + ret += sprintf(buf+ret, "|DSR"); + if (driver->msr & MSR_DCD) + ret += sprintf(buf+ret, "|CD"); + if (driver->msr & MSR_RI) + ret += sprintf(buf+ret, "|RI"); + + exit: + ret += sprintf(buf+ret, "\n"); + return ret; +} + + + +static int irvtd_read_proc(char *buf, char **start, off_t offset, int len, + int *eof, void *unused) +{ + int i, count = 0, l; + off_t begin = 0; + + count += sprintf(buf, "driver revision:%s\n", revision_date); + for (i = 0; i < COMM_MAX_TTY && count < 4000; i++) { + l = line_info(buf + count, irvtd[i]); + count += l; + if (count+begin > offset+len) + goto done; + if (count+begin < offset) { + begin += count; + count = 0; + } + } + *eof = 1; +done: + if (offset >= count+begin) + return 0; + *start = buf + (begin-offset); + return ((len < begin+count-offset) ? len : begin+count-offset); +} + + + + +/************************************************************ + * init & cleanup this module + ************************************************************/ + +__initfunc(int irvtd_init(void)) +{ + int i; + + DEBUG( 4, __FUNCTION__"()\n"); + printk( KERN_INFO + "ircomm_tty: virtual tty driver for IrCOMM ( revision:%s )\n", + revision_date); + + + /* allocate a master array */ + + irvtd = (struct irvtd_cb **) kmalloc( sizeof(void *) * + COMM_MAX_TTY,GFP_KERNEL); + if ( irvtd == NULL) { + printk( KERN_WARNING __FUNCTION__"(): kmalloc failed!\n"); + return -ENOMEM; + } + + memset( irvtd, 0, sizeof(void *) * COMM_MAX_TTY); + + for (i=0; i < COMM_MAX_TTY; i++){ + irvtd[i] = kmalloc( sizeof(struct irvtd_cb), GFP_KERNEL); + if(irvtd[i] == NULL){ + printk(KERN_ERR __FUNCTION__"(): kmalloc failed!\n"); + return -ENOMEM; + } + memset( irvtd[i], 0, sizeof(struct irvtd_cb)); + irvtd[i]->magic = IRVTD_MAGIC; + irvtd[i]->line = i; + irvtd[i]->closing_wait = 30*HZ ; + irvtd[i]->close_delay = 5*HZ/10 ; + } + + /* + * initialize a "port emulation entity" + */ + + if(irvtd_register_ttydriver()){ + printk( KERN_WARNING "IrCOMM: Error in ircomm_register_device\n"); + return -ENODEV; + } + + return 0; +} + +void irvtd_cleanup(void) +{ + int i; + DEBUG( 4, __FUNCTION__"()\n"); + + /* + * free some resources + */ + if (irvtd) { + for (i=0; icomm) + ircomm_close_instance(irvtd[i]->comm); + if(irvtd[i]->txbuff) + dev_kfree_skb(irvtd[i]->txbuff); + DEBUG( 4, "freeing structures\n"); + kfree(irvtd[i]); + irvtd[i] = NULL; + } + } + DEBUG( 4, "freeing master array\n"); + kfree(irvtd); + irvtd = NULL; + } + + irvtd_unregister_ttydriver(); + +} + +#ifdef MODULE + +int init_module(void) +{ + irvtd_init(); + return 0; +} + +/* + * Function ircomm_cleanup (void) + * This is called when you rmmod. + */ + +void cleanup_module(void) +{ + irvtd_cleanup(); +} + +#endif /* MODULE */ diff -u --recursive --new-file v2.2.5/linux/net/irda/irda_device.c linux/net/irda/irda_device.c --- v2.2.5/linux/net/irda/irda_device.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irda_device.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Wed Sep 2 20:22:08 1998 - * Modified at: Tue Feb 16 17:36:04 1999 + * Modified at: Wed Apr 7 17:16:54 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -108,11 +109,11 @@ void irda_device_cleanup(void) { - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( irda_device != NULL, return;); + ASSERT(irda_device != NULL, return;); - hashbin_delete( irda_device, (FREE_FUNC) irda_device_close); + hashbin_delete(irda_device, (FREE_FUNC) irda_device_close); } /* @@ -121,80 +122,83 @@ * Open a new IrDA port device * */ -int irda_device_open( struct irda_device *self, char *name, void *priv) +int irda_device_open(struct irda_device *self, char *name, void *priv) { int result; int i=0; - - /* Check that a minimum of allocation flags are specified */ - ASSERT(( self->rx_buff.flags & (GFP_KERNEL|GFP_ATOMIC)) != 0, - return -1;); - ASSERT(( self->tx_buff.flags & (GFP_KERNEL|GFP_ATOMIC)) != 0, - return -1;); - - ASSERT( self->tx_buff.truesize > 0, return -1;); - ASSERT( self->rx_buff.truesize > 0, return -1;); - - self->rx_buff.data = ( __u8 *) kmalloc( self->rx_buff.truesize, - self->rx_buff.flags); - self->tx_buff.data = ( __u8 *) kmalloc( self->tx_buff.truesize, - self->tx_buff.flags); - - if ( self->rx_buff.data == NULL || self->tx_buff.data == NULL) { - DEBUG( 0, "IrDA Self: no space for buffers!\n"); - irda_device_close( self); - return -ENOMEM; + + /* Allocate memory if needed */ + if (self->rx_buff.truesize > 0) { + self->rx_buff.data = ( __u8 *) kmalloc(self->rx_buff.truesize, + self->rx_buff.flags); + if (self->rx_buff.data == NULL) + return -ENOMEM; + + memset(self->rx_buff.data, 0, self->rx_buff.truesize); } + if (self->tx_buff.truesize > 0) { + self->tx_buff.data = ( __u8 *) kmalloc(self->tx_buff.truesize, + self->tx_buff.flags); + if (self->tx_buff.data == NULL) + return -ENOMEM; - memset( self->rx_buff.data, 0, self->rx_buff.truesize); - memset( self->tx_buff.data, 0, self->tx_buff.truesize); + memset(self->tx_buff.data, 0, self->tx_buff.truesize); + } - self->magic = IRDA_DEVICE_MAGIC; + self->magic = IRDA_DEVICE_MAGIC; self->rx_buff.in_frame = FALSE; self->rx_buff.state = OUTSIDE_FRAME; /* Initialize timers */ - init_timer( &self->media_busy_timer); - - /* Open new IrLAP layer instance */ - self->irlap = irlap_open( self); + init_timer(&self->media_busy_timer); /* A pointer to the low level implementation */ self->priv = priv; /* Initialize IrDA net device */ do { - sprintf( self->name, "%s%d", "irda", i++); - } while ( dev_get( self->name) != NULL); + sprintf(self->name, "%s%d", "irda", i++); + } while (dev_get(self->name) != NULL); self->netdev.name = self->name; self->netdev.priv = (void *) self; self->netdev.next = NULL; - if (( result = register_netdev( &self->netdev)) != 0) { - DEBUG( 0, __FUNCTION__ "(), register_netdev() failed!\n"); + if ((result = register_netdev(&self->netdev)) != 0) { + DEBUG(0, __FUNCTION__ "(), register_netdev() failed!\n"); return -1; } - + /* * Make the description for the device. self->netdev.name will get * a name like "irda0" and the self->descriptin will get a name * like "irda0 <-> irtty0" */ - strncpy( self->description, self->name, 5); - strcat( self->description, " <-> "); - strncat( self->description, name, 23); - - hashbin_insert( irda_device, (QUEUE *) self, (int) self, NULL); - + strncpy(self->description, self->name, 5); + strcat(self->description, " <-> "); + strncat(self->description, name, 23); + + hashbin_insert(irda_device, (QUEUE *) self, (int) self, NULL); + /* Open network device */ - dev_open( &self->netdev); + dev_open(&self->netdev); + + printk("IrDA device %s registered.\n", self->name); - printk( "IrDA device %s registered.\n", self->name); + irda_device_set_media_busy(self, FALSE); - irda_device_set_media_busy( self, FALSE); + /* + * Open new IrLAP layer instance, now that everything should be + * initialized properly + */ + self->irlap = irlap_open(self); + /* It's now safe to initilize the saddr */ + memcpy(self->netdev.dev_addr, &self->irlap->saddr, 4); + + DEBUG(4, __FUNCTION__ "()->\n"); + return 0; } @@ -204,29 +208,29 @@ * Close this instance of the irda_device, just deallocate buffers * */ -void __irda_device_close( struct irda_device *self) +void __irda_device_close(struct irda_device *self) { - DEBUG( 4, __FUNCTION__ "()\n"); - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRDA_DEVICE_MAGIC, return;); + DEBUG(4, __FUNCTION__ "()\n"); - dev_close( &self->netdev); + ASSERT(self != NULL, return;); + ASSERT(self->magic == IRDA_DEVICE_MAGIC, return;); - /* Remove netdevice */ - unregister_netdev( &self->netdev); + /* We do this test to know if the device has been registered at all */ + if (self->netdev.type == ARPHRD_IRDA) { + dev_close(&self->netdev); + + /* Remove netdevice */ + unregister_netdev(&self->netdev); + } /* Stop timers */ - del_timer( &self->todo_timer); - del_timer( &self->media_busy_timer); + del_timer(&self->media_busy_timer); - if ( self->tx_buff.data) { - kfree( self->tx_buff.data); - } + if (self->tx_buff.data) + kfree(self->tx_buff.data); - if ( self->rx_buff.data) { - kfree( self->rx_buff.data); - } + if (self->rx_buff.data) + kfree(self->rx_buff.data); self->magic = 0; } @@ -237,20 +241,21 @@ * * */ -void irda_device_close( struct irda_device *self) +void irda_device_close(struct irda_device *self) { - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRDA_DEVICE_MAGIC, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == IRDA_DEVICE_MAGIC, return;); - /* Stop IrLAP */ - irlap_close( self->irlap); + /* Stop and remove instance of IrLAP */ + if (self->irlap) + irlap_close(self->irlap); self->irlap = NULL; - hashbin_remove( irda_device, (int) self, NULL); + hashbin_remove(irda_device, (int) self, NULL); - __irda_device_close( self); + __irda_device_close(self); } /* @@ -259,20 +264,20 @@ * Called when we have detected that another station is transmiting * in contention mode. */ -void irda_device_set_media_busy( struct irda_device *self, int status) +void irda_device_set_media_busy(struct irda_device *self, int status) { - DEBUG( 4, __FUNCTION__ "(%s)\n", status ? "TRUE" : "FALSE"); + DEBUG(4, __FUNCTION__ "(%s)\n", status ? "TRUE" : "FALSE"); - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRDA_DEVICE_MAGIC, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == IRDA_DEVICE_MAGIC, return;); - if ( status) { + if (status) { self->media_busy = TRUE; - irda_device_start_mbusy_timer( self); + irda_device_start_mbusy_timer(self); DEBUG( 4, "Media busy!\n"); } else { self->media_busy = FALSE; - del_timer( &self->media_busy_timer); + del_timer(&self->media_busy_timer); } } @@ -282,30 +287,26 @@ * When this function is called, we will have a process context so its * possible for us to sleep, wait or whatever :-) */ -static void __irda_device_change_speed( struct irda_device *self, int speed) +static void __irda_device_change_speed(struct irda_device *self, int speed) { - DEBUG(4, __FUNCTION__ "(), <%ld>\n", jiffies); - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRDA_DEVICE_MAGIC, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == IRDA_DEVICE_MAGIC, return;); /* * Is is possible to change speed yet? Wait until the last byte * has been transmitted. */ - if ( self->wait_until_sent) { - self->wait_until_sent( self); - - if ( self->change_speed) { - self->change_speed( self, speed); - + if (self->wait_until_sent) { + self->wait_until_sent(self); + if (self->change_speed) { + self->change_speed(self, speed); + /* Update the QoS value only */ self->qos.baud_rate.value = speed; } } else { - DEBUG(0, __FUNCTION__ "(), Warning, wait_until_sent() " - "has not implemented by the device driver!\n"); - + printk(KERN_WARNING "wait_until_sent() " + "has not implemented by the IrDA device driver!\n"); } } @@ -315,15 +316,16 @@ * Change the speed of the currently used irda_device * */ -inline void irda_device_change_speed( struct irda_device *self, int speed) +inline void irda_device_change_speed(struct irda_device *self, int speed) { - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRDA_DEVICE_MAGIC, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == IRDA_DEVICE_MAGIC, return;); - irda_execute_as_process( - self, (TODO_CALLBACK) __irda_device_change_speed, speed); + irda_execute_as_process(self, + (TODO_CALLBACK) __irda_device_change_speed, + speed); } inline int irda_device_is_media_busy( struct irda_device *self) @@ -353,19 +355,6 @@ return &self->qos; } -void irda_device_todo_expired( unsigned long data) -{ - struct irda_device *self = ( struct irda_device *) data; - - DEBUG( 4, __FUNCTION__ "()\n"); - - /* Check that we still exist */ - if ( !self || self->magic != IRDA_DEVICE_MAGIC) { - return; - } - __irda_device_change_speed( self, self->new_speed); -} - static struct enet_statistics *irda_device_get_stats( struct device *dev) { struct irda_device *priv = (struct irda_device *) dev->priv; @@ -379,18 +368,18 @@ * This function should be used by low level device drivers in a similar way * as ether_setup() is used by normal network device drivers */ -int irda_device_setup( struct device *dev) +int irda_device_setup(struct device *dev) { struct irda_device *self; - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( dev != NULL, return -1;); + ASSERT(dev != NULL, return -1;); self = (struct irda_device *) dev->priv; - ASSERT( self != NULL, return -1;); - ASSERT( self->magic == IRDA_DEVICE_MAGIC, return -1;); + ASSERT(self != NULL, return -1;); + ASSERT(self->magic == IRDA_DEVICE_MAGIC, return -1;); dev->get_stats = irda_device_get_stats; dev->rebuild_header = irda_device_net_rebuild_header; @@ -401,17 +390,16 @@ dev->addr_len = 0; dev->type = ARPHRD_IRDA; - dev->tx_queue_len = 10; /* Short queues in IrDA */ + dev->tx_queue_len = 8; /* Window size + 1 s-frame */ - memcpy( dev->dev_addr, &self->irlap->saddr, 4); - memset( dev->broadcast, 0xff, 4); + memset(dev->broadcast, 0xff, 4); dev->mtu = 2048; dev->tbusy = 1; - dev_init_buffers( dev); + dev_init_buffers(dev); - dev->flags = 0; + dev->flags = IFF_NOARP; return 0; } @@ -460,16 +448,15 @@ * Function irda_device_transmit_finished (void) * * Check if there is still some frames in the transmit queue for this - * device + * device. Maybe we should use: q->q.qlen == 0. * */ int irda_device_txqueue_empty( struct irda_device *self) { - ASSERT( self != NULL, return -1;); - ASSERT( self->magic == IRDA_DEVICE_MAGIC, return -1;); + ASSERT(self != NULL, return -1;); + ASSERT(self->magic == IRDA_DEVICE_MAGIC, return -1;); - /* FIXME: check if this is the right way of doing it? */ - if ( skb_queue_len( &self->netdev.qdisc->q)) + if (skb_queue_len(&self->netdev.qdisc->q)) return FALSE; return TRUE; @@ -478,12 +465,21 @@ /* * Function irda_get_mtt (skb) * - * Utility function for getting the - * + * Utility function for getting the minimum turnaround time out of + * the skb, where it has been hidden in the cb field. */ -__inline__ int irda_get_mtt( struct sk_buff *skb) +inline unsigned short irda_get_mtt(struct sk_buff *skb) { - return ((struct irlap_skb_cb *)(skb->cb))->mtt; + unsigned short mtt; + + if (((struct irlap_skb_cb *)(skb->cb))->magic != LAP_MAGIC) + mtt = 10000; + else + mtt = ((struct irlap_skb_cb *)(skb->cb))->mtt; + + ASSERT(mtt <= 10000, return 10000;); + + return mtt; } /* @@ -492,21 +488,20 @@ * Setup the DMA channel * */ -void setup_dma( int channel, char *buffer, int count, int mode) +void setup_dma(int channel, char *buffer, int count, int mode) { unsigned long flags; + + flags = claim_dma_lock(); + + disable_dma(channel); + clear_dma_ff(channel); + set_dma_mode(channel, mode); + set_dma_addr(channel, virt_to_bus(buffer)); + set_dma_count(channel, count); + enable_dma(channel); - save_flags(flags); - cli(); - - disable_dma( channel); - clear_dma_ff( channel); - set_dma_mode( channel, mode); - set_dma_addr( channel, virt_to_bus(buffer)); - set_dma_count( channel, count); - enable_dma( channel); - - restore_flags(flags); + release_dma_lock(flags); } #ifdef CONFIG_PROC_FS @@ -532,6 +527,8 @@ len += sprintf( buf+len, "PIO "); if (idev->flags & IFF_DMA) len += sprintf( buf+len, "DMA "); + if (idev->flags & IFF_SHM) + len += sprintf( buf+len, "SHM "); if (idev->flags & IFF_DONGLE) len += sprintf( buf+len, "DONGLE "); diff -u --recursive --new-file v2.2.5/linux/net/irda/iriap.c linux/net/irda/iriap.c --- v2.2.5/linux/net/irda/iriap.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/iriap.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Thu Aug 21 00:02:07 1997 - * Modified at: Thu Feb 11 01:22:44 1999 + * Modified at: Tue Mar 23 19:38:46 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -54,7 +55,8 @@ "CS_UNICODE" }; -hashbin_t *iriap = NULL; +static hashbin_t *iriap = NULL; +static __u32 service_handle; extern char *lmp_reasons[]; @@ -62,6 +64,11 @@ static void __iriap_close( struct iriap_cb *self); static void iriap_disconnect_indication(void *instance, void *sap, LM_REASON reason, struct sk_buff *skb); +static void iriap_connect_indication(void *instance, void *sap, + struct qos_info *qos, __u32 max_sdu_size, + struct sk_buff *skb); +static int iriap_data_indication(void *instance, void *sap, + struct sk_buff *skb); /* * Function iriap_init (void) @@ -71,16 +78,15 @@ */ __initfunc(int iriap_init(void)) { + __u16 hints; struct ias_object *obj; DEBUG( 4, __FUNCTION__ "()\n"); /* Allocate master array */ iriap = hashbin_new( HB_LOCAL); - if ( iriap == NULL) { - printk( KERN_WARNING "IrIAP: Can't allocate iriap hashbin!\n"); + if ( iriap == NULL) return -ENOMEM; - } objects = hashbin_new( HB_LOCAL); if ( objects == NULL) { @@ -92,8 +98,9 @@ /* * Register some default services for IrLMP */ - irlmp_register_layer( S_COMPUTER, SERVER | CLIENT, FALSE, NULL); - irlmp_register_layer( S_PNP, SERVER, FALSE, NULL); + hints = irlmp_service_to_hint(S_COMPUTER); + hints |= irlmp_service_to_hint(S_PNP); + service_handle = irlmp_register_service(hints); /* * Register the Device object with LM-IAS @@ -119,11 +126,10 @@ */ void iriap_cleanup(void) { - irlmp_unregister_layer( S_COMPUTER, SERVER | CLIENT); - irlmp_unregister_layer( S_PNP, SERVER); + irlmp_unregister_service(service_handle); - hashbin_delete( iriap, (FREE_FUNC) __iriap_close); - hashbin_delete( objects, (FREE_FUNC) __irias_delete_object); + hashbin_delete(iriap, (FREE_FUNC) __iriap_close); + hashbin_delete(objects, (FREE_FUNC) __irias_delete_object); } /* @@ -237,8 +243,9 @@ * Got disconnect, so clean up everything assosiated with this connection * */ -void iriap_disconnect_indication( void *instance, void *sap, LM_REASON reason, - struct sk_buff *userdata) +static void iriap_disconnect_indication( void *instance, void *sap, + LM_REASON reason, + struct sk_buff *userdata) { struct iriap_cb *self; @@ -385,7 +392,7 @@ frame = skb->data; /* Build frame */ - frame[0] = LST | GET_VALUE_BY_CLASS; + frame[0] = IAP_LST | GET_VALUE_BY_CLASS; frame[1] = name_len; /* Insert length of name */ memcpy( frame+2, name, name_len); /* Insert name */ frame[2+name_len] = attr_len; /* Insert length of attr */ @@ -404,39 +411,44 @@ void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb) { struct ias_value *value; + int n; + int charset; + __u32 value_len; + __u32 tmp_cpu32; + __u16 tmp_cpu16; __u16 obj_id; - int len; + __u16 len; __u8 type; - int value_len; __u8 *fp; - int n; - int charset; - ASSERT( self != NULL, return;); - ASSERT( self->magic == IAS_MAGIC, return;); - ASSERT( skb != NULL, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == IAS_MAGIC, return;); + ASSERT(skb != NULL, return;); /* Initialize variables */ fp = skb->data; n = 2; /* Get length, MSB first */ - len = ntohs( *(__u16 *)( fp+n)); n += 2; + memcpy(&len, fp+n, 2); n += 2; + be16_to_cpus(&len); - DEBUG( 4, __FUNCTION__ "(), len=%d\n", len); + DEBUG(4, __FUNCTION__ "(), len=%d\n", len); /* Get object ID, MSB first */ - obj_id = ntohs( *(__u16 *)( fp+n)); n += 2; + memcpy(&obj_id, fp+n, 2); n += 2; + be16_to_cpus(&obj_id); type = fp[n++]; DEBUG( 4, __FUNCTION__ "(), Value type = %d\n", type); switch( type) { case IAS_INTEGER: - value = irias_new_integer_value( ntohl(*(__u32 *)(fp+n))); - /* - * Legal values restricted to 0x01-0x6f, page 15 irttp - */ + memcpy(&tmp_cpu32, fp+n, 4); n += 4; + be32_to_cpus(&tmp_cpu32); + value = irias_new_integer_value(tmp_cpu32); + + /* Legal values restricted to 0x01-0x6f, page 15 irttp */ DEBUG( 4, __FUNCTION__ "(), lsap=%d\n", value->t.integer); break; case IAS_STRING: @@ -469,29 +481,29 @@ fp[n+value_len] = 0x00; DEBUG(4, "Got string %s\n", fp+n); - value = irias_new_string_value( fp+n); + value = irias_new_string_value(fp+n); break; case IAS_OCT_SEQ: - value_len = ntohs( *(__u16 *)( fp+n)); n += 2; + memcpy(&tmp_cpu16, fp+n, 2); n += 2; + be16_to_cpus(&tmp_cpu16); + value_len = tmp_cpu16; /* FIXME:should be 1024, but.... */ DEBUG(0, __FUNCTION__ "():octet sequence:len=%d\n", value_len); ASSERT(value_len <= 55, return;); - value = irias_new_octseq_value( fp+n, value_len); + value = irias_new_octseq_value(fp+n, value_len); break; default: value = &missing; break; } - if ( self->confirm) + if (self->confirm) self->confirm(obj_id, value, self->priv); - /* - * Finished, close connection! - */ - iriap_disconnect_request( self); + /* Finished, close connection! */ + iriap_disconnect_request(self); } /* @@ -504,8 +516,9 @@ __u8 ret_code, struct ias_value *value) { struct sk_buff *skb; - __u8 *fp; int n; + __u32 tmp_be32, tmp_be16; + __u8 *fp; DEBUG( 4, __FUNCTION__ "()\n"); @@ -533,35 +546,39 @@ fp = skb->data; /* Build frame */ - fp[n++] = GET_VALUE_BY_CLASS | LST; + fp[n++] = GET_VALUE_BY_CLASS | IAP_LST; fp[n++] = ret_code; /* Insert list length (MSB first) */ - *((__u16 *) (fp+n)) = __constant_htons( 0x0001); n += 2; + tmp_be16 = __constant_htons( 0x0001); + memcpy(fp+n, &tmp_be16, 2); n += 2; /* Insert object identifier ( MSB first) */ - *((__u16 *) (fp+n)) = htons( obj_id); n += 2; + tmp_be16 = cpu_to_be16(obj_id); + memcpy(fp+n, &tmp_be16, 2); n += 2; - switch( value->type) { + switch(value->type) { case IAS_STRING: - skb_put( skb, 3 + value->len); + skb_put(skb, 3 + value->len); fp[n++] = value->type; fp[n++] = 0; /* ASCII */ fp[n++] = (__u8) value->len; - memcpy( fp+n, value->t.string, value->len); n+=value->len; + memcpy(fp+n, value->t.string, value->len); n+=value->len; break; case IAS_INTEGER: - skb_put( skb, 5); + skb_put(skb, 5); fp[n++] = value->type; - *((__u32 *)(fp+n)) = htonl(value->t.integer); n+=4; + tmp_be32 = cpu_to_be32(value->t.integer); + memcpy(fp+n, &tmp_be32, 4); n += 4; break; case IAS_OCT_SEQ: - skb_put( skb, 3 + value->len); + skb_put(skb, 3 + value->len); fp[n++] = value->type; - *((__u16 *)(fp+n)) = htons(value->len); n+=2; + + tmp_be16 = cpu_to_be16(value->len); + memcpy(fp+n, &tmp_be16, 2); n += 2; memcpy(fp+n, value->t.oct_seq, value->len); n+=value->len; - break; case IAS_MISSING: DEBUG( 3, __FUNCTION__ ": sending IAS_MISSING\n"); @@ -573,7 +590,7 @@ DEBUG(0, __FUNCTION__ "(), type not implemented!\n"); break; } - iriap_do_r_connect_event( self, IAP_CALL_RESPONSE, skb); + iriap_do_r_connect_event(self, IAP_CALL_RESPONSE, skb); } /* @@ -672,7 +689,7 @@ frame = skb->data; /* Build frame */ - frame[0] = LST | self->operation; + frame[0] = IAP_LST | self->operation; } /* @@ -681,8 +698,8 @@ * LSAP connection confirmed! * */ -void iriap_connect_confirm( void *instance, void *sap, struct qos_info *qos, - int max_sdu_size, struct sk_buff *userdata) +void iriap_connect_confirm(void *instance, void *sap, struct qos_info *qos, + __u32 max_sdu_size, struct sk_buff *userdata) { struct iriap_cb *self; @@ -705,8 +722,9 @@ * Remote LM-IAS is requesting connection * */ -void iriap_connect_indication(void *instance, void *sap, struct qos_info *qos, - int max_sdu_size, struct sk_buff *userdata) +static void iriap_connect_indication(void *instance, void *sap, + struct qos_info *qos, __u32 max_sdu_size, + struct sk_buff *userdata) { struct iriap_cb *self; @@ -727,7 +745,8 @@ * Receives data from connection identified by handle from IrLMP * */ -void iriap_data_indication( void *instance, void *sap, struct sk_buff *skb) +static int iriap_data_indication(void *instance, void *sap, + struct sk_buff *skb) { struct iriap_cb *self; __u8 *frame; @@ -735,50 +754,53 @@ DEBUG( 4, __FUNCTION__ "()\n"); - self = ( struct iriap_cb *) instance; + self = (struct iriap_cb *) instance; - ASSERT( self != NULL, return;); - ASSERT( self->magic == IAS_MAGIC, return;); + ASSERT(self != NULL, return 0;); + ASSERT(self->magic == IAS_MAGIC, return 0;); - ASSERT( skb != NULL, return;); + ASSERT(skb != NULL, return 0;); frame = skb->data; - if ( self->mode == IAS_SERVER) { + if (self->mode == IAS_SERVER) { /* Call server */ - DEBUG( 4, __FUNCTION__ "(), Calling server!\n"); + DEBUG(4, __FUNCTION__ "(), Calling server!\n"); iriap_do_r_connect_event( self, IAP_RECV_F_LST, skb); - return; + return 0; } opcode = frame[0]; if ( ~opcode & 0x80) { printk( KERN_ERR "IrIAS multiframe commands or results is " "not implemented yet!\n"); - return; + return 0; } - if ( ~opcode &0x40) { - DEBUG( 4, "Got ack frame!\n"); + if (~opcode & IAP_ACK) { + DEBUG(0, __FUNCTION__ "() Got ack frame!\n"); /* return; */ } - opcode &= 0x7f; /* Mask away LST bit */ + opcode &= ~IAP_LST; /* Mask away LST bit */ - switch( opcode) { + switch(opcode) { case GET_INFO_BASE: DEBUG( 0, "IrLMP GetInfoBaseDetails not implemented!\n"); break; case GET_VALUE_BY_CLASS: DEBUG( 4,"IrLMP GetValueByClass\n"); - if ( frame[1] == 0x01) { - printk( KERN_WARNING "IrIAP No such class!\n"); - } else if ( frame[1] == 0x02) { - printk( KERN_WARNING - "IrIAP No such attribute!\n"); - } else { - iriap_getvaluebyclass_confirm( self, skb); + switch(frame[1]) { + case IAS_SUCCESS: + iriap_getvaluebyclass_confirm(self, skb); + break; + case IAS_CLASS_UNKNOWN: + printk(KERN_WARNING "IrIAP No such class!\n"); + break; + case IAS_ATTRIB_UNKNOWN: + printk(KERN_WARNING "IrIAP No such attribute!\n"); + break; } iriap_do_call_event( self, IAP_RECV_F_LST, skb); @@ -792,6 +814,7 @@ DEBUG(0, __FUNCTION__ "(), Unknown op-code: %02x\n", opcode); break; } + return 0; } /* @@ -912,8 +935,8 @@ } len += sprintf( buf+len, "\n"); - attrib = ( struct ias_attrib *) - hashbin_get_next( obj->attribs); + attrib = (struct ias_attrib *) + hashbin_get_next(obj->attribs); } obj = ( struct ias_object *) hashbin_get_next( objects); } diff -u --recursive --new-file v2.2.5/linux/net/irda/irias_object.c linux/net/irda/irias_object.c --- v2.2.5/linux/net/irda/irias_object.c Wed Jan 20 23:14:07 1999 +++ linux/net/irda/irias_object.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Thu Oct 1 22:50:04 1998 - * Modified at: Tue Dec 15 09:19:43 1998 + * Modified at: Mon Mar 22 13:22:35 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. @@ -23,6 +23,8 @@ ********************************************************************/ #include +#include +#include #include #include @@ -227,7 +229,6 @@ * * Change the value of an objects attribute. * - * TODO: not tested yet! */ int irias_object_change_attribute( char *obj_name, char *attrib_name, struct ias_value *new_value) diff -u --recursive --new-file v2.2.5/linux/net/irda/irlan/irlan_client.c linux/net/irda/irlan/irlan_client.c --- v2.2.5/linux/net/irda/irlan/irlan_client.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irlan/irlan_client.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sun Aug 31 20:14:37 1997 - * Modified at: Wed Feb 17 23:29:34 1999 + * Modified at: Wed Apr 7 16:56:35 1999 * Modified by: Dag Brattli * Sources: skeleton.c by Donald Becker * slip.c by Laurence Culhane, @@ -57,15 +57,12 @@ static void irlan_client_ctrl_disconnect_indication(void *instance, void *sap, LM_REASON reason, struct sk_buff *); - -static void irlan_client_ctrl_data_indication(void *instance, void *sap, - struct sk_buff *skb); - +static int irlan_client_ctrl_data_indication(void *instance, void *sap, + struct sk_buff *skb); static void irlan_client_ctrl_connect_confirm(void *instance, void *sap, struct qos_info *qos, - int max_sdu_size, + __u32 max_sdu_size, struct sk_buff *); - static void irlan_check_response_param(struct irlan_cb *self, char *param, char *value, int val_len); @@ -99,6 +96,12 @@ irlan_client_kick_timer_expired); } +/* + * Function irlan_client_wakeup (self, saddr, daddr) + * + * Wake up client + * + */ void irlan_client_wakeup(struct irlan_cb *self, __u32 saddr, __u32 daddr) { struct irmanager_event mgr_event; @@ -108,52 +111,44 @@ ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); - if (self->client.state == IRLAN_IDLE) { - /* saddr may have changed! */ - self->saddr = saddr; - - /* Check if network device is up */ - if (self->dev.start) { - /* Open TSAPs */ - irlan_client_open_ctrl_tsap(self); - irlan_provider_open_ctrl_tsap(self); - irlan_open_data_tsap(self); - - irlan_do_client_event(self, IRLAN_DISCOVERY_INDICATION, - NULL); - } else if (self->notify_irmanager) { - /* - * Tell irmanager that the device can now be - * configured but only if the device was not taken - * down by the user - */ - mgr_event.event = EVENT_IRLAN_START; - sprintf(mgr_event.devname, "%s", self->ifname); - irmanager_notify(&mgr_event); - - /* - * We set this so that we only notify once, since if - * configuration of the network device fails, the user - * will have to sort it out first anyway. No need to - * try again. - */ - self->notify_irmanager = FALSE; - } - /* Restart watchdog timer */ - irlan_start_watchdog_timer(self, IRLAN_TIMEOUT); + /* Check if we are already awake */ + if (self->client.state != IRLAN_IDLE) + return; - /* Start kick timer */ - irlan_client_start_kick_timer(self, 200); - } else { - DEBUG(2, __FUNCTION__ "(), state=%s\n", - irlan_state[ self->client.state]); - /* - * If we get here, it's obvious that the last - * connection attempt has failed, so its best - * to go back to idle! + /* saddr may have changed! */ + self->saddr = saddr; + + /* Check if network device is up */ + if (self->dev.start) { + /* Open TSAPs */ + irlan_client_open_ctrl_tsap(self); + irlan_provider_open_ctrl_tsap(self); + irlan_open_data_tsap(self); + + irlan_do_client_event(self, IRLAN_DISCOVERY_INDICATION, NULL); + } else if (self->notify_irmanager) { + /* + * Tell irmanager that the device can now be + * configured but only if the device was not taken + * down by the user */ - irlan_do_client_event(self, IRLAN_LMP_DISCONNECT, NULL); + mgr_event.event = EVENT_IRLAN_START; + sprintf(mgr_event.devname, "%s", self->ifname); + irmanager_notify(&mgr_event); + + /* + * We set this so that we only notify once, since if + * configuration of the network device fails, the user + * will have to sort it out first anyway. No need to + * try again. + */ + self->notify_irmanager = FALSE; } + /* Restart watchdog timer */ + irlan_start_watchdog_timer(self, IRLAN_TIMEOUT); + + /* Start kick timer */ + irlan_client_start_kick_timer(self, 2*HZ); } /* @@ -162,7 +157,7 @@ * Remote device with IrLAN server support discovered * */ -void irlan_client_discovery_indication(DISCOVERY *discovery) +void irlan_client_discovery_indication(discovery_t *discovery) { struct irlan_cb *self, *entry; __u32 saddr, daddr; @@ -200,7 +195,7 @@ * Rehash instance, now we have a client (daddr) to serve. */ entry = hashbin_remove(irlan, self->daddr, NULL); - ASSERT( entry == self, return;); + ASSERT(entry == self, return;); self->daddr = daddr; self->saddr = saddr; @@ -234,8 +229,8 @@ * This function gets the data that is received on the control channel * */ -static void irlan_client_ctrl_data_indication(void *instance, void *sap, - struct sk_buff *skb) +static int irlan_client_ctrl_data_indication(void *instance, void *sap, + struct sk_buff *skb) { struct irlan_cb *self; @@ -243,11 +238,13 @@ self = (struct irlan_cb *) instance; - ASSERT(self != NULL, return;); - ASSERT(self->magic == IRLAN_MAGIC, return;); - ASSERT(skb != NULL, return;); + ASSERT(self != NULL, return -1;); + ASSERT(self->magic == IRLAN_MAGIC, return -1;); + ASSERT(skb != NULL, return -1;); irlan_do_client_event(self, IRLAN_DATA_INDICATION, skb); + + return 0; } static void irlan_client_ctrl_disconnect_indication(void *instance, void *sap, @@ -317,7 +314,7 @@ */ static void irlan_client_ctrl_connect_confirm(void *instance, void *sap, struct qos_info *qos, - int max_sdu_size, + __u32 max_sdu_size, struct sk_buff *skb) { struct irlan_cb *self; @@ -448,7 +445,10 @@ static void irlan_check_response_param(struct irlan_cb *self, char *param, char *value, int val_len) { +#ifdef CONFIG_IRLAN_GRATUITOUS_ARP struct in_device *in_dev; +#endif + __u16 tmp_cpu; /* Temporary value in host order */ __u8 *bytes; int i; @@ -515,12 +515,16 @@ return; } if (strcmp(param, "CON_ARB") == 0) { - self->client.recv_arb_val = le16_to_cpup(value); + memcpy(&tmp_cpu, value, 2); /* Align value */ + le16_to_cpus(&tmp_cpu); /* Convert to host order */ + self->client.recv_arb_val = tmp_cpu; DEBUG(2, __FUNCTION__ "(), receive arb val=%d\n", self->client.recv_arb_val); } if (strcmp(param, "MAX_FRAME") == 0) { - self->client.max_frame = le16_to_cpup(value); + memcpy(&tmp_cpu, value, 2); /* Align value */ + le16_to_cpus(&tmp_cpu); /* Convert to host order */ + self->client.max_frame = tmp_cpu; DEBUG(4, __FUNCTION__ "(), max frame=%d\n", self->client.max_frame); } diff -u --recursive --new-file v2.2.5/linux/net/irda/irlan/irlan_common.c linux/net/irda/irlan/irlan_common.c --- v2.2.5/linux/net/irda/irlan/irlan_common.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irlan/irlan_common.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sun Aug 31 20:14:37 1997 - * Modified at: Wed Feb 17 23:49:10 1999 + * Modified at: Wed Apr 7 17:03:21 1999 * Modified by: Dag Brattli * * Copyright (c) 1997 Dag Brattli , All Rights Reserved. @@ -55,6 +55,7 @@ * Master structure */ hashbin_t *irlan = NULL; +static __u32 ckey, skey; /* Module parameters */ static int eth = 0; /* Use "eth" or "irlan" name for devices */ @@ -143,6 +144,12 @@ irlan_watchdog_timer_expired); } +/* + * Function irlan_eth_open (dev) + * + * Network device has been opened by user + * + */ static int irlan_eth_open(struct device *dev) { struct irlan_cb *self; @@ -162,6 +169,9 @@ self->notify_irmanager = TRUE; + /* We are now open, so time to do some work */ + irlan_client_wakeup(self, self->saddr, self->daddr); + MOD_INC_USE_COUNT; return 0; @@ -196,7 +206,7 @@ irlan_start_watchdog_timer(self, IRLAN_TIMEOUT); - /* Device closed by user */ + /* Device closed by user! */ if (self->notify_irmanager) self->notify_irmanager = FALSE; else @@ -233,7 +243,7 @@ dev->tx_queue_len = TTP_MAX_QUEUE; -#ifdef 0 +#if 0 /* * OK, since we are emulating an IrLAN sever we will have to give * ourself an ethernet address! @@ -274,6 +284,7 @@ __initfunc(int irlan_init(void)) { struct irlan_cb *new; + __u16 hints; DEBUG(4, __FUNCTION__"()\n"); @@ -289,12 +300,14 @@ DEBUG(4, __FUNCTION__ "()\n"); - /* Register with IrLMP as a service user */ - irlmp_register_layer(S_LAN, CLIENT, TRUE, - irlan_client_discovery_indication); + hints = irlmp_service_to_hint(S_LAN); + + /* Register with IrLMP as a client */ + ckey = irlmp_register_client(hints, irlan_client_discovery_indication, + NULL); /* Register with IrLMP as a service */ - irlmp_register_layer(S_LAN, SERVER, FALSE, NULL); + skey = irlmp_register_service(hints); /* Start the first IrLAN instance */ new = irlan_open(DEV_ADDR_ANY, DEV_ADDR_ANY, FALSE); @@ -309,9 +322,9 @@ { DEBUG(4, __FUNCTION__ "()\n"); - irlmp_unregister_layer(S_LAN, SERVER); + irlmp_unregister_client(ckey); - irlmp_unregister_layer(S_LAN, CLIENT); + irlmp_unregister_service(skey); #ifdef CONFIG_PROC_FS proc_unregister(&proc_irda, proc_irlan.low_ino); @@ -344,8 +357,7 @@ self->dev.name = self->ifname; if (register_netdev(&self->dev) != 0) { - DEBUG(2, __FUNCTION__ - "(), register_netdev() failed!\n"); + DEBUG(2, __FUNCTION__ "(), register_netdev() failed!\n"); return -1; } self->netdev_registered = TRUE; @@ -472,7 +484,7 @@ } void irlan_connect_indication(void *instance, void *sap, struct qos_info *qos, - int max_sdu_size, struct sk_buff *skb) + __u32 max_sdu_size, struct sk_buff *skb) { struct irlan_cb *self; struct tsap_cb *tsap; @@ -505,7 +517,7 @@ } void irlan_connect_confirm(void *instance, void *sap, struct qos_info *qos, - int max_sdu_size, struct sk_buff *skb) + __u32 max_sdu_size, struct sk_buff *skb) { struct irlan_cb *self; @@ -1043,6 +1055,7 @@ { __u8 *frame; __u8 param_len; + __u16 tmp_le; /* Temporary value in little endian format */ int n=0; if (skb == NULL) { @@ -1085,7 +1098,8 @@ memcpy(frame+n, param, param_len); n += param_len; /* Insert value length (2 byte little endian format, LSB first) */ - *((__u16 *) (frame+n)) = cpu_to_le16(value_len); n += 2; + tmp_le = cpu_to_le16(value_len); + memcpy(frame+n, &tmp_le, 2); n += 2; /* To avoid alignment problems */ /* Insert value */ switch (type) { @@ -1093,7 +1107,8 @@ frame[n++] = value_byte; break; case IRLAN_SHORT: - *((__u16 *) (frame+n)) = cpu_to_le16(value_short); n += 2; + tmp_le = cpu_to_le16(value_short); + memcpy(frame+n, &tmp_le, 2); n += 2; break; case IRLAN_ARRAY: memcpy(frame+n, value_array, value_len); n+=value_len; @@ -1137,7 +1152,8 @@ * Get length of parameter value (2 bytes in little endian * format) */ - val_len = le16_to_cpup(buf+n); n+=2; + memcpy(&val_len, buf+n, 2); /* To avoid alignment problems */ + le16_to_cpus(&val_len); n+=2; if (val_len > 1016) { DEBUG(2, __FUNCTION__ "(), parameter length to long\n"); @@ -1277,9 +1293,7 @@ */ int init_module(void) { - irlan_init(); - - return 0; + return irlan_init(); } /* diff -u --recursive --new-file v2.2.5/linux/net/irda/irlan/irlan_eth.c linux/net/irda/irlan/irlan_eth.c --- v2.2.5/linux/net/irda/irlan/irlan_eth.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irlan/irlan_eth.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Thu Oct 15 08:37:58 1998 - * Modified at: Wed Feb 3 19:58:28 1999 + * Modified at: Mon Mar 22 17:41:59 1999 * Modified by: Dag Brattli * Sources: skeleton.c by Donald Becker * slip.c by Laurence Culhane, @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -123,20 +124,20 @@ * This function gets the data that is received on the data channel * */ -void irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb) +int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb) { struct irlan_cb *self; self = (struct irlan_cb *) instance; - ASSERT(self != NULL, return;); - ASSERT(self->magic == IRLAN_MAGIC, return;); + ASSERT(self != NULL, return 0;); + ASSERT(self->magic == IRLAN_MAGIC, return 0;); if (skb == NULL) { ++self->stats.rx_dropped; - return; + return 0; } - ASSERT(skb->len > 1, return;); + ASSERT(skb->len > 1, return 0;); /* * Adopt this frame! Important to set all these fields since they @@ -151,7 +152,7 @@ self->stats.rx_packets++; self->stats.rx_bytes += skb->len; -/* net_bh(); */ + return 0; } /* diff -u --recursive --new-file v2.2.5/linux/net/irda/irlan/irlan_filter.c linux/net/irda/irlan/irlan_filter.c --- v2.2.5/linux/net/irda/irlan/irlan_filter.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irlan/irlan_filter.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Fri Jan 29 11:16:38 1999 - * Modified at: Sun Feb 7 23:48:07 1999 + * Modified at: Thu Feb 25 15:10:54 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. @@ -138,8 +138,8 @@ * Check parameters in request from peer device * */ -static void irlan_check_command_param(struct irlan_cb *self, char *param, - char *value) +void irlan_check_command_param(struct irlan_cb *self, char *param, + char *value) { __u8 *bytes; diff -u --recursive --new-file v2.2.5/linux/net/irda/irlan/irlan_provider.c linux/net/irda/irlan/irlan_provider.c --- v2.2.5/linux/net/irda/irlan/irlan_provider.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irlan/irlan_provider.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sun Aug 31 20:14:37 1997 - * Modified at: Thu Feb 4 16:08:33 1999 + * Modified at: Tue Apr 6 19:08:20 1999 * Modified by: Dag Brattli * Sources: skeleton.c by Donald Becker * slip.c by Laurence Culhane, @@ -56,8 +56,8 @@ * This function gets the data that is received on the control channel * */ -void irlan_provider_data_indication(void *instance, void *sap, - struct sk_buff *skb) +int irlan_provider_data_indication(void *instance, void *sap, + struct sk_buff *skb) { struct irlan_cb *self; __u8 code; @@ -66,10 +66,10 @@ self = (struct irlan_cb *) instance; - ASSERT(self != NULL, return;); - ASSERT(self->magic == IRLAN_MAGIC, return;); + ASSERT(self != NULL, return -1;); + ASSERT(self->magic == IRLAN_MAGIC, return -1;); - ASSERT(skb != NULL, return;); + ASSERT(skb != NULL, return -1;); code = skb->data[0]; switch(code) { @@ -102,6 +102,7 @@ DEBUG(2, __FUNCTION__ "(), Unknown command!\n"); break; } + return 0; } /* @@ -111,8 +112,8 @@ * */ void irlan_provider_connect_indication(void *instance, void *sap, - struct qos_info *qos, int max_sdu_size, - struct sk_buff *skb) + struct qos_info *qos, + __u32 max_sdu_size, struct sk_buff *skb) { struct irlan_cb *self, *entry, *new; struct tsap_cb *tsap; @@ -248,7 +249,6 @@ __u8 *frame; __u8 *ptr; int count; - __u8 name_len; __u16 val_len; int i; char *name; diff -u --recursive --new-file v2.2.5/linux/net/irda/irlap.c linux/net/irda/irlap.c --- v2.2.5/linux/net/irda/irlap.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irlap.c Thu Apr 15 05:42:42 1999 @@ -3,10 +3,10 @@ * Filename: irlap.c * Version: 0.9 * Description: An IrDA LAP driver for Linux - * Status: Experimental. + * Status: Stable. * Author: Dag Brattli * Created at: Mon Aug 4 20:40:53 1997 - * Modified at: Sat Feb 20 01:39:58 1999 + * Modified at: Tue Apr 6 21:07:08 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -127,11 +128,17 @@ skb_queue_head_init( &self->tx_list); skb_queue_head_init( &self->wx_list); - /* My unique IrLAP device address! :-) */ - self->saddr = jiffies; + /* My unique IrLAP device address! */ + get_random_bytes(&self->saddr, sizeof(self->saddr)); - /* Generate random connection address for this session */ - self->caddr = jiffies & 0xfe; + /* + * Generate random connection address for this session, which must + * be 7 bits wide and different from 0x00 and 0xfe + */ + while ((self->caddr == 0x00) || (self->caddr == 0xfe)) { + get_random_bytes(&self->caddr, sizeof(self->caddr)); + self->caddr &= 0xfe; + } init_timer( &self->slot_timer); init_timer( &self->query_timer); @@ -147,7 +154,7 @@ hashbin_insert( irlap, (QUEUE *) self, self->saddr, NULL); - irlmp_register_irlap( self, self->saddr, &self->notify); + irlmp_register_link( self, self->saddr, &self->notify); return self; } @@ -181,9 +188,9 @@ } /* - * Function irlap_close () + * Function irlap_close (self) * - * + * Remove IrLAP instance * */ void irlap_close( struct irlap_cb *self) @@ -197,7 +204,7 @@ irlap_disconnect_indication( self, LAP_DISC_INDICATION); - irlmp_unregister_irlap( self->saddr); + irlmp_unregister_link(self->saddr); self->notify.instance = NULL; /* Be sure that we manage to remove ourself from the hash */ @@ -210,7 +217,7 @@ } /* - * Function irlap_connect_indication () + * Function irlap_connect_indication (self, skb) * * Another device is attempting to make a connection * @@ -229,31 +236,32 @@ } /* - * Function irlap_connect_response (void) + * Function irlap_connect_response (self, skb) * * Service user has accepted incomming connection * */ -void irlap_connect_response( struct irlap_cb *self, struct sk_buff *skb) +void irlap_connect_response(struct irlap_cb *self, struct sk_buff *skb) { DEBUG( 4, __FUNCTION__ "()\n"); - irlap_do_event( self, CONNECT_RESPONSE, skb, NULL); + irlap_do_event(self, CONNECT_RESPONSE, skb, NULL); } /* - * Function irlap_connect_request (daddr, qos, sniff) + * Function irlap_connect_request (self, daddr, qos_user, sniff) * * Request connection with another device, sniffing is not implemented * yet. + * */ -void irlap_connect_request( struct irlap_cb *self, __u32 daddr, - struct qos_info *qos_user, int sniff) +void irlap_connect_request(struct irlap_cb *self, __u32 daddr, + struct qos_info *qos_user, int sniff) { - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(3, __FUNCTION__ "(), daddr=0x%08x\n", daddr); - ASSERT( self != NULL, return;); - ASSERT( self->magic == LAP_MAGIC, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == LAP_MAGIC, return;); self->daddr = daddr; @@ -261,32 +269,33 @@ * If the service user specifies QoS values for this connection, * then use them */ - irlap_init_qos_capabilities( self, qos_user); + irlap_init_qos_capabilities(self, qos_user); - if ( self->state == LAP_NDM) - irlap_do_event( self, CONNECT_REQUEST, NULL, NULL); + if ((self->state == LAP_NDM) && + !irda_device_is_media_busy(self->irdev)) + irlap_do_event(self, CONNECT_REQUEST, NULL, NULL); else self->connect_pending = TRUE; } /* - * Function irlap_connect_confirm (void) + * Function irlap_connect_confirm (self, skb) * - * Connection request is accepted + * Connection request has been accepted * */ -void irlap_connect_confirm( struct irlap_cb *self, struct sk_buff *skb) +void irlap_connect_confirm(struct irlap_cb *self, struct sk_buff *skb) { - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( self != NULL, return;); - ASSERT( self->magic == LAP_MAGIC, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == LAP_MAGIC, return;); - irlmp_link_connect_confirm( self->notify.instance, &self->qos_tx, skb); + irlmp_link_connect_confirm(self->notify.instance, &self->qos_tx, skb); } /* - * Function irlap_data_indication (skb) + * Function irlap_data_indication (self, skb) * * Received data frames from IR-port, so we just pass them up to * IrLMP for further processing @@ -451,7 +460,6 @@ #ifdef CONFIG_IRDA_COMPRESSION irda_free_compression( self); #endif - /* Flush queues */ irlap_flush_all_queues( self); @@ -479,7 +487,7 @@ * Start one single discovery operation. * */ -void irlap_discovery_request( struct irlap_cb *self, DISCOVERY *discovery) +void irlap_discovery_request(struct irlap_cb *self, discovery_t *discovery) { struct irlap_info info; @@ -568,7 +576,7 @@ * Somebody is trying to discover us! * */ -void irlap_discovery_indication( struct irlap_cb *self, DISCOVERY *discovery) +void irlap_discovery_indication(struct irlap_cb *self, discovery_t *discovery) { DEBUG( 4, __FUNCTION__ "()\n"); @@ -578,7 +586,7 @@ ASSERT( self->notify.instance != NULL, return;); - irlmp_discovery_indication( self->notify.instance, discovery); + irlmp_link_discovery_indication(self->notify.instance, discovery); } /* @@ -587,7 +595,7 @@ * * */ -void irlap_status_indication( int quality_of_link) +void irlap_status_indication(int quality_of_link) { switch( quality_of_link) { case STATUS_NO_ACTIVITY: @@ -599,7 +607,7 @@ default: break; } - irlmp_status_indication( quality_of_link, NO_CHANGE); + irlmp_status_indication(quality_of_link, LOCK_NO_CHANGE); } /* @@ -629,7 +637,7 @@ */ void irlap_reset_confirm(void) { - DEBUG( 1, __FUNCTION__ "()\n"); + DEBUG( 1, __FUNCTION__ "()\n"); } /* @@ -795,7 +803,7 @@ * frame in order to delay for the specified amount of time. This is * done to avoid using timers, and the forbidden udelay! */ -void irlap_wait_min_turn_around( struct irlap_cb *self, struct qos_info *qos) +void irlap_wait_min_turn_around(struct irlap_cb *self, struct qos_info *qos) { int usecs; int speed; diff -u --recursive --new-file v2.2.5/linux/net/irda/irlap_event.c linux/net/irda/irlap_event.c --- v2.2.5/linux/net/irda/irlap_event.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irlap_event.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Sat Aug 16 00:59:29 1997 - * Modified at: Thu Feb 11 00:38:58 1999 + * Modified at: Fri Mar 26 14:24:09 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , @@ -84,6 +84,7 @@ "RECV_DISCOVERY_XID_RSP", "RECV_SNRM_CMD", "RECV_TEST_CMD", + "RECV_TEST_RSP", "RECV_UA_RSP", "RECV_DM_RSP", "RECV_I_CMD", @@ -206,13 +207,13 @@ { int ret; - if ( !self || self->magic != LAP_MAGIC) + if (!self || self->magic != LAP_MAGIC) return; - DEBUG( 4, __FUNCTION__ "(), event = %s, state = %s\n", - irlap_event[ event], irlap_state[ self->state]); + DEBUG(4, __FUNCTION__ "(), event = %s, state = %s\n", + irlap_event[ event], irlap_state[ self->state]); - ret = (*state[ self->state]) ( self, event, skb, info); + ret = (*state[ self->state]) (self, event, skb, info); /* * Check if there are any pending events that needs to be executed @@ -243,7 +244,9 @@ break; case LAP_NDM: /* Check if we should try to connect */ - if (self->connect_pending) { + if ((self->connect_pending) && + !irda_device_is_media_busy(self->irdev)) + { self->connect_pending = FALSE; ret = (*state[self->state])(self, CONNECT_REQUEST, @@ -292,7 +295,7 @@ static int irlap_state_ndm( struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { - DISCOVERY *discovery_rsp; + discovery_t *discovery_rsp; int ret = 0; DEBUG( 4, __FUNCTION__ "()\n"); @@ -304,7 +307,7 @@ case CONNECT_REQUEST: ASSERT( self->irdev != NULL, return -1;); - if ( irda_device_is_media_busy( self->irdev)) { + if (irda_device_is_media_busy(self->irdev)) { DEBUG( 0, __FUNCTION__ "(), CONNECT_REQUEST: media busy!\n"); @@ -354,7 +357,7 @@ self->s++; irlap_start_slot_timer( self, self->slot_timeout); - irlap_next_state( self, LAP_QUERY); + irlap_next_state(self, LAP_QUERY); break; case RECV_DISCOVERY_XID_CMD: @@ -362,20 +365,20 @@ /* Assert that this is not the final slot */ if ( info->s <= info->S) { - self->daddr = info->daddr; - self->slot = irlap_generate_rand_time_slot( info->S, - info->s); + /* self->daddr = info->daddr; */ + self->slot = irlap_generate_rand_time_slot(info->S, + info->s); DEBUG( 4, "XID_CMD: S=%d, s=%d, slot %d\n", info->S, info->s, self->slot); if ( self->slot == info->s) { discovery_rsp = irlmp_get_discovery_response(); - - DEBUG( 4, "Sending XID rsp 1\n"); - irlap_send_discovery_xid_frame( self, info->S, - self->slot, - FALSE, - discovery_rsp); + discovery_rsp->daddr = info->daddr; + + irlap_send_discovery_xid_frame(self, info->S, + self->slot, + FALSE, + discovery_rsp); self->frame_sent = TRUE; } else self->frame_sent = FALSE; @@ -384,11 +387,21 @@ irlap_next_state( self, LAP_REPLY); } - dev_kfree_skb( skb); + dev_kfree_skb(skb); + break; + + case RECV_TEST_CMD: + skb_pull(skb, sizeof(struct test_frame)); + irlap_send_test_frame(self, info->daddr, skb); + dev_kfree_skb(skb); + break; + case RECV_TEST_RSP: + DEBUG(0, __FUNCTION__ "() not implemented!\n"); + dev_kfree_skb(skb); break; - default: - /* DEBUG( 0, "irlap_state_ndm: Unknown event"); */ + DEBUG(2, __FUNCTION__ "(), Unknown event %s", + irlap_event[event]); ret = -1; break; } @@ -414,14 +427,14 @@ ASSERT( info != NULL, return -1;); ASSERT( info->discovery != NULL, return -1;); - DEBUG( 4, __FUNCTION__ "(), daddr=%08x\n", - info->discovery->daddr); + DEBUG(4, __FUNCTION__ "(), daddr=%08x\n", + info->discovery->daddr); hashbin_insert( self->discovery_log, (QUEUE *) info->discovery, info->discovery->daddr, NULL); - dev_kfree_skb( skb); + dev_kfree_skb(skb); /* Keep state */ irlap_next_state( self, LAP_QUERY); @@ -453,8 +466,8 @@ } break; default: - DEBUG( 4, __FUNCTION__ "(), Unknown event %d, %s\n", event, - irlap_event[event]); + DEBUG(2, __FUNCTION__ "(), Unknown event %d, %s\n", event, + irlap_event[event]); if ( skb != NULL) { dev_kfree_skb( skb); @@ -475,7 +488,7 @@ static int irlap_state_reply( struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { - DISCOVERY *discovery_rsp; + discovery_t *discovery_rsp; int ret=0; DEBUG( 4, __FUNCTION__ "()\n"); @@ -503,19 +516,18 @@ irlap_next_state( self, LAP_NDM); irlap_discovery_indication( self, info->discovery); - } else if (( info->s >= self->slot) && - ( !self->frame_sent)) { - DEBUG( 4, "Sending XID rsp 2, s=%d\n", info->s); + } else if ((info->s >= self->slot) && (!self->frame_sent)) { discovery_rsp = irlmp_get_discovery_response(); + discovery_rsp->daddr = info->daddr; - irlap_send_discovery_xid_frame( self, info->S, - self->slot, FALSE, - discovery_rsp); + irlap_send_discovery_xid_frame(self, info->S, + self->slot, FALSE, + discovery_rsp); self->frame_sent = TRUE; - irlap_next_state( self, LAP_REPLY); + irlap_next_state(self, LAP_REPLY); } - dev_kfree_skb( skb); + dev_kfree_skb(skb); break; default: DEBUG(1, __FUNCTION__ "(), Unknown event %d, %s\n", event, @@ -1823,7 +1835,11 @@ irlap_next_state( self, LAP_NRM_S); #endif break; - + case RECV_TEST_CMD: + skb_pull(skb, sizeof(struct test_frame)); + irlap_send_test_frame(self, info->daddr, skb); + dev_kfree_skb(skb); + break; default: DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n", event, irlap_event[event]); diff -u --recursive --new-file v2.2.5/linux/net/irda/irlap_frame.c linux/net/irda/irlap_frame.c --- v2.2.5/linux/net/irda/irlap_frame.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irlap_frame.c Fri Apr 16 08:20:23 1999 @@ -1,12 +1,12 @@ /********************************************************************* * * Filename: irlap_frame.c - * Version: 0.8 + * Version: 0.9 * Description: Build and transmit IrLAP frames * Status: Experimental. * Author: Dag Brattli * Created at: Tue Aug 19 10:27:26 1997 - * Modified at: Sat Feb 20 01:40:14 1999 + * Modified at: Tue Apr 6 16:35:21 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , All Rights Resrved. @@ -22,14 +22,16 @@ * ********************************************************************/ -#include #include -#include - #include #include #include +#include + #include +#include + +#include #include #include @@ -39,8 +41,6 @@ #include #include -extern __u8 *irlmp_hint_to_service( __u8 *hint); - /* * Function irlap_insert_mtt (self, skb) * @@ -57,6 +57,7 @@ cb = (struct irlap_skb_cb *) skb->cb; + cb->magic = LAP_MAGIC; cb->mtt = self->mtt_required; /* Reset */ @@ -105,16 +106,11 @@ void irlap_send_snrm_frame(struct irlap_cb *self, struct qos_info *qos) { struct sk_buff *skb; - __u8 *frame; + struct snrm_frame *frame; int len; - int n; - - DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( self != NULL, return;); - ASSERT( self->magic == LAP_MAGIC, return;); - - n = 0; + ASSERT(self != NULL, return;); + ASSERT(self->magic == LAP_MAGIC, return;); /* Allocate frame */ skb = dev_alloc_skb(64); @@ -122,29 +118,28 @@ return; skb_put(skb, 2); - frame = skb->data; + frame = (struct snrm_frame *) skb->data; - /* Insert address field */ - frame[n] = CMD_FRAME; - frame[n++] |= (qos) ? CBROADCAST : self->caddr; + /* Insert connection address field */ + if (qos) + frame->caddr = CMD_FRAME | CBROADCAST; + else + frame->caddr = CMD_FRAME | self->caddr; /* Insert control field */ - frame[n++] = SNRM_CMD | PF_BIT; + frame->control = SNRM_CMD | PF_BIT; /* * If we are establishing a connection then insert QoS paramerters */ if (qos) { skb_put(skb, 9); /* 21 left */ - *((__u32 *)(frame+n)) = cpu_to_le32(self->saddr); n += 4; - *((__u32 *)(frame+n)) = cpu_to_le32(self->daddr); n += 4; - -/* memcpy(frame+n, &self->saddr, 4); n += 4; */ -/* memcpy(frame+n, &self->daddr, 4); n += 4; */ + frame->saddr = cpu_to_le32(self->saddr); + frame->daddr = cpu_to_le32(self->daddr); - frame[n++] = self->caddr; + frame->ncaddr = self->caddr; - len = irda_insert_qos_negotiation_params(qos, frame+n); + len = irda_insert_qos_negotiation_params(qos, frame->params); /* Should not be dangerous to do this afterwards */ skb_put(skb, len); } @@ -157,26 +152,32 @@ * Received SNRM (Set Normal Response Mode) command frame * */ -static void irlap_recv_snrm_cmd( struct irlap_cb *self, struct sk_buff *skb, - struct irlap_info *info) +static void irlap_recv_snrm_cmd(struct irlap_cb *self, struct sk_buff *skb, + struct irlap_info *info) { struct snrm_frame *frame; - DEBUG( 4, __FUNCTION__ "() <%ld>\n", jiffies); + DEBUG(3, __FUNCTION__ "()\n"); - ASSERT( skb != NULL, return;); - ASSERT( info != NULL, return;); + ASSERT(skb != NULL, return;); + ASSERT(info != NULL, return;); - frame = ( struct snrm_frame *) skb->data; + frame = (struct snrm_frame *) skb->data; /* Copy peer device address */ - /* memcpy( &info->daddr, &frame->saddr, 4); */ info->daddr = le32_to_cpu(frame->saddr); /* Copy connection address */ info->caddr = frame->ncaddr; - irlap_do_event( self, RECV_SNRM_CMD, skb, info); + /* Check if connection address has got a valid value */ + if ((info->caddr == 0x00) || (info->caddr == 0xfe)) { + DEBUG(3, __FUNCTION__ "(), invalid connection address!\n"); + dev_kfree_skb(skb); + return; + } + + irlap_do_event(self, RECV_SNRM_CMD, skb, info); } /* @@ -188,8 +189,7 @@ void irlap_send_ua_response_frame(struct irlap_cb *self, struct qos_info *qos) { struct sk_buff *skb; - __u8 *frame; - int n; + struct ua_frame *frame; int len; DEBUG(2, __FUNCTION__ "() <%ld>\n", jiffies); @@ -198,29 +198,25 @@ ASSERT(self->magic == LAP_MAGIC, return;); skb = NULL; - n = 0; /* Allocate frame */ - skb = dev_alloc_skb(64); + skb = dev_alloc_skb(64); if (!skb) return; skb_put( skb, 10); - frame = skb->data; + frame = (struct ua_frame *) skb->data; /* Build UA response */ - frame[n++] = self->caddr; - frame[n++] = UA_RSP | PF_BIT; + frame->caddr = self->caddr; + frame->control = UA_RSP | PF_BIT; - *((__u32 *)(frame+n)) = cpu_to_le32(self->saddr); n += 4; - *((__u32 *)(frame+n)) = cpu_to_le32(self->daddr); n += 4; + frame->saddr = cpu_to_le32(self->saddr); + frame->daddr = cpu_to_le32(self->daddr); -/* memcpy( frame+n, &self->saddr, 4); n += 4; */ -/* memcpy( frame+n, &self->daddr, 4); n += 4; */ - /* Should we send QoS negotiation parameters? */ if (qos) { - len = irda_insert_qos_negotiation_params(qos, frame+n); + len = irda_insert_qos_negotiation_params(qos, frame->params); skb_put(skb, len); } @@ -239,8 +235,8 @@ struct sk_buff *skb = NULL; __u8 *frame; - ASSERT( self != NULL, return;); - ASSERT( self->magic == LAP_MAGIC, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == LAP_MAGIC, return;); skb = dev_alloc_skb(32); if (!skb) @@ -249,7 +245,7 @@ skb_put( skb, 2); frame = skb->data; - if ( self->state == LAP_NDM) + if (self->state == LAP_NDM) frame[0] = CBROADCAST; else frame[0] = self->caddr; @@ -294,8 +290,8 @@ * Build and transmit a XID (eXchange station IDentifier) discovery * frame. */ -void irlap_send_discovery_xid_frame( struct irlap_cb *self, int S, __u8 s, - __u8 command, DISCOVERY *discovery) +void irlap_send_discovery_xid_frame(struct irlap_cb *self, int S, __u8 s, + __u8 command, discovery_t *discovery) { struct sk_buff *skb = NULL; struct xid_frame *frame; @@ -311,8 +307,8 @@ if (!skb) return; - skb_put( skb, 14); - frame = ( struct xid_frame *) skb->data; + skb_put(skb, 14); + frame = (struct xid_frame *) skb->data; if ( command) { frame->caddr = CBROADCAST | CMD_FRAME; @@ -324,16 +320,13 @@ frame->ident = XID_FORMAT; frame->saddr = cpu_to_le32(self->saddr); -/* memcpy( &frame->saddr, &self->saddr, 4); */ - if ( command) - /* memcpy( &frame->daddr, &bcast, 4); */ + if (command) frame->daddr = cpu_to_le32(bcast); else - /* memcpy( &frame->daddr, &self->daddr, 4); */ - frame->daddr = cpu_to_le32(self->daddr); + frame->daddr = cpu_to_le32(discovery->daddr); - switch( S) { + switch(S) { case 1: frame->flags = 0x00; break; @@ -362,15 +355,15 @@ if ( !command || ( frame->slotnr == 0xff)) { int i; - if (discovery->hint[0] & HINT_EXTENSION) + if (discovery->hints.byte[0] & HINT_EXTENSION) skb_put( skb, 3+discovery->info_len); else skb_put( skb, 2+discovery->info_len); i = 0; - frame->discovery_info[i++] = discovery->hint[0]; - if( discovery->hint[0] & HINT_EXTENSION) - frame->discovery_info[i++] = discovery->hint[1]; + frame->discovery_info[i++] = discovery->hints.byte[0]; + if(discovery->hints.byte[0] & HINT_EXTENSION) + frame->discovery_info[i++] = discovery->hints.byte[1]; frame->discovery_info[i++] = discovery->charset; @@ -391,47 +384,48 @@ * Received a XID discovery response * */ -static void irlap_recv_discovery_xid_rsp( struct irlap_cb *self, - struct sk_buff *skb, - struct irlap_info *info) +static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self, + struct sk_buff *skb, + struct irlap_info *info) { struct xid_frame *xid; - DISCOVERY *discovery = NULL; + discovery_t *discovery = NULL; char *text; - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( self != NULL, return;); - ASSERT( self->magic == LAP_MAGIC, return;); - ASSERT( skb != NULL, return;); - ASSERT( info != NULL, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == LAP_MAGIC, return;); + ASSERT(skb != NULL, return;); + ASSERT(info != NULL, return;); - if (( discovery = kmalloc( sizeof( DISCOVERY), GFP_ATOMIC)) == NULL) { - DEBUG( 0, __FUNCTION__ "(), kmalloc failed!\n"); + if ((discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) { + DEBUG(0, __FUNCTION__ "(), kmalloc failed!\n"); return; } - memset( discovery, 0, sizeof( DISCOVERY)); + memset(discovery, 0, sizeof(discovery_t)); xid = (struct xid_frame *) skb->data; /* * Copy peer device address and set the source address */ - memcpy( &info->daddr, &xid->saddr, 4); + info->daddr = le32_to_cpu(xid->saddr); discovery->daddr = info->daddr; discovery->saddr = self->saddr; + discovery->timestamp = jiffies; - DEBUG( 4, __FUNCTION__ "(), daddr=%08x\n", discovery->daddr); + DEBUG(4, __FUNCTION__ "(), daddr=%08x\n", discovery->daddr); /* Get info returned from peer */ - discovery->hint[0] = xid->discovery_info[0]; - if ( xid->discovery_info[0] & HINT_EXTENSION) { - DEBUG( 4, "EXTENSION\n"); - discovery->hint[1] = xid->discovery_info[1]; + discovery->hints.byte[0] = xid->discovery_info[0]; + if (xid->discovery_info[0] & HINT_EXTENSION) { + DEBUG(4, "EXTENSION\n"); + discovery->hints.byte[1] = xid->discovery_info[1]; discovery->charset = xid->discovery_info[2]; text = (char *) &xid->discovery_info[3]; } else { - discovery->hint[1] = 0; + discovery->hints.byte[1] = 0; discovery->charset = xid->discovery_info[1]; text = (char *) &xid->discovery_info[2]; } @@ -440,11 +434,11 @@ * FCS bytes resides. */ skb->data[skb->len] = '\0'; - strcpy( discovery->info, text); + strcpy(discovery->info, text); info->discovery = discovery; - irlap_do_event( self, RECV_DISCOVERY_XID_RSP, skb, info); + irlap_do_event(self, RECV_DISCOVERY_XID_RSP, skb, info); } /* @@ -458,7 +452,7 @@ struct irlap_info *info) { struct xid_frame *xid; - DISCOVERY *discovery = NULL; + discovery_t *discovery = NULL; char *text; DEBUG( 4, __FUNCTION__ "()\n"); @@ -471,7 +465,6 @@ xid = (struct xid_frame *) skb->data; /* Copy peer device address */ - /* memcpy( &info->daddr, &xid->saddr, 4); */ info->daddr = le32_to_cpu(xid->saddr); switch ( xid->flags & 0x03) { @@ -500,25 +493,24 @@ /* * We now have some discovery info to deliver! */ - discovery = kmalloc( sizeof( DISCOVERY), GFP_ATOMIC); - if ( !discovery) { - DEBUG( 0, __FUNCTION__ "(), kmalloc failed!\n"); + discovery = kmalloc( sizeof(discovery_t), GFP_ATOMIC); + if (!discovery) return; - } + discovery->daddr = info->daddr; discovery->saddr = self->saddr; + discovery->timestamp = jiffies; DEBUG( 4, __FUNCTION__ "(), daddr=%08x\n", discovery->daddr); - discovery->hint[0] = xid->discovery_info[0]; + discovery->hints.byte[0] = xid->discovery_info[0]; if ( xid->discovery_info[0] & HINT_EXTENSION) { - DEBUG( 4, "EXTENSION\n"); - discovery->hint[1] = xid->discovery_info[1]; + discovery->hints.byte[1] = xid->discovery_info[1]; discovery->charset = xid->discovery_info[2]; text = (char *) &xid->discovery_info[3]; } else { - discovery->hint[1] = 0; + discovery->hints.byte[1] = 0; discovery->charset = xid->discovery_info[1]; text = (char *) &xid->discovery_info[2]; } @@ -533,9 +525,6 @@ } else info->discovery = NULL; - DEBUG( 4, __FUNCTION__"(), s=%d, S=%d <%ld>\n", - info->s, info->S, jiffies); - irlap_do_event( self, RECV_DISCOVERY_XID_CMD, skb, info); } @@ -553,23 +542,11 @@ ASSERT( self != NULL, return;); ASSERT( self->magic == LAP_MAGIC, return;); -#ifdef CONFIG_IRDA_RECYCLE_RR - if ( self->recycle_rr_skb) { - DEBUG( 4, __FUNCTION__ "(), recycling skb!\n"); - skb = self->recycle_rr_skb; - self->recycle_rr_skb = NULL; - } -#endif - if (!skb) { - skb = dev_alloc_skb( 32); - if (!skb) - return; - - skb_put( skb, 2); - } - ASSERT( skb->len == 2, return;); - - frame = skb->data; + skb = dev_alloc_skb(32); + if (!skb) + return; + + frame = skb_put(skb, 2); frame[0] = self->caddr; frame[0] |= (command) ? CMD_FRAME : 0; @@ -584,18 +561,16 @@ /* * Function irlap_recv_rr_frame (skb, info) * - * Received RR (Receive Ready) frame from peer station - * - */ -static void irlap_recv_rr_frame( struct irlap_cb *self, struct sk_buff *skb, - struct irlap_info *info, int command) + * Received RR (Receive Ready) frame from peer station, no harm in + * making it inline since its called only from one single place + * (irlap_input). + */ +static inline void irlap_recv_rr_frame(struct irlap_cb *self, + struct sk_buff *skb, + struct irlap_info *info, int command) { __u8 *frame; - ASSERT( self != NULL, return;); - ASSERT( self->magic == LAP_MAGIC, return;); - ASSERT( skb != NULL, return;); - frame = skb->data; info->nr = frame[1] >> 5; @@ -609,32 +584,18 @@ * until it is outside a frame. */ #if 0 - if (( self->state != LAP_NRM_P) && ( self->state != LAP_NRM_S)) { - DEBUG( 0, __FUNCTION__ "(), Wrong state, dropping frame!\n"); - dev_kfree_skb( skb); + if ((self->state != LAP_NRM_P) && (self->state != LAP_NRM_S)) { + DEBUG(0, __FUNCTION__ "(), Wrong state, dropping frame!\n"); + dev_kfree_skb(skb); return; } #endif -#ifdef CONFIG_IRDA_RECYCLE_RR - /* Only recycle one RR frame */ - if ( self->recycle_rr_skb == NULL) { - - /* Keep this skb, so it can be reused */ - self->recycle_rr_skb = skb; - - /* - * Set skb to NULL, so that the state machine will not - * try to deallocate it. - */ - skb = NULL; - } -#endif /* Check if this is a command or a response frame */ - if ( command) - irlap_do_event( self, RECV_RR_CMD, skb, info); + if (command) + irlap_do_event(self, RECV_RR_CMD, skb, info); else - irlap_do_event( self, RECV_RR_RSP, skb, info); + irlap_do_event(self, RECV_RR_RSP, skb, info); } void irlap_send_frmr_frame( struct irlap_cb *self, int command) @@ -847,8 +808,8 @@ * Send I(nformation) frame as secondary with final bit set * */ -void irlap_send_data_secondary_final( struct irlap_cb *self, - struct sk_buff *skb) +void irlap_send_data_secondary_final(struct irlap_cb *self, + struct sk_buff *skb) { struct sk_buff *tx_skb = NULL; @@ -965,8 +926,7 @@ ASSERT( self != NULL, return;); ASSERT( self->magic == LAP_MAGIC, return;); - DEBUG( 4, __FUNCTION__ "(), retry_count=%d\n", - self->retry_count); + DEBUG( 4, __FUNCTION__ "(), retry_count=%d\n", self->retry_count); /* Initialize variables */ skb = tx_skb = NULL; @@ -1054,8 +1014,8 @@ * Contruct and transmit an Unnumbered Information (UI) frame * */ -void irlap_send_ui_frame( struct irlap_cb *self, struct sk_buff *skb, - int command) +void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb, + int command) { __u8 *frame; @@ -1079,8 +1039,8 @@ * * Contruct and transmit Information (I) frame */ -void irlap_send_i_frame( struct irlap_cb *self, struct sk_buff *skb, - int command) +void irlap_send_i_frame(struct irlap_cb *self, struct sk_buff *skb, + int command) { __u8 *frame; @@ -1096,37 +1056,22 @@ /* Insert next to receive (Vr) */ frame[1] |= (self->vr << 5); /* insert nr */ -#if 0 - { - int vr, vs, pf; - - /* Chech contents of various fields */ - vr = frame[1] >> 5; - vs = (frame[1] >> 1) & 0x07; - pf = (frame[1] >> 4) & 0x01; - - DEBUG(0, __FUNCTION__ "(), vs=%d, vr=%d, p=%d, %ld\n", - vs, vr, pf, jiffies); - } -#endif + irlap_queue_xmit(self, skb); } /* * Function irlap_recv_i_frame (skb, frame) * - * Receive and parse an I (Information) frame - * + * Receive and parse an I (Information) frame, no harm in making it inline + * since it's called only from one single place (irlap_input). */ -static void irlap_recv_i_frame( struct irlap_cb *self, struct sk_buff *skb, - struct irlap_info *info, int command) +static inline void irlap_recv_i_frame(struct irlap_cb *self, + struct sk_buff *skb, + struct irlap_info *info, int command) { __u8 *frame; - ASSERT( self != NULL, return;); - ASSERT( self->magic == LAP_MAGIC, return;); - ASSERT( skb != NULL, return;); - frame = skb->data; info->nr = frame[1] >> 5; /* Next to receive */ @@ -1143,17 +1088,17 @@ * it is receiving frames until the frame is delivered instead of * until it is outside a frame. */ - if (( self->state != LAP_NRM_P) && ( self->state != LAP_NRM_S)) { - DEBUG( 0, __FUNCTION__ "(), Wrong state, dropping frame!\n"); - dev_kfree_skb( skb); + if ((self->state != LAP_NRM_P) && ( self->state != LAP_NRM_S)) { + DEBUG(0, __FUNCTION__ "(), Wrong state, dropping frame!\n"); + dev_kfree_skb(skb); return; } /* Check if this is a command or a response frame */ - if ( command) - irlap_do_event( self, RECV_I_CMD, skb, info); + if (command) + irlap_do_event(self, RECV_I_CMD, skb, info); else - irlap_do_event( self, RECV_I_RSP, skb, info); + irlap_do_event(self, RECV_I_RSP, skb, info); } /* @@ -1227,22 +1172,94 @@ } /* - * Function irlap_input (skb) + * Function irlap_send_test_frame (self, daddr) + * + * Send a test frame response + * + */ +void irlap_send_test_frame(struct irlap_cb *self, __u32 daddr, + struct sk_buff *cmd) +{ + struct sk_buff *skb; + struct test_frame *frame; + + skb = dev_alloc_skb(32); + if (!skb) + return; + + skb_put(skb, sizeof(struct test_frame)); + + frame = (struct test_frame *) skb->data; + + /* Build header */ + if (self->state == LAP_NDM) + frame->caddr = CBROADCAST; /* Send response */ + else + frame->caddr = self->caddr; + + frame->control = TEST_RSP; + + /* Insert the swapped addresses */ + frame->saddr = cpu_to_le32(self->saddr); + frame->daddr = cpu_to_le32(daddr); + + /* Copy info */ + skb_put(skb, cmd->len); + memcpy(frame->info, cmd->data, cmd->len); + + /* Return to sender */ + irlap_wait_min_turn_around(self, &self->qos_tx); + irlap_queue_xmit(self, skb); +} + +/* + * Function irlap_recv_test_frame (self, skb) + * + * Receive a test frame * - * Called when a frame is received. Dispatches the right receive function - * for processing of the frame. */ -int irlap_input( struct sk_buff *skb, struct device *netdev, - struct packet_type *ptype) +void irlap_recv_test_frame(struct irlap_cb *self, struct sk_buff *skb, + struct irlap_info *info, int command) +{ + struct test_frame *frame; + + DEBUG(0, __FUNCTION__ "()\n"); + + if (skb->len < sizeof(struct test_frame)) { + DEBUG(0, __FUNCTION__ "() test frame to short!\n"); + return; + } + + frame = (struct test_frame *) skb->data; + + /* Read and swap addresses */ + info->daddr = le32_to_cpu(frame->saddr); + info->saddr = le32_to_cpu(frame->daddr); + + if (command) + irlap_do_event(self, RECV_TEST_CMD, skb, info); + else + irlap_do_event(self, RECV_TEST_RSP, skb, info); +} + +/* + * Function irlap_driver_rcv (skb, netdev, ptype) + * + * Called when a frame is received. Dispatches the right receive function + * for processing of the frame. + * + */ +int irlap_driver_rcv(struct sk_buff *skb, struct device *dev, + struct packet_type *ptype) { struct irlap_info info; struct irlap_cb *self; struct irda_device *idev; __u8 *frame; - int i, command; + int command; __u8 control; - idev = ( struct irda_device *) netdev->priv; + idev = (struct irda_device *) dev->priv; ASSERT( idev != NULL, return -1;); self = idev->irlap; @@ -1264,24 +1281,18 @@ /* * First check if this frame addressed to us */ - if (( info.caddr != self->caddr) && ( info.caddr != CBROADCAST)) { - - DEBUG( 0, __FUNCTION__ "(), Received frame is not for us!\n"); - for(i=0; i<(skb->len < 15?skb->len:15);i++) { - printk( "%02x ", frame[i]); - } - printk("\n"); - - dev_kfree_skb( skb); + if ((info.caddr != self->caddr) && (info.caddr != CBROADCAST)) { + DEBUG(2, __FUNCTION__ "(), Received frame is not for us!\n"); + dev_kfree_skb(skb); return 0; } /* * Optimize for the common case and check if the frame is an * I(nformation) frame. Only I-frames have bit 0 set to 0 */ - if( ~control & 0x01) { - irlap_recv_i_frame( self, skb, &info, command); + if(~control & 0x01) { + irlap_recv_i_frame(self, skb, &info, command); self->stats.rx_packets++; return 0; } @@ -1289,19 +1300,17 @@ * We now check is the frame is an S(upervisory) frame. Only * S-frames have bit 0 set to 1 and bit 1 set to 0 */ - if ( ~control & 0x02) { + if (~control & 0x02) { /* * Received S(upervisory) frame, check which frame type it is * only the first nibble is of interest */ - switch( control & 0x0f) { + switch(control & 0x0f) { case RR: irlap_recv_rr_frame( self, skb, &info, command); self->stats.rx_packets++; break; case RNR: - DEBUG( 4, "*** RNR frame received! pf = %d ***\n", - info.pf >> 4); irlap_recv_rnr_frame( self, skb, &info); self->stats.rx_packets++; break; @@ -1321,37 +1330,32 @@ /* * This must be a C(ontrol) frame */ - switch( control) { + switch(control) { case XID_RSP: - DEBUG( 4, "XID rsp frame received!\n"); - irlap_recv_discovery_xid_rsp( self, skb, &info); + irlap_recv_discovery_xid_rsp(self, skb, &info); break; case XID_CMD: - DEBUG( 4, "XID cmd frame received!\n"); - irlap_recv_discovery_xid_cmd( self, skb, &info); + irlap_recv_discovery_xid_cmd(self, skb, &info); break; case SNRM_CMD: - DEBUG( 4, "SNRM frame received!\n"); - irlap_recv_snrm_cmd( self, skb, &info); + irlap_recv_snrm_cmd(self, skb, &info); break; case DM_RSP: DEBUG( 0, "DM rsp frame received!\n"); - irlap_next_state( self, LAP_NDM); + irlap_next_state(self, LAP_NDM); break; case DISC_CMD: - DEBUG( 2, "DISC cmd frame received!\n"); - irlap_do_event( self, RECV_DISC_FRAME, skb, &info); + irlap_do_event(self, RECV_DISC_FRAME, skb, &info); break; case TEST_CMD: - DEBUG( 0, "Test frame received!\n"); - dev_kfree_skb( skb); + DEBUG(0,__FUNCTION__ "(), TEST_FRAME\n"); + irlap_recv_test_frame(self, skb, &info, command); break; case UA_RSP: DEBUG( 4, "UA rsp frame received!\n"); irlap_recv_ua_frame( self, skb, &info); break; case FRMR_RSP: - DEBUG( 4, "FRMR_RSP recevied!\n"); irlap_recv_frmr_frame( self, skb, &info); break; case UI_FRAME: diff -u --recursive --new-file v2.2.5/linux/net/irda/irlmp.c linux/net/irda/irlmp.c --- v2.2.5/linux/net/irda/irlmp.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irlmp.c Thu Apr 15 05:42:42 1999 @@ -1,12 +1,12 @@ /********************************************************************* * * Filename: irlmp.c - * Version: 0.8 + * Version: 0.9 * Description: IrDA Link Management Protocol (LMP) layer - * Status: Experimental. + * Status: Stable. * Author: Dag Brattli * Created at: Sun Aug 17 20:54:32 1997 - * Modified at: Sat Feb 20 01:28:39 1999 + * Modified at: Wed Apr 7 17:31:48 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , @@ -30,6 +30,9 @@ #include #include #include +#include +#include +#include #include #include @@ -39,14 +42,13 @@ #include #include #include -#include /* Master structure */ struct irlmp_cb *irlmp = NULL; /* These can be altered by the sysctl interface */ -int sysctl_discovery = 0; -int sysctl_discovery_slots = 6; +int sysctl_discovery = 0; +int sysctl_discovery_slots = 6; char sysctl_devname[65]; char *lmp_reasons[] = { @@ -61,8 +63,7 @@ __u8 *irlmp_hint_to_service( __u8 *hint); #ifdef CONFIG_PROC_FS -int irlmp_proc_read( char *buf, char **start, off_t offset, int len, - int unused); +int irlmp_proc_read(char *buf, char **start, off_t offst, int len, int unused); #endif /* @@ -83,19 +84,21 @@ irlmp->magic = LMP_MAGIC; - irlmp->registry = hashbin_new( HB_LOCAL); - irlmp->links = hashbin_new( HB_LOCAL); - irlmp->unconnected_lsaps = hashbin_new( HB_GLOBAL); + irlmp->clients = hashbin_new(HB_GLOBAL); + irlmp->services = hashbin_new(HB_GLOBAL); + irlmp->links = hashbin_new(HB_GLOBAL); + irlmp->unconnected_lsaps = hashbin_new(HB_GLOBAL); + irlmp->cachelog = hashbin_new(HB_GLOBAL); irlmp->free_lsap_sel = 0x10; /* Servers use 0x00-0x0f */ #ifdef CONFIG_IRDA_CACHE_LAST_LSAP irlmp->cache.valid = FALSE; #endif - strcpy( sysctl_devname, "Linux"); + strcpy(sysctl_devname, "Linux"); /* Do discovery every 3 seconds */ - init_timer( &irlmp->discovery_timer); - irlmp_start_discovery_timer( irlmp, 600); + init_timer(&irlmp->discovery_timer); + irlmp_start_discovery_timer(irlmp, 600); return 0; } @@ -109,18 +112,19 @@ void irlmp_cleanup(void) { /* Check for main structure */ - ASSERT( irlmp != NULL, return;); - ASSERT( irlmp->magic == LMP_MAGIC, return;); + ASSERT(irlmp != NULL, return;); + ASSERT(irlmp->magic == LMP_MAGIC, return;); - del_timer( &irlmp->discovery_timer); + del_timer(&irlmp->discovery_timer); - /* FIXME, we need a special function to deallocate LAPs */ - hashbin_delete( irlmp->links, (FREE_FUNC) kfree); - hashbin_delete( irlmp->unconnected_lsaps, (FREE_FUNC) kfree); - hashbin_delete( irlmp->registry, (FREE_FUNC) kfree); + hashbin_delete(irlmp->links, (FREE_FUNC) kfree); + hashbin_delete(irlmp->unconnected_lsaps, (FREE_FUNC) kfree); + hashbin_delete(irlmp->clients, (FREE_FUNC) kfree); + hashbin_delete(irlmp->services, (FREE_FUNC) kfree); + hashbin_delete(irlmp->cachelog, (FREE_FUNC) kfree); /* De-allocate main structure */ - kfree( irlmp); + kfree(irlmp); irlmp = NULL; } @@ -130,20 +134,20 @@ * Register with IrLMP and create a local LSAP, * returns handle to LSAP. */ -struct lsap_cb *irlmp_open_lsap( __u8 slsap_sel, struct notify_t *notify) +struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, struct notify_t *notify) { struct lsap_cb *self; - ASSERT( notify != NULL, return NULL;); - ASSERT( irlmp != NULL, return NULL;); - ASSERT( irlmp->magic == LMP_MAGIC, return NULL;); + ASSERT(notify != NULL, return NULL;); + ASSERT(irlmp != NULL, return NULL;); + ASSERT(irlmp->magic == LMP_MAGIC, return NULL;); - DEBUG( 4, __FUNCTION__ "(), slsap_sel=%02x\n", slsap_sel); + DEBUG(4, __FUNCTION__ "(), slsap_sel=%02x\n", slsap_sel); /* * Does the client care which Source LSAP selector it gets? */ - if ( slsap_sel == LSAP_ANY) { + if (slsap_sel == LSAP_ANY) { /* * Find unused LSAP */ @@ -155,41 +159,39 @@ * Client wants specific LSAP, so check if it's already * in use */ - if ( irlmp_slsap_inuse( slsap_sel)) { + if (irlmp_slsap_inuse(slsap_sel)) { return NULL; } - if ( slsap_sel > irlmp->free_lsap_sel) - irlmp->free_lsap_sel = slsap_sel+1; } /* * Allocate new instance of a LSAP connection */ - self = kmalloc( sizeof(struct lsap_cb), GFP_ATOMIC); - if ( self == NULL) { + self = kmalloc(sizeof(struct lsap_cb), GFP_ATOMIC); + if (self == NULL) { printk( KERN_ERR "IrLMP: Can't allocate memory for " "LSAP control block!\n"); return NULL; } - memset( self, 0, sizeof(struct lsap_cb)); + memset(self, 0, sizeof(struct lsap_cb)); self->magic = LMP_LSAP_MAGIC; self->slsap_sel = slsap_sel; self->dlsap_sel = LSAP_ANY; self->connected = FALSE; - init_timer( &self->watchdog_timer); + init_timer(&self->watchdog_timer); - ASSERT( notify->instance != NULL, return NULL;); + ASSERT(notify->instance != NULL, return NULL;); self->notify = *notify; - irlmp_next_lsap_state( self, LSAP_DISCONNECTED); + irlmp_next_lsap_state(self, LSAP_DISCONNECTED); /* * Insert into queue of unconnected LSAPs */ - hashbin_insert( irlmp->unconnected_lsaps, (QUEUE *) self, - self->slsap_sel, NULL); + hashbin_insert(irlmp->unconnected_lsaps, (QUEUE *) self, (int) self, + NULL); return self; } @@ -197,65 +199,62 @@ /* * Function irlmp_close_lsap (self) * - * Remove an instance of a LSAP + * Remove an instance of LSAP */ -static void __irlmp_close_lsap( struct lsap_cb *self) +static void __irlmp_close_lsap(struct lsap_cb *self) { - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( self != NULL, return;); - ASSERT( self->magic == LMP_LSAP_MAGIC, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == LMP_LSAP_MAGIC, return;); /* * Set some of the variables to preset values */ self->magic = ~LMP_LSAP_MAGIC; - del_timer( &self->watchdog_timer); /* Important! */ + del_timer(&self->watchdog_timer); /* Important! */ #ifdef CONFIG_IRDA_CACHE_LAST_LSAP - ASSERT( irlmp != NULL, return;); + ASSERT(irlmp != NULL, return;); irlmp->cache.valid = FALSE; #endif - kfree( self); + kfree(self); } /* * Function irlmp_close_lsap (self) * - * + * Close and remove LSAP * */ -void irlmp_close_lsap( struct lsap_cb *self) +void irlmp_close_lsap(struct lsap_cb *self) { struct lap_cb *lap; - struct lsap_cb *lsap; + struct lsap_cb *lsap = NULL; - ASSERT( self != NULL, return;); - ASSERT( self->magic == LMP_LSAP_MAGIC, return;); - - lap = self->lap; + ASSERT(self != NULL, return;); + ASSERT(self->magic == LMP_LSAP_MAGIC, return;); /* * Find out if we should remove this LSAP from a link or from the * list of unconnected lsaps (not associated with a link) */ - if ( lap == NULL) { - lsap = hashbin_remove( irlmp->unconnected_lsaps, - self->slsap_sel, NULL); - } else { - ASSERT( lap != NULL, return;); - ASSERT( lap->magic == LMP_LAP_MAGIC, return;); - - lsap = hashbin_remove( lap->lsaps, self->slsap_sel, NULL); + lap = self->lap; + if (lap) { + ASSERT(lap->magic == LMP_LAP_MAGIC, return;); + lsap = hashbin_remove(lap->lsaps, (int) self, NULL); + } + /* Check if we found the LSAP! If not then try the unconnected lsaps */ + if (!lsap) { + lsap = hashbin_remove(irlmp->unconnected_lsaps, (int) self, + NULL); } - if ( lsap == NULL) { - DEBUG( 1, __FUNCTION__ + if (!lsap) { + DEBUG(0, __FUNCTION__ "(), Looks like somebody has removed me already!\n"); return; } - ASSERT( lsap == self, return;); - - __irlmp_close_lsap( self); + __irlmp_close_lsap(self); } /* @@ -265,50 +264,47 @@ * instances of the IrLAP layer, each connected to different IrDA ports * */ -void irlmp_register_irlap( struct irlap_cb *irlap, __u32 saddr, - struct notify_t *notify) +void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, + struct notify_t *notify) { struct lap_cb *lap; - DEBUG( 4, __FUNCTION__ "(), Registered IrLAP, saddr = %08x\n", - saddr); + DEBUG(4, __FUNCTION__ "(), Registered IrLAP, saddr = %08x\n", saddr); - ASSERT( irlmp != NULL, return;); - ASSERT( irlmp->magic == LMP_MAGIC, return;); - ASSERT( notify != NULL, return;); + ASSERT(irlmp != NULL, return;); + ASSERT(irlmp->magic == LMP_MAGIC, return;); + ASSERT(notify != NULL, return;); /* * Allocate new instance of a LSAP connection */ - lap = kmalloc( sizeof(struct lap_cb), GFP_KERNEL); - if ( lap == NULL) { - printk( KERN_ERR "IrLMP: Can't allocate memory for " - "LAP control block!\n"); + lap = kmalloc(sizeof(struct lap_cb), GFP_KERNEL); + if (lap == NULL) { + DEBUG(3, __FUNCTION__ "(), unable to kmalloc\n"); return; } - memset( lap, 0, sizeof(struct lap_cb)); + memset(lap, 0, sizeof(struct lap_cb)); lap->irlap = irlap; lap->magic = LMP_LAP_MAGIC; lap->saddr = saddr; lap->daddr = DEV_ADDR_ANY; - lap->lsaps = hashbin_new( HB_GLOBAL); - lap->cachelog = hashbin_new( HB_LOCAL); + lap->lsaps = hashbin_new(HB_GLOBAL); - irlmp_next_lap_state( lap, LAP_STANDBY); + irlmp_next_lap_state(lap, LAP_STANDBY); init_timer(&lap->idle_timer); /* * Insert into queue of unconnected LSAPs */ - hashbin_insert( irlmp->links, (QUEUE *) lap, lap->saddr, NULL); + hashbin_insert(irlmp->links, (QUEUE *) lap, lap->saddr, NULL); /* * We set only this variable so IrLAP can tell us on which link the * different events happened on */ - irda_notify_init( notify); + irda_notify_init(notify); notify->instance = lap; } @@ -318,71 +314,24 @@ * IrLAP layer has been removed! * */ -void irlmp_unregister_irlap(__u32 saddr) +void irlmp_unregister_link(__u32 saddr) { - struct lap_cb *self; + struct lap_cb *link; DEBUG(4, __FUNCTION__ "()\n"); - self = hashbin_remove(irlmp->links, saddr, NULL); - if (self) { - ASSERT(self->magic == LMP_LAP_MAGIC, return;); - - del_timer(&self->idle_timer); - - self->magic = 0; - kfree(self); - } else { - DEBUG(1, __FUNCTION__ "(), Didn't find LAP layer!\n"); - } -} - -void dump_discoveries( hashbin_t *log) -{ - DISCOVERY *d; - - ASSERT( log != NULL, return;); - - d = (DISCOVERY *) hashbin_get_first( log); - while( d != NULL) { - DEBUG( 1, "Discovery:\n"); - DEBUG( 1, " daddr=%08x\n", d->daddr); - DEBUG( 1, " name=%s\n", d->info); - - d = (DISCOVERY *) hashbin_get_next( log); - } -} - -static struct lap_cb *irlmp_find_link( __u32 daddr) -{ - struct lap_cb *lap; - unsigned long flags; + link = hashbin_remove(irlmp->links, saddr, NULL); + if (link) { + ASSERT(link->magic == LMP_LAP_MAGIC, return;); - DEBUG( 1, __FUNCTION__ - "(), client didn't supply saddr, so try to look it up!\n"); + /* Remove all discoveries discovered at this link */ + irlmp_expire_discoveries(irlmp->cachelog, link->saddr, TRUE); - /* - * Find out which link to connect on, and make sure nothing strange - * happens while we traverse the list - */ - save_flags( flags); - cli(); + del_timer(&link->idle_timer); - lap = (struct lap_cb *) hashbin_get_first( irlmp->links); - while ( lap != NULL) { - ASSERT( lap->magic == LMP_LAP_MAGIC, return NULL;); - /* dump_discoveries( lap->cachelog); */ - - if ( hashbin_find( lap->cachelog, daddr, NULL)) { - DEBUG( 4, __FUNCTION__ - "() found link to connect on!\n"); - return lap; - } - lap = (struct lap_cb *) hashbin_get_next( irlmp->links); + link->magic = 0; + kfree(link); } - restore_flags(flags); - - return NULL; } /* @@ -398,36 +347,35 @@ struct sk_buff *skb = NULL; struct lap_cb *lap; struct lsap_cb *lsap; + discovery_t *discovery; ASSERT( self != NULL, return -1;); ASSERT( self->magic == LMP_LSAP_MAGIC, return -1;); - DEBUG( 4, __FUNCTION__ - "(), slsap_sel=%02x, dlsap_sel=%02x, saddr=%08x, daddr=%08x\n", - self->slsap_sel, dlsap_sel, saddr, daddr); + DEBUG(2, __FUNCTION__ + "(), slsap_sel=%02x, dlsap_sel=%02x, saddr=%08x, daddr=%08x\n", + self->slsap_sel, dlsap_sel, saddr, daddr); - if ( self->connected) { - DEBUG( 1, __FUNCTION__ "(), Error: already connected!!\n"); - + if ( self->connected) return -EISCONN; - } + + /* Client must supply destination device address */ + if (!daddr) + return -EINVAL; /* Any userdata? */ - if ( userdata == NULL) { - skb = dev_alloc_skb( 64); - if (skb == NULL) { - DEBUG( 1, __FUNCTION__ - "(), Could not allocate sk_buff of length %d\n", - 64); - return -1; - } - skb_reserve( skb, LMP_CONTROL_HEADER+LAP_HEADER); + if (userdata == NULL) { + skb = dev_alloc_skb(64); + if (!skb) + return -ENOMEM; + + skb_reserve(skb, LMP_CONTROL_HEADER+LAP_HEADER); } else skb = userdata; /* Make room for MUX control header ( 3 bytes) */ - ASSERT( skb_headroom( skb) >= LMP_CONTROL_HEADER, return -1;); - skb_push( skb, LMP_CONTROL_HEADER); + ASSERT(skb_headroom(skb) >= LMP_CONTROL_HEADER, return -1;); + skb_push(skb, LMP_CONTROL_HEADER); self->dlsap_sel = dlsap_sel; self->tmp_skb = skb; @@ -440,44 +388,48 @@ * discovery log and check if any of the links has discovered a * device with the given daddr */ - if ( saddr) - lap = hashbin_find( irlmp->links, saddr, NULL); - else - lap = irlmp_find_link( daddr); - - if ( lap == NULL) { - DEBUG( 1, __FUNCTION__ "(), Unable to find a usable link!\n"); - + if (!saddr) { + discovery = hashbin_find(irlmp->cachelog, daddr, NULL); + if (discovery) + saddr = discovery->saddr; + } + lap = hashbin_find(irlmp->links, saddr, NULL); + if (lap == NULL) { + DEBUG(1, __FUNCTION__ "(), Unable to find a usable link!\n"); return -EHOSTUNREACH; } + + if (lap->daddr == DEV_ADDR_ANY) + lap->daddr = daddr; + else if (lap->daddr != daddr) { + DEBUG(0, __FUNCTION__ "(), sorry, but link is busy!\n"); + return -EBUSY; + } + self->lap = lap; /* * Remove LSAP from list of unconnected LSAPs and insert it into the - * list of connected LSAPs for the particular link */ - lsap = hashbin_remove( irlmp->unconnected_lsaps, self->slsap_sel, - NULL); - - ASSERT( lsap != NULL, return -1;); - ASSERT( lsap->magic == LMP_LSAP_MAGIC, return -1;); - ASSERT( lsap->lap != NULL, return -1;); - ASSERT( lsap->lap->magic == LMP_LAP_MAGIC, return -1;); + * list of connected LSAPs for the particular link + */ + lsap = hashbin_remove(irlmp->unconnected_lsaps, (int) self, NULL); - hashbin_insert( self->lap->lsaps, (QUEUE *) self, self->slsap_sel, - NULL); + ASSERT(lsap != NULL, return -1;); + ASSERT(lsap->magic == LMP_LSAP_MAGIC, return -1;); + ASSERT(lsap->lap != NULL, return -1;); + ASSERT(lsap->lap->magic == LMP_LAP_MAGIC, return -1;); - self->connected = TRUE; + hashbin_insert(self->lap->lsaps, (QUEUE *) self, (int) self, NULL); + self->connected = TRUE; + /* * User supplied qos specifications? */ if (qos) self->qos = *qos; - DEBUG( 4, "*** Connecting SLSAP=%02x, DLSAP= %02x\n", - self->slsap_sel, self->dlsap_sel); - - irlmp_do_lsap_event( self, LM_CONNECT_REQUEST, skb); + irlmp_do_lsap_event(self, LM_CONNECT_REQUEST, skb); return 0; } @@ -488,26 +440,26 @@ * Incomming connection * */ -void irlmp_connect_indication( struct lsap_cb *self, struct sk_buff *skb) +void irlmp_connect_indication(struct lsap_cb *self, struct sk_buff *skb) { int max_seg_size; - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(3, __FUNCTION__ "()\n"); - ASSERT( self != NULL, return;); - ASSERT( self->magic == LMP_LSAP_MAGIC, return;); - ASSERT( skb != NULL, return;); - ASSERT( self->lap != NULL, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == LMP_LSAP_MAGIC, return;); + ASSERT(skb != NULL, return;); + ASSERT(self->lap != NULL, return;); self->qos = *self->lap->qos; max_seg_size = self->lap->qos->data_size.value; - DEBUG( 4, __FUNCTION__ "(), max_seg_size=%d\n", max_seg_size); + DEBUG(4, __FUNCTION__ "(), max_seg_size=%d\n", max_seg_size); /* Hide LMP_CONTROL_HEADER header from layer above */ - skb_pull( skb, LMP_CONTROL_HEADER); + skb_pull(skb, LMP_CONTROL_HEADER); - if ( self->notify.connect_indication) + if (self->notify.connect_indication) self->notify.connect_indication(self->notify.instance, self, &self->qos, max_seg_size, skb); } @@ -520,7 +472,7 @@ */ void irlmp_connect_response( struct lsap_cb *self, struct sk_buff *userdata) { - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(3, __FUNCTION__ "()\n"); ASSERT( self != NULL, return;); ASSERT( self->magic == LMP_LSAP_MAGIC, return;); @@ -543,11 +495,11 @@ * * LSAP connection confirmed peer device! */ -void irlmp_connect_confirm( struct lsap_cb *self, struct sk_buff *skb) +void irlmp_connect_confirm(struct lsap_cb *self, struct sk_buff *skb) { int max_seg_size; - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(3, __FUNCTION__ "()\n"); ASSERT( skb != NULL, return;); ASSERT( self != NULL, return;); @@ -569,12 +521,52 @@ } /* + * Function irlmp_dup (orig, instance) + * + * Duplicate LSAP, can be used by servers to confirm a connection on a + * new LSAP so it can keep listening on the old one. + * + */ +struct lsap_cb *irlmp_dup(struct lsap_cb *orig, void *instance) +{ + struct lsap_cb *new; + + DEBUG(1, __FUNCTION__ "()\n"); + + /* Only allowed to duplicate unconnected LSAP's */ + if (!hashbin_find(irlmp->unconnected_lsaps, (int) orig, NULL)) { + DEBUG(0, __FUNCTION__ "(), unable to find LSAP\n"); + return NULL; + } + new = kmalloc(sizeof(struct lsap_cb), GFP_ATOMIC); + if (!new) { + DEBUG(0, __FUNCTION__ "(), unable to kmalloc\n"); + return NULL; + } + /* Dup */ + memcpy(new, orig, sizeof(struct lsap_cb)); + new->notify.instance = instance; + + init_timer(&new->watchdog_timer); + + hashbin_insert(irlmp->unconnected_lsaps, (QUEUE *) new, (int) new, + NULL); + + /* Make sure that we invalidate the cache */ +#ifdef CONFIG_IRDA_CACHE_LAST_LSAP + irlmp->cache.valid = FALSE; +#endif /* CONFIG_IRDA_CACHE_LAST_LSAP */ + + return new; +} + +/* * Function irlmp_disconnect_request (handle, userdata) * * The service user is requesting disconnection, this will not remove the * LSAP, but only mark it as disconnected */ -void irlmp_disconnect_request( struct lsap_cb *self, struct sk_buff *userdata) +void irlmp_disconnect_request(struct lsap_cb *self, struct sk_buff *userdata) { struct lsap_cb *lsap; @@ -608,14 +600,14 @@ ASSERT( self->lap->magic == LMP_LAP_MAGIC, return;); ASSERT( self->lap->lsaps != NULL, return;); - lsap = hashbin_remove( self->lap->lsaps, self->slsap_sel, NULL); + lsap = hashbin_remove(self->lap->lsaps, (int) self, NULL); ASSERT( lsap != NULL, return;); ASSERT( lsap->magic == LMP_LSAP_MAGIC, return;); ASSERT( lsap == self, return;); - hashbin_insert( irlmp->unconnected_lsaps, (QUEUE *) self, - self->slsap_sel, NULL); + hashbin_insert(irlmp->unconnected_lsaps, (QUEUE *) self, (int) self, + NULL); /* Reset some values */ self->connected = FALSE; @@ -651,12 +643,12 @@ ASSERT( self->lap != NULL, return;); ASSERT( self->lap->lsaps != NULL, return;); - lsap = hashbin_remove( self->lap->lsaps, self->slsap_sel, NULL); + lsap = hashbin_remove( self->lap->lsaps, (int) self, NULL); ASSERT( lsap != NULL, return;); ASSERT( lsap == self, return;); - hashbin_insert( irlmp->unconnected_lsaps, (QUEUE *) lsap, - lsap->slsap_sel, NULL); + hashbin_insert(irlmp->unconnected_lsaps, (QUEUE *) lsap, (int) lsap, + NULL); self->lap = NULL; @@ -670,33 +662,24 @@ } /* - * Function irlmp_discovery_request (nslots) + * Function irlmp_do_discovery (nslots) * - * Do a discovery of devices in front of the computer + * Do some discovery on all links * */ -void irlmp_discovery_request( int nslots) +void irlmp_do_discovery(int nslots) { struct lap_cb *lap; - DEBUG( 4, __FUNCTION__ "(), nslots=%d\n", nslots); - - ASSERT( irlmp != NULL, return;); - - if ( !sysctl_discovery) - return; - - if ((nslots != 1)&&(nslots != 6)&&(nslots != 8)&&(nslots != 16)) { - DEBUG( 1, __FUNCTION__ "(), invalid number of slots value!\n"); + /* Make sure value is sane */ + if ((nslots != 1) && (nslots != 6) && (nslots != 8)&&(nslots != 16)) { + printk(KERN_WARNING __FUNCTION__ + "(), invalid value for number of slots!\n"); nslots = sysctl_discovery_slots = 8; } - /* - * Construct new discovery info to be used by IrLAP, - * TODO: no need to do this every time! - */ - irlmp->discovery_cmd.hint[0] = irlmp->hint[0]; - irlmp->discovery_cmd.hint[1] = irlmp->hint[1]; + /* Construct new discovery info to be used by IrLAP, */ + irlmp->discovery_cmd.hints.word = irlmp->hints.word; /* * Set character set for device name (we use ASCII), and @@ -704,134 +687,161 @@ * end */ irlmp->discovery_cmd.charset = CS_ASCII; - - strncpy( irlmp->discovery_cmd.info, sysctl_devname, 31); - irlmp->discovery_cmd.info_len = strlen( irlmp->discovery_cmd.info); + strncpy(irlmp->discovery_cmd.info, sysctl_devname, 31); + irlmp->discovery_cmd.info_len = strlen(irlmp->discovery_cmd.info); irlmp->discovery_cmd.nslots = nslots; /* * Try to send discovery packets on all links */ - lap = ( struct lap_cb *) hashbin_get_first( irlmp->links); - while ( lap != NULL) { - ASSERT( lap->magic == LMP_LAP_MAGIC, return;); - - DEBUG( 4, __FUNCTION__ "() sending request!\n"); - irlmp_do_lap_event( lap, LM_LAP_DISCOVERY_REQUEST, NULL); + lap = (struct lap_cb *) hashbin_get_first(irlmp->links); + while (lap != NULL) { + ASSERT(lap->magic == LMP_LAP_MAGIC, return;); - lap = ( struct lap_cb *) hashbin_get_next( irlmp->links); + if (lap->lap_state == LAP_STANDBY) { + /* Expire discoveries discovered on this link */ + irlmp_expire_discoveries(irlmp->cachelog, lap->saddr, + FALSE); + + /* Try to discover */ + irlmp_do_lap_event(lap, LM_LAP_DISCOVERY_REQUEST, + NULL); + } + lap = (struct lap_cb *) hashbin_get_next(irlmp->links); } } /* + * Function irlmp_discovery_request (nslots) + * + * Do a discovery of devices in front of the computer + * + */ +void irlmp_discovery_request(int nslots) +{ + + DEBUG(4, __FUNCTION__ "(), nslots=%d\n", nslots); + + /* + * If discovery is already running, then just return the current + * discovery log + */ + if (sysctl_discovery) { + DEBUG(2, __FUNCTION__ "() discovery already running, so we" + " just return the old discovery log!\n"); + irlmp_discovery_confirm(irlmp->cachelog); + } else + irlmp_do_discovery(nslots); +} + +#if 0 +/* * Function irlmp_check_services (discovery) * * * */ -void irlmp_check_services( DISCOVERY *discovery) +void irlmp_check_services(discovery_t *discovery) { - struct irlmp_registration *entry; + struct irlmp_client *client; struct irmanager_event event; - __u8 *service; + __u8 *service_log; + __u8 service; int i = 0; DEBUG(1, "IrDA Discovered: %s\n", discovery->info); DEBUG(1, " Services: "); - service = irlmp_hint_to_service( discovery->hint); - if (service != NULL) { - /* - * Check all services on the device - */ - while ( service[i] != S_END) { - DEBUG( 4, "service=%02x\n", service[i]); - entry = hashbin_find( irlmp->registry, - service[i], NULL); - if ( entry && entry->discovery_callback) { - DEBUG( 4, "discovery_callback!\n"); - entry->discovery_callback( discovery); - } else { - /* - * Found no clients for dealing with this - * service, so ask the user space irmanager - * to try to load the right module for us - */ - - event.event = EVENT_DEVICE_DISCOVERED; - event.service = service[i]; - event.daddr = discovery->daddr; - sprintf( event.info, "%s", - discovery->info); - irmanager_notify( &event); - } - i++; /* Next service */ + service_log = irlmp_hint_to_service(discovery->hints.byte); + if (!service_log) + return; + + /* + * Check all services on the device + */ + while ((service = service_log[i++]) != S_END) { + DEBUG( 4, "service=%02x\n", service); + client = hashbin_find(irlmp->registry, service, NULL); + if (entry && entry->discovery_callback) { + DEBUG( 4, "discovery_callback!\n"); + + entry->discovery_callback(discovery); + } else { + /* Don't notify about the ANY service */ + if (service == S_ANY) + continue; + /* + * Found no clients for dealing with this service, + * so ask the user space irmanager to try to load + * the right module for us + */ + event.event = EVENT_DEVICE_DISCOVERED; + event.service = service; + event.daddr = discovery->daddr; + sprintf(event.info, "%s", discovery->info); + irmanager_notify(&event); } - kfree( service); } + kfree(service_log); } - +#endif /* - * Function irlmp_discovery_confirm ( self, log) + * Function irlmp_notify_client (log) + * + * Notify all about discovered devices * - * Some device(s) answered to our discovery request! Check to see which - * device it is, and give indication to the client(s) - * */ -void irlmp_discovery_confirm( struct lap_cb *self, hashbin_t *log) +void irlmp_notify_client(irlmp_client_t *client, hashbin_t *log) { - DISCOVERY *discovery; + discovery_t *discovery; + + DEBUG(3, __FUNCTION__ "()\n"); - DEBUG( 4, __FUNCTION__ "()\n"); + /* Check if client wants the whole log */ + if (client->callback2) + client->callback2(log); - ASSERT( self != NULL, return;); - ASSERT( self->magic == LMP_LAP_MAGIC, return;); - - /* - * Now, check all discovered devices (if any) + /* + * Now, check all discovered devices (if any), and notify client + * only about the services that the client is interested in */ - discovery = ( DISCOVERY *) hashbin_get_first( log); - while ( discovery != NULL) { - self->daddr = discovery->daddr; - - DEBUG( 4, "discovery->daddr = 0x%08x\n", discovery->daddr); + discovery = (discovery_t *) hashbin_get_first(log); + while (discovery != NULL) { + DEBUG(3, "discovery->daddr = 0x%08x\n", discovery->daddr); - irlmp_check_services( discovery); - - discovery = ( DISCOVERY *) hashbin_get_next( log); + if (client->hint_mask & discovery->hints.word) { + if (client->callback1) + client->callback1(discovery); + } + discovery = (discovery_t *) hashbin_get_next(log); } } /* - * Function irlmp_discovery_indication (discovery) - * - * A remote device is discovering us! + * Function irlmp_discovery_confirm ( self, log) * + * Some device(s) answered to our discovery request! Check to see which + * device it is, and give indication to the client(s) + * */ -void irlmp_discovery_indication( struct lap_cb *self, DISCOVERY *discovery) +void irlmp_discovery_confirm(hashbin_t *log) { - /* struct irda_event event; */ - - ASSERT( self != NULL, return;); - ASSERT( self->magic == LMP_LAP_MAGIC, return;); - ASSERT( discovery != NULL, return;); - - DEBUG( 4, __FUNCTION__ "()\n"); - - DEBUG( 4, "discovery->daddr = 0x%08x\n", discovery->daddr); - self->daddr = discovery->daddr; - - ASSERT( self->cachelog != NULL, return;); - - /* - * Insert this discovery device into the discovery_log if its - * not there already - */ - if ( !hashbin_find( self->cachelog, discovery->daddr, NULL)) - hashbin_insert( self->cachelog, (QUEUE *) discovery, - discovery->daddr, NULL); - - irlmp_check_services( discovery); + irlmp_client_t *client; + + DEBUG(3, __FUNCTION__ "()\n"); + + ASSERT(log != NULL, return;); + + if (!hashbin_get_size(log)) + return; + + client = (irlmp_client_t *) hashbin_get_first(irlmp->clients); + while (client != NULL) { + /* Check if we should notify client */ + irlmp_notify_client(client, log); + + client = (irlmp_client_t *) hashbin_get_next(irlmp->clients); + } } /* @@ -840,14 +850,13 @@ * Used by IrLAP to get the disocvery info it needs when answering * discovery requests by other devices. */ -DISCOVERY *irlmp_get_discovery_response() +discovery_t *irlmp_get_discovery_response() { - DEBUG( 4, "irlmp_get_discovery_response()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( irlmp != NULL, return NULL;); + ASSERT(irlmp != NULL, return NULL;); - irlmp->discovery_rsp.hint[0] = irlmp->hint[0]; - irlmp->discovery_rsp.hint[1] = irlmp->hint[1]; + irlmp->discovery_rsp.hints.word = irlmp->hints.word; /* * Set character set for device name (we use ASCII), and @@ -856,8 +865,8 @@ */ irlmp->discovery_rsp.charset = CS_ASCII; - strncpy( irlmp->discovery_rsp.info, sysctl_devname, 31); - irlmp->discovery_rsp.info_len = strlen( irlmp->discovery_rsp.info) + 2; + strncpy(irlmp->discovery_rsp.info, sysctl_devname, 31); + irlmp->discovery_rsp.info_len = strlen(irlmp->discovery_rsp.info) + 2; return &irlmp->discovery_rsp; } @@ -870,17 +879,17 @@ */ void irlmp_data_request( struct lsap_cb *self, struct sk_buff *skb) { - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( skb != NULL, return;); - ASSERT( self != NULL, return;); - ASSERT( self->magic == LMP_LSAP_MAGIC, return;); + ASSERT(skb != NULL, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == LMP_LSAP_MAGIC, return;); /* Make room for MUX header */ - ASSERT( skb_headroom( skb) >= LMP_HEADER, return;); - skb_push( skb, LMP_HEADER); + ASSERT(skb_headroom( skb) >= LMP_HEADER, return;); + skb_push(skb, LMP_HEADER); - irlmp_do_lsap_event( self, LM_DATA_REQUEST, skb); + irlmp_do_lsap_event(self, LM_DATA_REQUEST, skb); } /* @@ -889,18 +898,18 @@ * Got data from LAP layer so pass it up to upper layer * */ -void irlmp_data_indication( struct lsap_cb *self, struct sk_buff *skb) +void irlmp_data_indication(struct lsap_cb *self, struct sk_buff *skb) { - DEBUG( 4, __FUNCTION__ "()\n"); + DEBUG(4, __FUNCTION__ "()\n"); - ASSERT( self != NULL, return;); - ASSERT( self->magic == LMP_LSAP_MAGIC, return;); - ASSERT( skb != NULL, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == LMP_LSAP_MAGIC, return;); + ASSERT(skb != NULL, return;); /* Hide LMP header from layer above */ - skb_pull( skb, LMP_HEADER); + skb_pull(skb, LMP_HEADER); - if ( self->notify.data_indication) + if (self->notify.data_indication) self->notify.data_indication(self->notify.instance, self, skb); } @@ -940,9 +949,8 @@ /* Hide LMP header from layer above */ skb_pull( skb, LMP_HEADER); - if ( self->notify.udata_indication) - self->notify.udata_indication( self->notify.instance, self, - skb); + if (self->notify.udata_indication) + self->notify.udata_indication(self->notify.instance, self, skb); } /* @@ -1043,145 +1051,228 @@ } DEBUG(1, "\n"); + /* So that client can be notified about any discovery */ + service[i++] = S_ANY; + service[i] = S_END; return service; } /* - * Function irlmp_service_to_hint (service, hint) + * Function irlmp_service_to_hint (service) * - * + * Converts a service type, to a hint bit * + * Returns: a 16 bit hint value, with the service bit set */ -void irlmp_service_to_hint( int service, __u8 *hint) +__u16 irlmp_service_to_hint(int service) { + __u16_host_order hint; + + hint.word = 0; + switch (service) { case S_PNP: - hint[0] |= HINT_PNP; + hint.byte[0] |= HINT_PNP; break; case S_PDA: - hint[0] |= HINT_PDA; + hint.byte[0] |= HINT_PDA; break; case S_COMPUTER: - hint[0] |= HINT_COMPUTER; + hint.byte[0] |= HINT_COMPUTER; break; case S_PRINTER: - hint[0] |= HINT_PRINTER; + hint.byte[0] |= HINT_PRINTER; break; case S_MODEM: - hint[0] |= HINT_PRINTER; + hint.byte[0] |= HINT_PRINTER; break; case S_LAN: - hint[0] |= HINT_LAN; + hint.byte[0] |= HINT_LAN; break; case S_COMM: - hint[0] |= HINT_EXTENSION; - hint[1] |= HINT_COMM; + hint.byte[0] |= HINT_EXTENSION; + hint.byte[1] |= HINT_COMM; break; case S_OBEX: - hint[0] |= HINT_EXTENSION; - hint[1] |= HINT_OBEX; + hint.byte[0] |= HINT_EXTENSION; + hint.byte[1] |= HINT_OBEX; + break; + case S_ANY: + hint.word = 0xffff; break; default: DEBUG( 1, __FUNCTION__ "(), Unknown service!\n"); break; } + return hint.word; } /* - * Function irlmp_register (service, type, callback) + * Function irlmp_register_service (service) * - * Register a local client or server with IrLMP + * Register local service with IrLMP * */ -void irlmp_register_layer( int service, int type, int do_discovery, - DISCOVERY_CALLBACK callback) +__u32 irlmp_register_service(__u16 hints) { - struct irlmp_registration *entry; + irlmp_service_t *service; + __u32 handle; - sysctl_discovery |= do_discovery; + DEBUG(4, __FUNCTION__ "(), hints = %04x\n", hints); - if ( type & SERVER) - irlmp_service_to_hint( service, irlmp->hint); + /* Get a unique handle for this service */ + get_random_bytes(&handle, sizeof(handle)); + while (hashbin_find(irlmp->services, handle, NULL) || !handle) + get_random_bytes(&handle, sizeof(handle)); - /* Check if this service has been registred before */ - entry = hashbin_find( irlmp->registry, service, NULL); - if ( entry != NULL) { - /* Update type in entry */ - entry->type |= type; + irlmp->hints.word |= hints; - /* Update callback only if client, since servers don't - * use callbacks, and we don't want to overwrite a - * previous registred client callback - */ - if ( type & CLIENT) - entry->discovery_callback = callback; - return; + /* Make a new registration */ + service = kmalloc(sizeof(irlmp_service_t), GFP_ATOMIC); + if (!service) { + DEBUG(1, __FUNCTION__ "(), Unable to kmalloc!\n"); + return 0; } + service->hints = hints; + hashbin_insert(irlmp->services, (QUEUE*) service, handle, NULL); + + return handle; +} + +/* + * Function irlmp_unregister_service (handle) + * + * Unregister service with IrLMP. + * + * Returns: 0 on success, -1 on error + */ +int irlmp_unregister_service(__u32 handle) +{ + irlmp_service_t *service; + + DEBUG(4, __FUNCTION__ "()\n"); + + if (!handle) + return -1; + + service = hashbin_find(irlmp->services, handle, NULL); + if (!service) { + DEBUG(1, __FUNCTION__ "(), Unknown service!\n"); + return -1; + } + + service = hashbin_remove(irlmp->services, handle, NULL); + if (service) + kfree(service); + + /* Remove old hint bits */ + irlmp->hints.word = 0; + + /* Refresh current hint bits */ + service = (irlmp_service_t *) hashbin_get_first(irlmp->services); + while (service) { + irlmp->hints.word |= service->hints; + + service = (irlmp_service_t *)hashbin_get_next(irlmp->services); + } + return 0; +} + +/* + * Function irlmp_register_client (hint_mask, callback1, callback2) + * + * Register a local client with IrLMP + * + * Returns: handle > 0 on success, 0 on error + */ +__u32 irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 callback1, + DISCOVERY_CALLBACK2 callback2) +{ + irlmp_client_t *client; + __u32 handle; + + /* Get a unique handle for this client */ + get_random_bytes(&handle, sizeof(handle)); + while (hashbin_find(irlmp->clients, handle, NULL) || !handle) + get_random_bytes(&handle, sizeof(handle)); /* Make a new registration */ - entry = kmalloc( sizeof( struct irlmp_registration), GFP_ATOMIC); - if ( !entry) { + client = kmalloc(sizeof(irlmp_client_t), GFP_ATOMIC); + if (!client) { DEBUG( 1, __FUNCTION__ "(), Unable to kmalloc!\n"); - return; + + return 0; } - entry->service = service; - entry->type = type; - entry->discovery_callback = callback; + /* Register the details */ + client->hint_mask = hint_mask; + client->callback1 = callback1; + client->callback2 = callback2; - hashbin_insert( irlmp->registry, (QUEUE*) entry, entry->service, NULL); + hashbin_insert(irlmp->clients, (QUEUE *) client, handle, NULL); + + return handle; } /* - * Function irlmp_unregister (serivice) + * Function irlmp_update_client (handle, hint_mask, callback1, callback2) * - * + * Updates specified client (handle) with possibly new hint_mask and + * callback * + * Returns: 0 on success, -1 on error */ -void irlmp_unregister_layer( int service, int type) +int irlmp_update_client(__u32 handle, __u16 hint_mask, + DISCOVERY_CALLBACK1 callback1, + DISCOVERY_CALLBACK2 callback2) { - struct irlmp_registration *entry; - - DEBUG( 4, __FUNCTION__ "()\n"); - - entry = hashbin_find( irlmp->registry, service, NULL); - if ( entry != NULL) { - DEBUG( 4, "Found entry to change or remove!\n"); - /* Remove this type from the service registration */ - entry->type &= ~type; - } + irlmp_client_t *client; - if ( !entry) { - DEBUG( 1, __FUNCTION__ "Unable to find entry to unregister!\n"); - return; - } + if (!handle) + return -1; - /* - * Remove entry if there is no more client and server support - * left in entry - */ - if ( !entry->type) { - DEBUG( 4, __FUNCTION__ "(), removing entry!\n"); - entry = hashbin_remove( irlmp->registry, service, NULL); - if ( entry != NULL) - kfree( entry); + client = hashbin_find(irlmp->clients, handle, NULL); + if (!client) { + DEBUG(1, __FUNCTION__ "(), Unknown client!\n"); + return -1; } - /* Remove old hint bits */ - irlmp->hint[0] = 0; - irlmp->hint[1] = 0; + client->hint_mask = hint_mask; + client->callback1 = callback1; + client->callback2 = callback2; + + return 0; +} - /* Refresh current hint bits */ - entry = (struct irlmp_registration *) hashbin_get_first( irlmp->registry); - while( entry != NULL) { - if ( entry->type & SERVER) - irlmp_service_to_hint( entry->service, - irlmp->hint); - entry = (struct irlmp_registration *) - hashbin_get_next( irlmp->registry); - } +/* + * Function irlmp_unregister_client (handle) + * + * Returns: 0 on success, -1 on error + * + */ +int irlmp_unregister_client(__u32 handle) +{ + struct irlmp_client *client; + + DEBUG(4, __FUNCTION__ "()\n"); + + if (!handle) + return -1; + + client = hashbin_find(irlmp->clients, handle, NULL); + if (!client) { + DEBUG(1, __FUNCTION__ "(), Unknown client!\n"); + return -1; + } + + DEBUG( 4, __FUNCTION__ "(), removing client!\n"); + client = hashbin_remove( irlmp->clients, handle, NULL); + if (client) + kfree(client); + + return 0; } /* @@ -1200,20 +1291,24 @@ DEBUG( 4, __FUNCTION__ "()\n"); + /* Valid values are between 0 and 127 */ + if (slsap_sel > 127) + return TRUE; + /* * Check if slsap is already in use. To do this we have to loop over * every IrLAP connection and check every LSAP assosiated with each * the connection. */ - lap = ( struct lap_cb *) hashbin_get_first( irlmp->links); - while ( lap != NULL) { - ASSERT( lap->magic == LMP_LAP_MAGIC, return TRUE;); - - self = (struct lsap_cb *) hashbin_get_first( lap->lsaps); - while ( self != NULL) { - ASSERT( self->magic == LMP_LSAP_MAGIC, return TRUE;); + lap = (struct lap_cb *) hashbin_get_first(irlmp->links); + while (lap != NULL) { + ASSERT(lap->magic == LMP_LAP_MAGIC, return TRUE;); + + self = (struct lsap_cb *) hashbin_get_first(lap->lsaps); + while (self != NULL) { + ASSERT(self->magic == LMP_LSAP_MAGIC, return TRUE;); - if (( self->slsap_sel == slsap_sel))/* && */ + if ((self->slsap_sel == slsap_sel))/* && */ /* ( self->dlsap_sel == LSAP_ANY)) */ { DEBUG( 4, "Source LSAP selector=%02x in use\n", @@ -1236,14 +1331,28 @@ __u8 irlmp_find_free_slsap(void) { __u8 lsap_sel; + int wrapped = 0; - ASSERT( irlmp != NULL, return -1;); - ASSERT( irlmp->magic == LMP_MAGIC, return -1;); + ASSERT(irlmp != NULL, return -1;); + ASSERT(irlmp->magic == LMP_MAGIC, return -1;); lsap_sel = irlmp->free_lsap_sel++; - - DEBUG( 4, __FUNCTION__ "(), next free lsap_sel=%02x\n", lsap_sel); - + + /* Check if the new free lsap is really free */ + while (irlmp_slsap_inuse(irlmp->free_lsap_sel)) { + irlmp->free_lsap_sel++; + + /* Check if we need to wraparound */ + if (irlmp->free_lsap_sel > 127) { + irlmp->free_lsap_sel = 10; + + /* Make sure we terminate the loop */ + if (wrapped++) + return 0; + } + } + DEBUG(4, __FUNCTION__ "(), next free lsap_sel=%02x\n", lsap_sel); + return lsap_sel; } @@ -1289,7 +1398,7 @@ __u32 irlmp_get_saddr(struct lsap_cb *self) { - DEBUG(0, __FUNCTION__ "()\n"); + DEBUG(3, __FUNCTION__ "()\n"); ASSERT(self != NULL, return 0;); ASSERT(self->lap != NULL, return 0;); @@ -1299,7 +1408,7 @@ __u32 irlmp_get_daddr(struct lsap_cb *self) { - DEBUG(0, __FUNCTION__ "()\n"); + DEBUG(3, __FUNCTION__ "()\n"); ASSERT(self != NULL, return 0;); ASSERT(self->lap != NULL, return 0;); diff -u --recursive --new-file v2.2.5/linux/net/irda/irlmp_event.c linux/net/irda/irlmp_event.c --- v2.2.5/linux/net/irda/irlmp_event.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irlmp_event.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Mon Aug 4 20:40:53 1997 - * Modified at: Thu Feb 11 01:24:21 1999 + * Modified at: Thu Apr 8 16:26:41 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , @@ -149,36 +149,37 @@ { /* struct irlmp_cb *self = ( struct irlmp_cb *) data; */ - DEBUG( 4, "IrLMP, discovery timer expired!\n"); + DEBUG(4, "IrLMP, discovery timer expired!\n"); - irlmp_discovery_request( sysctl_discovery_slots); + if (sysctl_discovery) + irlmp_do_discovery(sysctl_discovery_slots); /* Restart timer */ - irlmp_start_discovery_timer( irlmp, 300); + irlmp_start_discovery_timer(irlmp, 300); } void irlmp_watchdog_timer_expired( unsigned long data) { struct lsap_cb *self = ( struct lsap_cb *) data; - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(2, __FUNCTION__ "()\n"); - ASSERT( self != NULL, return;); - ASSERT( self->magic == LMP_LSAP_MAGIC, return;); + ASSERT(self != NULL, return;); + ASSERT(self->magic == LMP_LSAP_MAGIC, return;); - irlmp_do_lsap_event( self, LM_WATCHDOG_TIMEOUT, NULL); + irlmp_do_lsap_event(self, LM_WATCHDOG_TIMEOUT, NULL); } void irlmp_idle_timer_expired(unsigned long data) { struct lap_cb *self = (struct lap_cb *) data; - DEBUG( 0, __FUNCTION__ "()\n"); + DEBUG(2, __FUNCTION__ "()\n"); ASSERT(self != NULL, return;); ASSERT(self->magic == LMP_LAP_MAGIC, return;); - irlmp_do_lap_event( self, LM_LAP_IDLE_TIMEOUT, NULL); + irlmp_do_lap_event(self, LM_LAP_IDLE_TIMEOUT, NULL); } /********************************************************************* @@ -193,8 +194,8 @@ * STANDBY, The IrLAP connection does not exist. * */ -static void irlmp_state_standby( struct lap_cb *self, IRLMP_EVENT event, - struct sk_buff *skb) +static void irlmp_state_standby(struct lap_cb *self, IRLMP_EVENT event, + struct sk_buff *skb) { DEBUG( 4, __FUNCTION__ "()\n"); ASSERT( self->irlap != NULL, return;); @@ -203,11 +204,11 @@ case LM_LAP_DISCOVERY_REQUEST: /* irlmp_next_station_state( LMP_DISCOVER); */ - irlap_discovery_request( self->irlap, &irlmp->discovery_cmd); + irlap_discovery_request(self->irlap, &irlmp->discovery_cmd); break; case LM_LAP_DISCOVERY_CONFIRM: /* irlmp_next_station_state( LMP_READY); */ - irlmp_discovery_confirm( self, self->cachelog); + irlmp_discovery_confirm(irlmp->cachelog); break; case LM_LAP_CONNECT_INDICATION: /* It's important to switch state first, to avoid IrLMP to @@ -323,11 +324,22 @@ * notify all LSAPs using this LAP, but that should be safe to * do anyway. */ - lsap = ( struct lsap_cb *) hashbin_get_first( self->lsaps); - while ( lsap != NULL) { + lsap = (struct lsap_cb *) hashbin_get_first(self->lsaps); + while (lsap != NULL) { irlmp_do_lsap_event(lsap, LM_LAP_CONNECT_CONFIRM, skb); lsap = (struct lsap_cb*) hashbin_get_next(self->lsaps); } + + /* Needed by connect indication */ + lsap = (struct lsap_cb *) hashbin_get_first(irlmp->unconnected_lsaps); + while (lsap != NULL) { + lsap_current = lsap; + + /* Be sure to stay one item ahead */ + lsap = (struct lsap_cb*) hashbin_get_next(irlmp->unconnected_lsaps); + irlmp_do_lsap_event(lsap_current, + LM_LAP_CONNECT_CONFIRM, skb); + } /* Keep state */ break; case LM_LAP_DISCONNECT_REQUEST: @@ -394,8 +406,6 @@ static void irlmp_state_disconnected( struct lsap_cb *self, IRLMP_EVENT event, struct sk_buff *skb) { - struct lsap_cb *lsap; - DEBUG( 4, __FUNCTION__ "()\n"); ASSERT( self != NULL, return;); @@ -406,31 +416,15 @@ DEBUG( 4, __FUNCTION__ "(), LM_CONNECT_REQUEST\n"); irlmp_next_lsap_state( self, LSAP_SETUP_PEND); - irlmp_do_lap_event( self->lap, LM_LAP_CONNECT_REQUEST, NULL); + irlmp_do_lap_event(self->lap, LM_LAP_CONNECT_REQUEST, NULL); /* Start watchdog timer ( 5 secs for now) */ - irlmp_start_watchdog_timer( self, 500); + irlmp_start_watchdog_timer(self, 500); break; case LM_CONNECT_INDICATION: - irlmp_next_lsap_state( self, LSAP_CONNECT_PEND); - - /* - * Bind this LSAP to the IrLAP link where the connect was - * received - * FIXME: this should be done in the LAP state machine - */ - lsap = hashbin_remove( irlmp->unconnected_lsaps, - self->slsap_sel, NULL); + irlmp_next_lsap_state(self, LSAP_CONNECT_PEND); - ASSERT( lsap == self, return;); - - ASSERT( self->lap != NULL, return;); - ASSERT( self->lap->lsaps != NULL, return;); - - hashbin_insert( self->lap->lsaps, (QUEUE *) self, - self->slsap_sel, NULL); - - irlmp_do_lap_event( self->lap, LM_LAP_CONNECT_REQUEST, skb); + irlmp_do_lap_event(self->lap, LM_LAP_CONNECT_REQUEST, skb); break; default: DEBUG( 4, __FUNCTION__ "(), Unknown event %d\n", event); @@ -447,6 +441,7 @@ static void irlmp_state_connect( struct lsap_cb *self, IRLMP_EVENT event, struct sk_buff *skb) { + struct lsap_cb *lsap; DEBUG( 4, __FUNCTION__ "()\n"); @@ -457,12 +452,27 @@ case LM_CONNECT_RESPONSE: ASSERT( skb != NULL, return;); - irlmp_send_lcf_pdu( self->lap, self->dlsap_sel, - self->slsap_sel, CONNECT_CNF, skb); + /* + * Bind this LSAP to the IrLAP link where the connect was + * received + */ + lsap = hashbin_remove(irlmp->unconnected_lsaps, (int) self, + NULL); - del_timer( &self->watchdog_timer); + ASSERT(lsap == self, return;); + + ASSERT(self->lap != NULL, return;); + ASSERT(self->lap->lsaps != NULL, return;); + + hashbin_insert(self->lap->lsaps, (QUEUE *) self, (int) self, + NULL); - irlmp_next_lsap_state( self, LSAP_DATA_TRANSFER_READY); + irlmp_send_lcf_pdu(self->lap, self->dlsap_sel, + self->slsap_sel, CONNECT_CNF, skb); + + del_timer(&self->watchdog_timer); + + irlmp_next_lsap_state(self, LSAP_DATA_TRANSFER_READY); break; default: DEBUG( 4, __FUNCTION__ "(), Unknown event\n"); @@ -476,8 +486,8 @@ * CONNECT_PEND * */ -static void irlmp_state_connect_pend( struct lsap_cb *self, IRLMP_EVENT event, - struct sk_buff *skb) +static void irlmp_state_connect_pend(struct lsap_cb *self, IRLMP_EVENT event, + struct sk_buff *skb) { DEBUG( 4, __FUNCTION__ "()\n"); @@ -489,22 +499,20 @@ /* Keep state */ break; case LM_CONNECT_RESPONSE: - printk( KERN_WARNING - "IrLMP CONNECT-PEND, No indication issued yet\n"); + DEBUG(0, __FUNCTION__ "(), LM_CONNECT_RESPONSE, " + "no indication issued yet\n"); /* Keep state */ break; case LM_DISCONNECT_REQUEST: - printk( KERN_WARNING - "IrLMP CONNECT-PEND, " - "Not yet bound to IrLAP connection\n"); + DEBUG(0, __FUNCTION__ "(), LM_DISCONNECT_REQUEST, " + "not yet bound to IrLAP connection\n"); /* Keep state */ break; case LM_LAP_CONNECT_CONFIRM: - DEBUG( 4, "irlmp_state_connect_pend: LS_CONNECT_CONFIRM\n"); - irlmp_next_lsap_state( self, LSAP_CONNECT); - irlmp_connect_indication( self, skb); + DEBUG(4, __FUNCTION__ "(), LS_CONNECT_CONFIRM\n"); + irlmp_next_lsap_state(self, LSAP_CONNECT); + irlmp_connect_indication(self, skb); break; - default: DEBUG( 4, __FUNCTION__ "Unknown event %d\n", event); break; @@ -530,13 +538,13 @@ switch( event) { case LM_CONNECT_REQUEST: - printk( KERN_WARNING - "IrLMP DTR: Error, LSAP allready connected\n"); + DEBUG(0, __FUNCTION__ "(), LM_CONNECT_REQUEST, " + "error, LSAP already connected\n"); /* Keep state */ break; case LM_CONNECT_RESPONSE: - printk( KERN_WARNING - "IrLMP DTR: Error, LSAP allready connected\n"); + DEBUG(0, __FUNCTION__ "(), LM_CONNECT_RESPONSE, " + "error, LSAP allready connected\n"); /* Keep state */ break; case LM_DISCONNECT_REQUEST: @@ -596,7 +604,6 @@ irlmp_do_lap_event(self->lap, LM_LAP_DISCONNECT_REQUEST, NULL); irlmp_disconnect_indication( self, reason, skb); - break; default: DEBUG( 4, __FUNCTION__ "(), Unknown event %d\n", event); @@ -632,18 +639,19 @@ irlmp_connect_confirm( self, skb); break; case LM_DISCONNECT_INDICATION: - irlmp_next_lsap_state( self, LSAP_DISCONNECTED); + DEBUG(0, __FUNCTION__ "(), this should never happen!!\n"); + break; + case LM_LAP_DISCONNECT_INDICATION: + irlmp_next_lsap_state(self, LSAP_DISCONNECTED); - del_timer( &self->watchdog_timer); + del_timer(&self->watchdog_timer); - ASSERT( self->lap != NULL, return;); - ASSERT( self->lap->magic == LMP_LAP_MAGIC, return;); + ASSERT(self->lap != NULL, return;); + ASSERT(self->lap->magic == LMP_LAP_MAGIC, return;); - ASSERT(skb != NULL, return;); - ASSERT(skb->len > 3, return;); - reason = skb->data[3]; + reason = irlmp_convert_lap_reason(self->lap->reason); - irlmp_disconnect_indication( self, reason, skb); + irlmp_disconnect_indication(self, reason, skb); break; case LM_WATCHDOG_TIMEOUT: DEBUG( 0, __FUNCTION__ "() WATCHDOG_TIMEOUT!\n"); diff -u --recursive --new-file v2.2.5/linux/net/irda/irlmp_frame.c linux/net/irda/irlmp_frame.c --- v2.2.5/linux/net/irda/irlmp_frame.c Wed Mar 10 15:29:52 1999 +++ linux/net/irda/irlmp_frame.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Tue Aug 19 02:09:59 1997 - * Modified at: Thu Feb 18 08:48:28 1999 + * Modified at: Tue Apr 6 18:31:11 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli @@ -32,6 +32,7 @@ #include #include #include +#include static struct lsap_cb *irlmp_find_lsap( struct lap_cb *self, __u8 dlsap, __u8 slsap, int status, hashbin_t *); @@ -123,32 +124,32 @@ * Check if this is an incoming connection, since we must deal with * it in a different way than other established connections. */ - if (( fp[0] & CONTROL_BIT) && ( fp[2] == CONNECT_CMD)) { - DEBUG( 4,"Incoming connection, source LSAP=%d, dest LSAP=%d\n", - slsap_sel, dlsap_sel); + if ((fp[0] & CONTROL_BIT) && ( fp[2] == CONNECT_CMD)) { + DEBUG(3,"Incoming connection, source LSAP=%d, dest LSAP=%d\n", + slsap_sel, dlsap_sel); /* Try to find LSAP among the unconnected LSAPs */ - lsap = irlmp_find_lsap( self, dlsap_sel, slsap_sel, - CONNECT_CMD, irlmp->unconnected_lsaps); + lsap = irlmp_find_lsap(self, dlsap_sel, slsap_sel, CONNECT_CMD, + irlmp->unconnected_lsaps); /* Maybe LSAP was already connected, so try one more time */ - if ( !lsap) - lsap = irlmp_find_lsap( self, dlsap_sel, slsap_sel, 0, - self->lsaps); + if (!lsap) + lsap = irlmp_find_lsap(self, dlsap_sel, slsap_sel, 0, + self->lsaps); } else - lsap = irlmp_find_lsap( self, dlsap_sel, slsap_sel, 0, - self->lsaps); + lsap = irlmp_find_lsap(self, dlsap_sel, slsap_sel, 0, + self->lsaps); - if ( lsap == NULL) { - DEBUG( 0, "IrLMP, Sorry, no LSAP for received frame!\n"); - DEBUG( 0, __FUNCTION__ - "(), slsap_sel = %02x, dlsap_sel = %02x\n", slsap_sel, - dlsap_sel); - if ( fp[0] & CONTROL_BIT) { - DEBUG( 0, __FUNCTION__ - "(), received control frame %02x\n", fp[2]); + if (lsap == NULL) { + DEBUG(0, "IrLMP, Sorry, no LSAP for received frame!\n"); + DEBUG(0, __FUNCTION__ + "(), slsap_sel = %02x, dlsap_sel = %02x\n", slsap_sel, + dlsap_sel); + if (fp[0] & CONTROL_BIT) { + DEBUG(0, __FUNCTION__ + "(), received control frame %02x\n", fp[2]); } else { - DEBUG( 0, __FUNCTION__ "(), received data frame\n"); + DEBUG(0, __FUNCTION__ "(), received data frame\n"); } dev_kfree_skb( skb); return; @@ -157,19 +158,19 @@ /* * Check if we received a control frame? */ - if ( fp[0] & CONTROL_BIT) { - switch( fp[2]) { + if (fp[0] & CONTROL_BIT) { + switch(fp[2]) { case CONNECT_CMD: lsap->lap = self; - irlmp_do_lsap_event( lsap, LM_CONNECT_INDICATION, skb); + irlmp_do_lsap_event(lsap, LM_CONNECT_INDICATION, skb); break; case CONNECT_CNF: - irlmp_do_lsap_event( lsap, LM_CONNECT_CONFIRM, skb); + irlmp_do_lsap_event(lsap, LM_CONNECT_CONFIRM, skb); break; case DISCONNECT: DEBUG( 4, __FUNCTION__ "(), Disconnect indication!\n"); - irlmp_do_lsap_event( lsap, LM_DISCONNECT_INDICATION, - skb); + irlmp_do_lsap_event(lsap, LM_DISCONNECT_INDICATION, + skb); break; case ACCESSMODE_CMD: DEBUG( 0, "Access mode cmd not implemented!\n"); @@ -182,10 +183,10 @@ "(), Unknown control frame %02x\n", fp[2]); break; } - } else if ( reliable == LAP_RELIABLE) { + } else if (reliable == LAP_RELIABLE) { /* Must be pure data */ irlmp_do_lsap_event( lsap, LM_DATA_INDICATION, skb); - } else if ( reliable == LAP_UNRELIABLE) { + } else if (reliable == LAP_UNRELIABLE) { irlmp_do_lsap_event( lsap, LM_UDATA_INDICATION, skb); } } @@ -207,6 +208,7 @@ ASSERT(lap->magic == LMP_LAP_MAGIC, return;); lap->reason = reason; + lap->daddr = DEV_ADDR_ANY; /* FIXME: must do something with the userdata if any */ @@ -260,6 +262,24 @@ } /* + * Function irlmp_link_discovery_indication (self, log) + * + * Device is discovering us + * + */ +void irlmp_link_discovery_indication(struct lap_cb *self, + discovery_t *discovery) +{ + ASSERT(self != NULL, return;); + ASSERT(self->magic == LMP_LAP_MAGIC, return;); + + irlmp_add_discovery(irlmp->cachelog, discovery); + + /* Just handle it the same way as a discovery confirm */ + irlmp_do_lap_event(self, LM_LAP_DISCOVERY_CONFIRM, NULL); +} + +/* * Function irlmp_link_discovery_confirm (self, log) * * Called by IrLAP with a list of discoveries after the discovery @@ -267,54 +287,22 @@ * was unable to carry out the discovery request * */ -void irlmp_link_discovery_confirm( struct lap_cb *self, hashbin_t *log) +void irlmp_link_discovery_confirm(struct lap_cb *self, hashbin_t *log) { -/* DISCOVERY *discovery; */ - hashbin_t *old_log; + DEBUG(4, __FUNCTION__ "()\n"); - DEBUG( 4, __FUNCTION__ "()\n"); - - ASSERT( self != NULL, return;); - ASSERT( self->magic == LMP_LAP_MAGIC, return;); - - ASSERT( self->cachelog != NULL, return;); - - /* - * If log is missing this means that IrLAP was unable to perform the - * discovery, so restart discovery again with just the half timeout - * of the normal one. - */ - if ( !log) { - irlmp_start_discovery_timer( irlmp, 150); - return; - } - -#if 0 - discovery = hashbin_remove_first( log); - while ( discovery) { - DEBUG( 0, __FUNCTION__ "(), found %s\n", discovery->info); - - /* Remove any old discovery of this device */ - hashbin_remove( self->cachelog, discovery->daddr, NULL); - - /* Insert the new one */ - hashbin_insert( self->cachelog, (QUEUE *) discovery, - discovery->daddr, NULL); - - discovery = hashbin_remove_first( log); - } -#endif - old_log = self->cachelog; - self->cachelog = log; - hashbin_delete( old_log, (FREE_FUNC) kfree); + ASSERT(self != NULL, return;); + ASSERT(self->magic == LMP_LAP_MAGIC, return;); + + irlmp_add_discovery_log(irlmp->cachelog, log); - irlmp_do_lap_event( self, LM_LAP_DISCOVERY_CONFIRM, NULL); + irlmp_do_lap_event(self, LM_LAP_DISCOVERY_CONFIRM, NULL); DEBUG( 4, __FUNCTION__ "() -->\n"); } #ifdef CONFIG_IRDA_CACHE_LAST_LSAP -__inline__ void irlmp_update_cache( struct lsap_cb *self) +inline void irlmp_update_cache(struct lsap_cb *self) { /* Update cache entry */ irlmp->cache.dlsap_sel = self->dlsap_sel; @@ -330,9 +318,9 @@ * Find handle assosiated with destination and source LSAP * */ -static struct lsap_cb *irlmp_find_lsap( struct lap_cb *self, __u8 dlsap_sel, - __u8 slsap_sel, int status, - hashbin_t *queue) +static struct lsap_cb *irlmp_find_lsap(struct lap_cb *self, __u8 dlsap_sel, + __u8 slsap_sel, int status, + hashbin_t *queue) { struct lsap_cb *lsap; @@ -345,17 +333,14 @@ * cache first to avoid the linear search */ #ifdef CONFIG_IRDA_CACHE_LAST_LSAP - ASSERT( irlmp != NULL, return NULL;); - if (( irlmp->cache.valid) && ( irlmp->cache.slsap_sel == slsap_sel) && ( irlmp->cache.dlsap_sel == dlsap_sel)) { - DEBUG( 4, __FUNCTION__ "(), Using cached LSAP\n"); - return ( irlmp->cache.lsap); - } + return (irlmp->cache.lsap); + } #endif - lsap = ( struct lsap_cb *) hashbin_get_first( queue); + lsap = ( struct lsap_cb *) hashbin_get_first(queue); while ( lsap != NULL) { /* * If this is an incomming connection, then the destination @@ -372,7 +357,7 @@ lsap->dlsap_sel = dlsap_sel; #ifdef CONFIG_IRDA_CACHE_LAST_LSAP - irlmp_update_cache( lsap); + irlmp_update_cache(lsap); #endif return lsap; } diff -u --recursive --new-file v2.2.5/linux/net/irda/irlpt/irlpt_cli.c linux/net/irda/irlpt/irlpt_cli.c --- v2.2.5/linux/net/irda/irlpt/irlpt_cli.c Wed Mar 10 15:29:53 1999 +++ linux/net/irda/irlpt/irlpt_cli.c Thu Apr 15 05:42:42 1999 @@ -43,19 +43,16 @@ #include #include -int irlpt_client_init(void); -static void irlpt_client_cleanup(void); +int irlpt_client_init(void); static void irlpt_client_close(struct irlpt_cb *self); -static void irlpt_client_discovery_indication( DISCOVERY *); +static void irlpt_client_discovery_indication(discovery_t *); -static void irlpt_client_connect_confirm( void *instance, - void *sap, - struct qos_info *qos, - int max_seg_size, - struct sk_buff *skb); -static void irlpt_client_disconnect_indication( void *instance, - void *sap, +static void irlpt_client_connect_confirm(void *instance, void *sap, + struct qos_info *qos, + __u32 max_seg_size, + struct sk_buff *skb); +static void irlpt_client_disconnect_indication( void *instance, void *sap, LM_REASON reason, struct sk_buff *userdata); static void irlpt_client_expired(unsigned long data); @@ -65,6 +62,8 @@ #endif static char *version = "IrLPT client, v2 (Thomas Davis)"; +static __u32 ckey; /* IrLMP client handle */ + struct file_operations client_fops = { irlpt_seek, /* seek */ NULL, /* read_irlpt (server) */ @@ -177,6 +176,8 @@ */ __initfunc(int irlpt_client_init(void)) { + __u16 hints; + DEBUG( irlpt_client_debug, "--> "__FUNCTION__ "\n"); printk( KERN_INFO "%s\n", version); @@ -187,9 +188,9 @@ "IrLPT client: Can't allocate hashbin!\n"); return -ENOMEM; } - - irlmp_register_layer( S_PRINTER, CLIENT, TRUE, - irlpt_client_discovery_indication); + hints = irlmp_service_to_hint(S_PRINTER); + ckey = irlmp_register_client(hints, irlpt_client_discovery_indication, + NULL); #ifdef CONFIG_PROC_FS proc_register( &proc_irda, &proc_irlpt_client); @@ -210,7 +211,7 @@ { DEBUG( irlpt_client_debug, "--> "__FUNCTION__ "\n"); - irlmp_unregister_layer( S_PRINTER, CLIENT); + irlmp_unregister_client(ckey); /* * Delete hashbin and close all irlpt client instances in it @@ -232,6 +233,7 @@ */ static struct irlpt_cb *irlpt_client_open( __u32 daddr) { + struct irmanager_event mgr_event; struct irlpt_cb *self; DEBUG( irlpt_client_debug, "--> "__FUNCTION__ "\n"); @@ -251,7 +253,6 @@ hashbin_get_size(irlpt_clients)); hashbin_insert( irlpt_clients, (QUEUE *) self, daddr, NULL); - } self->ir_dev.minor = MISC_DYNAMIC_MINOR; @@ -270,6 +271,11 @@ irlpt_client_next_state( self, IRLPT_CLIENT_IDLE); + /* Tell irmanager to create /dev/irlpt */ + mgr_event.event = EVENT_IRLPT_START; + sprintf(mgr_event.devname, "%s", self->ifname); + irmanager_notify(&mgr_event); + MOD_INC_USE_COUNT; DEBUG( irlpt_client_debug, __FUNCTION__ " -->\n"); @@ -284,6 +290,7 @@ */ static void irlpt_client_close( struct irlpt_cb *self) { + struct irmanager_event mgr_event; struct sk_buff *skb; DEBUG( irlpt_client_debug, "--> " __FUNCTION__ "\n"); @@ -291,6 +298,11 @@ ASSERT( self != NULL, return;); ASSERT( self->magic == IRLPT_MAGIC, return;); + /* Tell irmanager to remove /dev/irlpt */ + mgr_event.event = EVENT_IRLPT_STOP; + sprintf(mgr_event.devname, "%s", self->ifname); + irmanager_notify(&mgr_event); + while (( skb = skb_dequeue(&self->rx_queue)) != NULL) { DEBUG(irlpt_client_debug, __FUNCTION__ ": freeing SKB\n"); @@ -312,7 +324,7 @@ * device it is, and which services it has. * */ -static void irlpt_client_discovery_indication( DISCOVERY *discovery) +static void irlpt_client_discovery_indication(discovery_t *discovery) { struct irlpt_info info; struct irlpt_cb *self; @@ -409,10 +421,10 @@ * * LSAP connection confirmed! */ -static void irlpt_client_connect_confirm( void *instance, void *sap, - struct qos_info *qos, - int max_sdu_size, - struct sk_buff *skb) +static void irlpt_client_connect_confirm(void *instance, void *sap, + struct qos_info *qos, + __u32 max_sdu_size, + struct sk_buff *skb) { struct irlpt_info info; struct irlpt_cb *self; @@ -455,20 +467,20 @@ * This function gets the data that is received on the data channel * */ -static void irlpt_client_data_indication( void *instance, void *sap, - struct sk_buff *skb) +static int irlpt_client_data_indication(void *instance, void *sap, + struct sk_buff *skb) { struct irlpt_cb *self; DEBUG( irlpt_client_debug, "--> " __FUNCTION__ "\n"); - ASSERT( skb != NULL, return;); + ASSERT( skb != NULL, return -1;); DEBUG( irlpt_client_debug, __FUNCTION__ ": len=%d\n", (int) skb->len); self = ( struct irlpt_cb *) instance; - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRLPT_MAGIC, return;); + ASSERT( self != NULL, return -1;); + ASSERT( self->magic == IRLPT_MAGIC, return -1;); #if 1 { int i; @@ -496,6 +508,8 @@ /* } */ DEBUG( irlpt_client_debug, __FUNCTION__ " -->\n"); + + return 0; } /* diff -u --recursive --new-file v2.2.5/linux/net/irda/irlpt/irlpt_srvr.c linux/net/irda/irlpt/irlpt_srvr.c --- v2.2.5/linux/net/irda/irlpt/irlpt_srvr.c Wed Mar 10 15:29:53 1999 +++ linux/net/irda/irlpt/irlpt_srvr.c Thu Apr 15 05:42:42 1999 @@ -48,27 +48,25 @@ #endif /* CONFIG_PROC_FS */ int irlpt_server_init(void); -static void irlpt_server_cleanup(void); -static void irlpt_server_disconnect_indication( void *instance, - void *sap, +static void irlpt_server_disconnect_indication(void *instance, void *sap, LM_REASON reason, struct sk_buff *skb); -static void irlpt_server_connect_confirm( void *instance, - void *sap, - struct qos_info *qos, - int max_seg_size, - struct sk_buff *skb); -static void irlpt_server_connect_indication( void *instance, - void *sap, - struct qos_info *qos, - int max_seg_size, - struct sk_buff *skb); -static void irlpt_server_data_indication( void *instance, - void *sap, - struct sk_buff *skb); +static void irlpt_server_connect_confirm(void *instance, void *sap, + struct qos_info *qos, + __u32 max_seg_size, + struct sk_buff *skb); +static void irlpt_server_connect_indication(void *instance, + void *sap, + struct qos_info *qos, + __u32 max_seg_size, + struct sk_buff *skb); +static int irlpt_server_data_indication(void *instance, void *sap, + struct sk_buff *skb); static void register_irlpt_server(void); static void deregister_irlpt_server(void); +static __u32 skey; /* IrLMP service handle */ + int irlpt_server_lsap = LSAP_IRLPT; int irlpt_server_debug = 4; @@ -183,6 +181,8 @@ /*int irlpt_init( struct device *dev) {*/ __initfunc(int irlpt_server_init(void)) { + __u16 hints; + DEBUG( irlpt_server_debug, "--> " __FUNCTION__ "\n"); printk( KERN_INFO "%s\n", version); @@ -195,7 +195,6 @@ " irlpt_server control block!\n"); return -ENOMEM; } - memset( irlpt_server, 0, sizeof(struct irlpt_cb)); sprintf(irlpt_server->ifname, "irlpt_server"); @@ -210,7 +209,8 @@ skb_queue_head_init(&irlpt_server->rx_queue); - irlmp_register_layer( S_PRINTER, SERVER, FALSE, NULL); + hints = irlmp_service_to_hint(S_PRINTER); + skey = irlmp_register_service(hints); register_irlpt_server(); @@ -235,12 +235,11 @@ DEBUG( irlpt_server_debug, "--> " __FUNCTION__ "\n"); + irlmp_unregister_service(skey); deregister_irlpt_server(); while (( skb = skb_dequeue(&irlpt_server->rx_queue)) != NULL) { DEBUG(irlpt_server_debug, __FUNCTION__ ": freeing SKB\n"); - IS_SKB( skb, return;); - FREE_SKB_MAGIC( skb); dev_kfree_skb( skb); } @@ -307,11 +306,11 @@ * * LSAP connection confirmed! */ -static void irlpt_server_connect_confirm( void *instance, - void *sap, - struct qos_info *qos, - int max_seg_size, - struct sk_buff *skb) +static void irlpt_server_connect_confirm(void *instance, + void *sap, + struct qos_info *qos, + __u32 max_seg_size, + struct sk_buff *skb) { struct irlpt_cb *self; @@ -332,11 +331,11 @@ * Function irlpt_connect_indication (handle) * */ -static void irlpt_server_connect_indication( void *instance, - void *sap, - struct qos_info *qos, - int max_seg_size, - struct sk_buff *skb) +static void irlpt_server_connect_indication(void *instance, + void *sap, + struct qos_info *qos, + __u32 max_seg_size, + struct sk_buff *skb) { struct irlpt_cb *self; struct irlpt_info info; @@ -368,21 +367,19 @@ * This function gets the data that is received on the data channel * */ -static void irlpt_server_data_indication( void *instance, - void *sap, - struct sk_buff *skb) +static int irlpt_server_data_indication(void *instance, void *sap, + struct sk_buff *skb) { - struct irlpt_cb *self; DEBUG( irlpt_server_debug, "--> " __FUNCTION__ "\n"); self = ( struct irlpt_cb *) instance; - ASSERT( self != NULL, return;); - ASSERT( self->magic == IRLPT_MAGIC, return;); + ASSERT( self != NULL, return -1;); + ASSERT( self->magic == IRLPT_MAGIC, return -1;); - ASSERT( skb != NULL, return;); + ASSERT( skb != NULL, return -1;); DEBUG( irlpt_server_debug, __FUNCTION__ ": len=%d\n", (int) skb->len); @@ -394,6 +391,8 @@ wake_up_interruptible(&self->read_wait); DEBUG( irlpt_server_debug, __FUNCTION__ " -->\n"); + + return 0; } /* @@ -484,14 +483,15 @@ */ int init_module(void) { + int ret; DEBUG( irlpt_server_debug, "--> IrLPT server: init_module\n"); - irlpt_server_init(); + ret = irlpt_server_init(); DEBUG( irlpt_server_debug, "IrLPT server: init_module -->\n"); - return 0; + return ret; } /* diff -u --recursive --new-file v2.2.5/linux/net/irda/irmod.c linux/net/irda/irmod.c --- v2.2.5/linux/net/irda/irmod.c Wed Mar 10 15:29:53 1999 +++ linux/net/irda/irmod.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Mon Dec 15 13:55:39 1997 - * Modified at: Thu Feb 18 08:51:50 1999 + * Modified at: Mon Mar 29 09:06:52 1999 * Modified by: Dag Brattli * * Copyright (c) 1997 Dag Brattli, All Rights Reserved. @@ -62,7 +62,6 @@ extern void irda_proto_cleanup(void); extern int irda_device_init(void); -extern int irobex_init(void); extern int irlan_init(void); extern int irlan_client_init(void); extern int irlan_server_init(void); @@ -71,6 +70,12 @@ extern int irlpt_client_init(void); extern int irlpt_server_init(void); +#ifdef CONFIG_IRDA_COMPRESSION +#ifdef CONFIG_IRDA_DEFLATE +extern irda_deflate_init(); +#endif /* CONFIG_IRDA_DEFLATE */ +#endif /* CONFIG_IRDA_COMPRESSION */ + static int irda_open(struct inode * inode, struct file *file); static int irda_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); @@ -132,8 +137,12 @@ /* IrLMP */ EXPORT_SYMBOL(irlmp_discovery_request); -EXPORT_SYMBOL(irlmp_register_layer); -EXPORT_SYMBOL(irlmp_unregister_layer); +EXPORT_SYMBOL(irlmp_register_client); +EXPORT_SYMBOL(irlmp_unregister_client); +EXPORT_SYMBOL(irlmp_update_client); +EXPORT_SYMBOL(irlmp_register_service); +EXPORT_SYMBOL(irlmp_unregister_service); +EXPORT_SYMBOL(irlmp_service_to_hint); EXPORT_SYMBOL(irlmp_data_request); EXPORT_SYMBOL(irlmp_open_lsap); EXPORT_SYMBOL(irlmp_close_lsap); @@ -179,7 +188,7 @@ __initfunc(int irda_init(void)) { - printk(KERN_INFO "Linux-2.2 Support for the IrDA (tm) Protocols (Dag Brattli)\n"); + printk(KERN_INFO "IrDA (tm) Protocols for Linux-2.2 (Dag Brattli)\n"); irlmp_init(); irlap_init(); @@ -209,9 +218,6 @@ #ifdef CONFIG_IRLAN irlan_init(); #endif -#ifdef CONFIG_IROBEX - irobex_init(); -#endif #ifdef CONFIG_IRCOMM ircomm_init(); irvtd_init(); @@ -234,12 +240,7 @@ return 0; } -/* - * FIXME: - * This function should have been wrapped with #ifdef MODULE, but then - * irda_proto_cleanup() must be moved from af_irda.c to this file since - * that function must also be wrapped if this one is. - */ +#ifdef MODULE void irda_cleanup(void) { misc_deregister( &irda.dev); @@ -263,6 +264,7 @@ /* Remove middle layer */ irlmp_cleanup(); } +#endif /* MODULE */ /* * Function irda_lock (lock) @@ -505,6 +507,20 @@ return 0; } +void irda_mod_inc_use_count(void) +{ +#ifdef MODULE + MOD_INC_USE_COUNT; +#endif +} + +void irda_mod_dec_use_count(void) +{ +#ifdef MODULE + MOD_DEC_USE_COUNT; +#endif +} + #ifdef MODULE #ifdef CONFIG_PROC_FS void irda_proc_modcount(struct inode *inode, int fill) @@ -543,5 +559,4 @@ { irda_proto_cleanup(); } - -#endif +#endif /* MODULE */ diff -u --recursive --new-file v2.2.5/linux/net/irda/irobex/Config.in linux/net/irda/irobex/Config.in --- v2.2.5/linux/net/irda/irobex/Config.in Tue Dec 22 14:16:59 1998 +++ linux/net/irda/irobex/Config.in Wed Dec 31 16:00:00 1969 @@ -1,3 +0,0 @@ - -dep_tristate 'IrOBEX protocol' CONFIG_IROBEX $CONFIG_IRDA - diff -u --recursive --new-file v2.2.5/linux/net/irda/irobex/Makefile linux/net/irda/irobex/Makefile --- v2.2.5/linux/net/irda/irobex/Makefile Tue Dec 22 14:16:59 1998 +++ linux/net/irda/irobex/Makefile Wed Dec 31 16:00:00 1969 @@ -1,19 +0,0 @@ -# -# Makefile for the Linux IrDA IrOBEX protocol layer. -# -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). -# -# Note 2! The CFLAGS definition is now in the main makefile... - -#O_TARGET := -O_OBJS := irobex.o -M_OBJS := irobex.o - -OX_OBJS += - -include $(TOPDIR)/Rules.make - -tar: - tar -cvf /dev/f1 . diff -u --recursive --new-file v2.2.5/linux/net/irda/irobex/irobex.c linux/net/irda/irobex/irobex.c --- v2.2.5/linux/net/irda/irobex/irobex.c Wed Mar 10 15:29:53 1999 +++ linux/net/irda/irobex/irobex.c Wed Dec 31 16:00:00 1969 @@ -1,1170 +0,0 @@ -/********************************************************************* - * - * Filename: irobex.c - * Version: 0.4 - * Description: Kernel side of the IrOBEX layer - * Status: Experimental. - * Author: Dag Brattli - * Created at: Thu Jun 25 21:21:07 1998 - * Modified at: Mon Feb 8 09:05:01 1999 - * Modified by: Dag Brattli - * - * Copyright (c) 1998 Dag Brattli, 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. - * - * Neither Dag Brattli nor University of Tromsų admit liability nor - * provide warranty for any of this software. This material is - * provided "AS-IS" and at no charge. - * - ********************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - -/* - * Master structure, only one instance for now!! - */ -struct irobex_cb *irobex; - -extern char *lmp_reasons[]; - -char *irobex_state[] = { - "OBEX_IDLE", - "OBEX_DISCOVER", - "OBEX_QUERY", - "OBEX_CONN", - "OBEX_DATA", -}; - -static void irobex_cleanup(void); -/* static struct irobex_cb *irobex_open(void); */ -/* static void irobex_close( struct irobex_cb *self); */ - -static void irobex_data_indication( void *instance, void *sap, - struct sk_buff *skb); -static void irobex_disconnect_indication( void *instance, void *sap, - LM_REASON reason, - struct sk_buff *skb); -static void irobex_disconnect_request( struct irobex_cb *self); -static int irobex_connect_request(struct irobex_cb *self); -static void irobex_connect_confirm( void *instance, void *sap, - struct qos_info *qos, - int max_sdu_size, struct sk_buff *skb); -static void irobex_discovery_indication( DISCOVERY *discovery); -static void irobex_flow_indication( void *instance, void *sap, - LOCAL_FLOW flow); -static void irobex_get_value_confirm(__u16 obj_id, struct ias_value *value, - void *priv); -static void irobex_register_server( struct irobex_cb *self); -static int irobex_ioctl( struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -static int irobex_dev_open( struct inode * inode, struct file *file); -static int irobex_dev_close( struct inode *inode, struct file *file); -static ssize_t irobex_read( struct file *file, char *buffer, size_t count, - loff_t *noidea); -static ssize_t irobex_write( struct file *file, const char *buffer, - size_t count, loff_t *noidea); -static loff_t irobex_seek( struct file *, loff_t, int); -static u_int irobex_poll( struct file *file, poll_table *wait); -static int irobex_fasync( int, struct file *, int); - -static struct file_operations irobex_fops = { - irobex_seek, /* seek */ - irobex_read, - irobex_write, - NULL, /* readdir */ - irobex_poll, /* poll */ - irobex_ioctl, /* ioctl */ - NULL, /* mmap */ - irobex_dev_open, - NULL, - irobex_dev_close, - NULL, - irobex_fasync, -}; - -#ifdef CONFIG_PROC_FS -static int irobex_proc_read( char *buf, char **start, off_t offset, - int len, int unused); - -extern struct proc_dir_entry proc_irda; - -struct proc_dir_entry proc_irobex = { - 0, 6, "irobex", - S_IFREG | S_IRUGO, 1, 0, 0, - 0, NULL, - &irobex_proc_read, -}; -#endif - -/* - * Function irobex_init (dev) - * - * Initializes the irobex control structure, and registers as a misc - * device - * - */ -__initfunc(int irobex_init(void)) -{ - struct irmanager_event mgr_event; - struct irobex_cb *self; - - self = kmalloc(sizeof(struct irobex_cb), GFP_ATOMIC); - if ( self == NULL) - return -ENOMEM; - - memset( self, 0, sizeof(struct irobex_cb)); - sprintf( self->devname, "irobex%d", 0); /* Just one instance for now */ - - self->magic = IROBEX_MAGIC; - self->rx_flow = self->tx_flow = FLOW_START; - - self->dev.minor = MISC_DYNAMIC_MINOR; - self->dev.name = "irobex"; - self->dev.fops = &irobex_fops; - - skb_queue_head_init( &self->rx_queue); - init_timer( &self->watchdog_timer); - - irobex = self; - - misc_register( &self->dev); - -#ifdef CONFIG_PROC_FS - proc_register( &proc_irda, &proc_irobex); -#endif /* CONFIG_PROC_FS */ - - irlmp_register_layer( S_OBEX, CLIENT | SERVER, TRUE, - irobex_discovery_indication); - -/* mgr_event.event = EVENT_IROBEX_INIT; */ -/* sprintf( mgr_event.devname, "%s", self->devname); */ -/* irmanager_notify( &mgr_event); */ - - return 0; -} - -/* - * Function irobex_cleanup (void) - * - * Removes the IrOBEX layer - * - */ -#ifdef MODULE -static void irobex_cleanup(void) -{ - struct sk_buff *skb; - struct irobex_cb *self; - - DEBUG( 4, __FUNCTION__ "()\n"); - - self = irobex; - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IROBEX_MAGIC, return;); - - /* - * Deregister client and server - */ - irlmp_unregister_layer( S_OBEX, CLIENT | SERVER); - - if ( self->tsap) { - irttp_disconnect_request(self->tsap, NULL, P_NORMAL); - irttp_close_tsap( self->tsap); - self->tsap = NULL; - } - - /* Stop timers */ - del_timer( &self->watchdog_timer); - - /* - * Deallocate buffers - */ - while (( skb = skb_dequeue( &self->rx_queue)) != NULL) - dev_kfree_skb( skb); - -#ifdef CONFIG_PROC_FS - proc_unregister( &proc_irda, proc_irobex.low_ino); -#endif - - misc_deregister( &self->dev); - - kfree( self); -} -#endif /* MODULE */ - -/* - * Function irobex_read (inode, file, buffer, count) - * - * User process wants to read some data - * - */ -static ssize_t irobex_read( struct file *file, char *buffer, size_t count, - loff_t *noidea) -{ - int len=0; - struct irobex_cb *self; - struct sk_buff *skb = NULL; - int ret; - - self = irobex; - - ASSERT( self != NULL, return -EIO;); - ASSERT( self->magic == IROBEX_MAGIC, return -EIO;); - - DEBUG( 4, __FUNCTION__ ": count=%d, skb_len=%d, state=%s, eof=%d\n", - count, skb_queue_len( &self->rx_queue), - irobex_state[self->state], self->eof); - - if ( self->state != OBEX_DATA) { - DEBUG( 0, __FUNCTION__ "(), link not connected yet!\n"); - return -EIO; - } - - /* - * If there is data to return, then we return it. If not, then we - * must check if we are still connected - */ - if ( skb_queue_len( &self->rx_queue) == 0) { - - /* Still connected? */ - if ( self->state != OBEX_DATA) { - switch ( self->eof) { - case LM_USER_REQUEST: - self->eof = FALSE; - DEBUG(3, "read_irobex: returning 0\n"); - ret = 0; - break; - case LM_LAP_DISCONNECT: - self->eof = FALSE; - ret = -EIO; - break; - case LM_LAP_RESET: - self->eof = FALSE; - ret = -ECONNRESET; - break; - default: - self->eof = FALSE; - ret = -EIO; - break; - } - return ret; - } - - /* Return if user does not want to block */ - if ( file->f_flags & O_NONBLOCK) - return -EAGAIN; - - /* Go to sleep and wait for data! */ - interruptible_sleep_on( &self->read_wait); - - /* - * Ensure proper reaction to signals, and screen out - * blocked signals (page 112. linux device drivers) - */ - if ( signal_pending( current)) - return -ERESTARTSYS; - } - - while ( count && skb_queue_len( &self->rx_queue)) { - - skb = skb_dequeue( &self->rx_queue); - - /* - * Check if we have previously stopped IrTTP and we know - * have more free space in our rx_queue. If so tell IrTTP - * to start delivering frames again before our rx_queue gets - * empty - */ - if ( self->rx_flow == FLOW_STOP) { - if ( skb_queue_len( &self->rx_queue) < LOW_THRESHOLD) { - DEBUG( 4, __FUNCTION__ "(), Starting IrTTP\n"); - self->rx_flow = FLOW_START; - irttp_flow_request( self->tsap, FLOW_START); - } - } - - /* - * Is the request from the user less that the amount in the - * current packet? - */ - if ( count < skb->len) { - copy_to_user( buffer+len, skb->data, count); - len += count; - - /* - * Remove copied data from skb and queue - * it for next read - */ - skb_pull( skb, count); - skb_queue_head( &self->rx_queue, skb); - - return len; - } else { - copy_to_user( buffer+len, skb->data, skb->len); - count -= skb->len; - len += skb->len; - - dev_kfree_skb( skb); - } - } - return len; -} - -/* - * Function irobex_write (inode, file, buffer, count) - * - * User process wants to write to device - * - */ -static ssize_t irobex_write( struct file *file, const char *buffer, - size_t count, loff_t *noidea) -{ - struct irobex_cb *self; - struct sk_buff *skb; - int data_len = 0; - int len = 0; - - self = irobex; - - ASSERT( self != NULL, return -EIO;); - ASSERT( self->magic == IROBEX_MAGIC, return -EIO;); - - DEBUG( 4, __FUNCTION__ ": count = %d\n", count); - - /* - * If we are not connected then we just give up! - */ - if ( self->state != OBEX_DATA) { - DEBUG( 0, __FUNCTION__ "(): Not connected!\n"); - - return -ENOLINK; - } - - /* Check if IrTTP is wants us to slow down */ - if ( self->tx_flow == FLOW_STOP) { - DEBUG( 4, __FUNCTION__ - "(), IrTTP wants us to slow down, going to sleep\n"); - interruptible_sleep_on( &self->write_wait); - } - - /* Send data to TTP layer possibly as muliple packets */ - while ( count) { - - /* - * Check if request is larger than what fits inside a TTP - * frame. In that case we must fragment the frame into - * multiple TTP frames. IrOBEX should not care about message - * boundaries. - */ - if ( count < (self->irlap_data_size - IROBEX_MAX_HEADER)) - data_len = count; - else - data_len = self->irlap_data_size - IROBEX_MAX_HEADER; - - DEBUG( 4, __FUNCTION__ "(), data_len=%d, header_len = %d\n", - data_len, IROBEX_MAX_HEADER); - - skb = dev_alloc_skb( data_len + IROBEX_MAX_HEADER); - if ( skb == NULL) { - DEBUG( 0, "irobex - couldn't allocate skbuff!\n"); - return 0; - } - - skb_reserve( skb, IROBEX_MAX_HEADER); - skb_put( skb, data_len); - - copy_from_user( skb->data, buffer+len, data_len); - len += data_len; - count -= data_len; - - DEBUG( 4, __FUNCTION__ "(), skb->len=%d\n", (int) skb->len); - ASSERT( skb->len <= (self->irlap_data_size-IROBEX_MAX_HEADER), - return len;); - - irttp_data_request( self->tsap, skb); - } - return (len); -} - -/* - * Function irobex_poll (file, wait) - * - * - * - */ -static u_int irobex_poll(struct file *file, poll_table *wait) -{ - DEBUG( 0, __FUNCTION__ "(), Sorry not implemented yet!\n"); - - /* check out /usr/src/pcmcia/modules/ds.c for an example */ - return 0; -} - -/* - * Function irobex_fasync (inode, filp, mode) - * - * Implementation for SIGIO - * - */ -static int irobex_fasync( int fd, struct file *filp, int on) -{ - struct irobex_cb *self; - - DEBUG( 4, __FUNCTION__ "()\n"); - - self = irobex; - - ASSERT( self != NULL, return -1;); - ASSERT( self->magic == IROBEX_MAGIC, return -1;); - - return fasync_helper( fd, filp, on, &self->async); -} - -/* - * Function irobex_seek (inode, file, buffer, count) - * - * Not implemented yet! - * - */ -static loff_t irobex_seek( struct file *file, loff_t off, int whence) -{ - DEBUG( 0, __FUNCTION__ "(), Not implemented yet!\n"); - - return -ESPIPE; -} - -/* - * Function irobex_ioctl (inode, filp, cmd, arg) - * - * Drivers IOCTL handler, used for connecting and disconnecting - * irobex connections - * - */ -static int irobex_ioctl( struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg) -{ - struct irobex_cb *self; - int err = 0; - int size = _IOC_SIZE(cmd); - - DEBUG( 4, __FUNCTION__ "()\n"); - - self = irobex; - - ASSERT(self != NULL, return -ENOTTY;); - ASSERT(self->magic == IROBEX_MAGIC, return -ENOTTY;); - - if ( _IOC_TYPE(cmd) != IROBEX_IOC_MAGIC) - return -EINVAL; - if ( _IOC_NR(cmd) > IROBEX_IOC_MAXNR) - return -EINVAL; - - if ( _IOC_DIR(cmd) & _IOC_READ) - err = verify_area( VERIFY_WRITE, (void *) arg, size); - else if ( _IOC_DIR(cmd) & _IOC_WRITE) - err = verify_area( VERIFY_READ, (void *) arg, size); - if ( err) - return err; - - switch ( cmd) { - case IROBEX_IOCSCONNECT: - DEBUG( 4, __FUNCTION__ "(): IROBEX_IOCSCONNECT!\n"); - return irobex_connect_request( self); - break; - case IROBEX_IOCSDISCONNECT: - DEBUG( 4, __FUNCTION__ "(): IROBEX_IOCSDISCONNECT!\n"); - irobex_disconnect_request( self); - break; - default: - return -EINVAL; - } - return 0; -} - -/* - * Function irobex_dev_open (inode, file) - * - * Device opened by user process - * - */ -static int irobex_dev_open( struct inode * inode, struct file *file) -{ - struct irobex_cb *self; - - DEBUG( 4, __FUNCTION__ "()\n"); - - self = irobex; - - ASSERT( self != NULL, return -1;); - ASSERT( self->magic == IROBEX_MAGIC, return -1;); - - if ( self->count++) { - DEBUG( 3, "open_irobex: count not zero; actual = %d\n", - self->count); - self->count--; - return -EBUSY; - } - - irobex_register_server( self); - - /* Reset values for this instance */ - self->state = OBEX_IDLE; - self->eof = FALSE; - self->daddr = 0; - self->dtsap_sel = 0; - self->rx_flow = FLOW_START; - self->tx_flow = FLOW_START; - - MOD_INC_USE_COUNT; - - return 0; -} - -static int irobex_dev_close( struct inode *inode, struct file *file) -{ - struct irobex_cb *self; - struct sk_buff *skb; - - DEBUG( 4, __FUNCTION__ "()\n"); - - self = irobex; - - ASSERT( self != NULL, return -ENODEV;); - ASSERT( self->magic == IROBEX_MAGIC, return -EBADR;); - - /* Deallocate buffers */ - while (( skb = skb_dequeue( &self->rx_queue)) != NULL) { - DEBUG( 3, "irobex_close: freeing SKB\n"); - dev_kfree_skb( skb); - } - - /* Close TSAP is its still there */ - if ( self->tsap) { - irttp_disconnect_request(self->tsap, NULL, P_NORMAL); - irttp_close_tsap( self->tsap); - self->tsap = NULL; - } - self->state = OBEX_IDLE; - self->eof = FALSE; - self->daddr = 0; - self->dtsap_sel = 0; - self->rx_flow = FLOW_START; - self->tx_flow = FLOW_START; - - /* Remove this filp from the asynchronously notified filp's */ - irobex_fasync( -1, file, 0); - - self->count--; - - MOD_DEC_USE_COUNT; - - return 0; -} - -/* - * Function irobex_discovery_inication (daddr) - * - * Remote device discovered, try query the remote IAS to see which - * device it is, and which services it has. - * - */ -static void irobex_discovery_indication( DISCOVERY *discovery) -{ - struct irobex_cb *self; - - DEBUG( 0, __FUNCTION__ "()\n"); - - self = irobex; - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IROBEX_MAGIC, return;); - - /* Remember address and time if was discovered */ - self->daddr = discovery->daddr; - self->saddr = discovery->saddr; - self->time_discovered = jiffies; - - /* Wake up process if its waiting for device to be discovered */ - if ( self->state == OBEX_DISCOVER) - wake_up_interruptible( &self->write_wait); -} - -static void irobex_disconnect_request( struct irobex_cb *self) -{ - if ( self->state != OBEX_DATA) - return; - - irttp_disconnect_request( self->tsap, NULL, P_NORMAL); - - /* Reset values for this instance */ - self->state = OBEX_IDLE; - self->eof = LM_USER_REQUEST; - self->daddr = 0; - self->dtsap_sel = 0; - self->rx_flow = FLOW_START; - self->tx_flow = FLOW_START; - - wake_up_interruptible( &self->read_wait); -} - -/* - * Function irobex_disconnect_indication (handle, reason, priv) - * - * Link has been disconnected - * - */ -static void irobex_disconnect_indication( void *instance, void *sap, - LM_REASON reason, - struct sk_buff *userdata) -{ - struct irobex_cb *self; - - DEBUG( 0, __FUNCTION__ "(), reason=%s\n", lmp_reasons[reason]); - - self = ( struct irobex_cb *) instance; - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IROBEX_MAGIC, return;); - - self->state = OBEX_IDLE; - self->eof = reason; - self->daddr = 0; - self->dtsap_sel = 0; - self->rx_flow = self->tx_flow = FLOW_START; - - wake_up_interruptible( &self->read_wait); - wake_up_interruptible( &self->write_wait); - - DEBUG( 4, __FUNCTION__ "(), skb_queue_len=%d\n", - skb_queue_len( &irobex->rx_queue)); - - if ( userdata) - dev_kfree_skb( userdata); -} - -int irobex_connect_request(struct irobex_cb *self) -{ - int count = 0; - - /* Already connected? */ - if ( self->state == OBEX_DATA) { - DEBUG( 0, __FUNCTION__ "(), already connected!\n"); - return 0; - } - - /* Timeout after 15 secs. */ - irobex_start_watchdog_timer( self, 1000); - - /* - * If we have discovered a remote device we - * check if the discovery is still fresh. If not, we don't - * trust the address. - */ - if ( self->daddr && ((jiffies - self->time_discovered) > 1000)) { - DEBUG( 0, __FUNCTION__ "(), daddr is old <%d>!\n", - jiffies - self->time_discovered); - self->daddr = 0; - } - - /* - * Try to discover remote remote device if it has not been - * discovered yet. - */ - if ( !self->daddr) { - self->state = OBEX_DISCOVER; - - irlmp_discovery_request( 8); - - /* Wait for discovery to complete */ - interruptible_sleep_on( &self->write_wait); - del_timer( &self->watchdog_timer); - } - - /* Give up if we are unable to discover any remote devices */ - if ( !self->daddr) { - DEBUG( 0, __FUNCTION__ - "(), Unable to discover any devices!\n"); - return -EHOSTUNREACH; - } - - /* Need to find remote destination TSAP selector? */ - while ( !self->dtsap_sel) { - DEBUG( 0, __FUNCTION__ "() : Quering remote IAS!\n"); - - self->state = OBEX_QUERY; - - /* Timeout after 5 secs. */ - irobex_start_watchdog_timer( self, 500); - iriap_getvaluebyclass_request( - "OBEX", "IrDA:TinyTP:LsapSel", - self->saddr, self->daddr, - irobex_get_value_confirm, - self); - - interruptible_sleep_on( &self->write_wait); - del_timer( &self->watchdog_timer); - - /* Give up after a few tries */ - if (( count++ > 2) && !self->dtsap_sel) { - DEBUG( 0, __FUNCTION__ - "(), Unable to query remote LM-IAS!\n"); - return -ETIMEDOUT; - } - } - self->state = OBEX_CONN; - - /* Timeout after 5 secs. */ - irobex_start_watchdog_timer( self, 500); - - irttp_connect_request( self->tsap, self->dtsap_sel, - self->saddr, self->daddr, NULL, SAR_DISABLE, - NULL); - - /* Go to sleep and wait for connection! */ - interruptible_sleep_on( &self->write_wait); - del_timer( &self->watchdog_timer); - - if ( self->state != OBEX_DATA) { - DEBUG( 0, __FUNCTION__ - "(), Unable to connect to remote device!\n"); - return -ETIMEDOUT; - } - return 0; -} - -/* - * Function irobex_connect_confirm (instance, sap, qos, userdata) - * - * Connection to peer IrOBEX layer established - * - */ -static void irobex_connect_confirm( void *instance, void *sap, - struct qos_info *qos, - int max_sdu_size, struct sk_buff *userdata) -{ - struct irobex_cb *self; - - DEBUG( 4, __FUNCTION__ "()\n"); - - self = ( struct irobex_cb *) instance; - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IROBEX_MAGIC, return;); - ASSERT( qos != NULL, return;); - - DEBUG( 4, __FUNCTION__ "(), IrLAP data size=%d\n", - qos->data_size.value); - - self->irlap_data_size = qos->data_size.value; - - /* - * Wake up any blocked process wanting to write. Finally this process - * can start writing since the connection is now open :-) - */ - if (self->state == OBEX_CONN) { - self->state = OBEX_DATA; - wake_up_interruptible( &self->write_wait); - } - - if ( userdata) { - dev_kfree_skb( userdata); - - } -} - -/* - * Function irobex_connect_response (handle) - * - * Accept incomming connection - * - */ -void irobex_connect_response( struct irobex_cb *self) -{ - struct sk_buff *skb; -/* __u8 *frame; */ - - DEBUG( 4, __FUNCTION__ "()\n"); - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IROBEX_MAGIC, return;); - - self->state = OBEX_DATA; - - skb = dev_alloc_skb( 64); - if (skb == NULL) { - DEBUG( 0, __FUNCTION__ "() Could not allocate sk_buff!\n"); - return; - } - - /* Reserve space for MUX_CONTROL and LAP header */ - skb_reserve( skb, TTP_HEADER+LMP_CONTROL_HEADER+LAP_HEADER); - - irttp_connect_response( self->tsap, SAR_DISABLE, skb); -} - -/* - * Function irobex_connect_indication (handle, skb, priv) - * - * Connection request from a remote device - * - */ -void irobex_connect_indication( void *instance, void *sap, - struct qos_info *qos, int max_sdu_size, - struct sk_buff *userdata) -{ - struct irmanager_event mgr_event; - struct irobex_cb *self; - - DEBUG( 4, __FUNCTION__ "()\n"); - - self = ( struct irobex_cb *) instance; - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IROBEX_MAGIC, return;); - ASSERT( userdata != NULL, return;); - - self->eof = FALSE; - - DEBUG( 4, __FUNCTION__ "(), skb_len = %d\n", - (int) userdata->len); - - DEBUG( 4, __FUNCTION__ "(), IrLAP data size=%d\n", - qos->data_size.value); - - ASSERT( qos->data_size.value >= 64, return;); - - self->irlap_data_size = qos->data_size.value; - - /* We just accept the connection */ - irobex_connect_response( self); -#if 1 - mgr_event.event = EVENT_IROBEX_START; - sprintf( mgr_event.devname, "%s", self->devname); - irmanager_notify( &mgr_event); -#endif - wake_up_interruptible( &self->read_wait); - - if ( userdata) { - dev_kfree_skb( userdata); - } -} - -/* - * Function irobex_data_indication (instance, sap, skb) - * - * This function gets the data that is received on the data channel - * - */ -static void irobex_data_indication( void *instance, void *sap, - struct sk_buff *skb) -{ - - struct irobex_cb *self; - - self = ( struct irobex_cb *) instance; - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IROBEX_MAGIC, return;); - ASSERT( skb != NULL, return;); - - DEBUG( 4, __FUNCTION__ "(), len=%d\n", (int) skb->len); - - skb_queue_tail( &self->rx_queue, skb); - - /* - * Check if queues are beginning to get filled, and inform - * IrTTP to slow down if that is the case - */ - if ( skb_queue_len( &self->rx_queue) > HIGH_THRESHOLD) { - DEBUG( 0, __FUNCTION__ - "(), rx_queue is full, telling IrTTP to slow down\n"); - self->rx_flow = FLOW_STOP; - irttp_flow_request( self->tsap, FLOW_STOP); - } - - /* - * Wake up process blocked on read or select - */ - wake_up_interruptible( &self->read_wait); - - /* Send signal to asynchronous readers */ - if ( self->async) - kill_fasync( self->async, SIGIO); -} - -/* - * Function irobex_flow_indication (instance, sap, cmd) - * - * - * - */ -static void irobex_flow_indication( void *instance, void *sap, - LOCAL_FLOW flow) -{ - struct irobex_cb *self; - - DEBUG( 4, __FUNCTION__ "()\n"); - - self = ( struct irobex_cb *) instance; - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IROBEX_MAGIC, return;); - - switch ( flow) { - case FLOW_STOP: - DEBUG( 0, __FUNCTION__ "(), IrTTP wants us to slow down\n"); - self->tx_flow = flow; - break; - case FLOW_START: - self->tx_flow = flow; - DEBUG( 0, __FUNCTION__ "(), IrTTP wants us to start again\n"); - wake_up_interruptible( &self->write_wait); - break; - default: - DEBUG( 0, __FUNCTION__ "(), Unknown flow command!\n"); - } -} - -/* - * Function irobex_get_value_confirm (obj_id, value) - * - * Got results from previous GetValueByClass request - * - */ -static void irobex_get_value_confirm( __u16 obj_id, struct ias_value *value, - void *priv) -{ - struct irobex_cb *self; - - DEBUG( 4, __FUNCTION__ "()\n"); - - ASSERT( priv != NULL, return;); - self = ( struct irobex_cb *) priv; - - if ( !self || self->magic != IROBEX_MAGIC) { - DEBUG( 0, __FUNCTION__ "(), bad magic!\n"); - return; - } - - /* Check if request succeeded */ - if ( !value) { - DEBUG( 0, __FUNCTION__ "(), got NULL value!\n"); - - return; - } - - switch ( value->type) { - case IAS_INTEGER: - DEBUG( 4, __FUNCTION__ "() int=%d\n", value->t.integer); - - if ( value->t.integer != -1) { - self->dtsap_sel = value->t.integer; - - /* - * Got the remote TSAP, so wake up any processes - * blocking on write. We don't do the connect - * ourselves since we must make sure there is a - * process that wants to make a connection, so we - * just let that process do the connect itself - */ - if ( self->state == OBEX_QUERY) - wake_up_interruptible( &self->write_wait); - } else - self->dtsap_sel = 0; - break; - case IAS_STRING: - DEBUG( 0, __FUNCTION__ "(), got string %s\n", value->t.string); - break; - case IAS_OCT_SEQ: - DEBUG( 0, __FUNCTION__ "(), OCT_SEQ not implemented\n"); - break; - case IAS_MISSING: - DEBUG( 0, __FUNCTION__ "(), MISSING not implemented\n"); - break; - default: - DEBUG( 0, __FUNCTION__ "(), unknown type!\n"); - break; - } -} - -/* - * Function irobex_provider_confirm (dlsap) - * - * IrOBEX provider is discovered. We can now establish connections - * TODO: This function is currently not used! - */ -void irobex_provider_confirm( struct irobex_cb *self, __u8 dlsap) -{ - /* struct irobex_cb *self = irobex; */ - struct notify_t notify; - - DEBUG( 4, __FUNCTION__ "()\n"); - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IROBEX_MAGIC, return;); - - notify.data_indication = irobex_data_indication; - notify.connect_confirm = irobex_connect_confirm; - notify.connect_indication = irobex_connect_indication; - notify.flow_indication = irobex_flow_indication; - notify.disconnect_indication = irobex_disconnect_indication; - notify.instance = self; - - /* Create TSAP's */ - self->tsap = irttp_open_tsap( LSAP_ANY, DEFAULT_INITIAL_CREDIT, - ¬ify); - -/* DEBUG( 0, "OBEX allocated TSAP%d for data\n", self->handle); */ - - /* irlan_do_event( IAS_PROVIDER_AVAIL, NULL, &frame); */ -} - -/* - * Function irobex_register_server(void) - * - * Register server support so we can accept incomming connections. We - * must register both a TSAP for control and data - * - */ -static void irobex_register_server( struct irobex_cb *self) -{ - struct notify_t notify; - struct ias_object *obj; - - DEBUG( 4, __FUNCTION__ "()\n"); - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IROBEX_MAGIC, return;); - - irda_notify_init( ¬ify); - - notify.connect_confirm = irobex_connect_confirm; - notify.connect_indication = irobex_connect_indication; - notify.disconnect_indication = irobex_disconnect_indication; - notify.data_indication = irobex_data_indication; - notify.flow_indication = irobex_flow_indication; - notify.instance = self; - strcpy( notify.name, "IrOBEX"); - - self->tsap = irttp_open_tsap( TSAP_IROBEX, DEFAULT_INITIAL_CREDIT, - ¬ify); - if ( self->tsap == NULL) { - DEBUG( 0, __FUNCTION__ "(), Unable to allocate TSAP!\n"); - return; - } - - /* - * Register with LM-IAS - */ - obj = irias_new_object( "OBEX", 0x42343); - irias_add_integer_attrib( obj, "IrDA:TinyTP:LsapSel", TSAP_IROBEX); - irias_insert_object( obj); -} - -void irobex_watchdog_timer_expired( unsigned long data) -{ - struct irobex_cb *self = ( struct irobex_cb *) data; - - DEBUG( 4, __FUNCTION__ "()\n"); - - ASSERT( self != NULL, return;); - ASSERT( self->magic == IROBEX_MAGIC, return;); - - switch (self->state) { - case OBEX_CONN: /* FALLTROUGH */ - case OBEX_DISCOVER: /* FALLTROUGH */ - case OBEX_QUERY: /* FALLTROUGH */ - wake_up_interruptible( &self->write_wait); - break; - default: - break; - } -} - -#ifdef CONFIG_PROC_FS -/* - * Function irobex_proc_read (buf, start, offset, len, unused) - * - * Give some info to the /proc file system - */ -static int irobex_proc_read( char *buf, char **start, off_t offset, - int len, int unused) -{ - struct irobex_cb *self; - - self = irobex; - - ASSERT( self != NULL, return -1;); - ASSERT( self->magic == IROBEX_MAGIC, return -1;); - - len = 0; - - len += sprintf( buf+len, "ifname: %s ",self->devname); - len += sprintf( buf+len, "state: %s ", irobex_state[ self->state]); - len += sprintf( buf+len, "EOF: %s\n", self->eof ? "TRUE": "FALSE"); - - return len; -} - -#endif /* CONFIG_PROC_FS */ - -#ifdef MODULE - -MODULE_AUTHOR("Dag Brattli "); -MODULE_DESCRIPTION("The Linux IrOBEX module"); - -/* - * Function init_module (void) - * - * Initialize the IrOBEX module, this function is called by the - * modprobe(1) program. - */ -int init_module(void) -{ - irobex_init(); - - return 0; -} - -/* - * Function cleanup_module (void) - * - * Remove the IrOBEX module, this function is called by the rmmod(1) - * program - */ -void cleanup_module(void) -{ - /* - * No need to check MOD_IN_USE, as sys_delete_module() checks. - */ - - /* Free some memory */ - irobex_cleanup(); -} - -#endif /* MODULE */ - - - - diff -u --recursive --new-file v2.2.5/linux/net/irda/irproc.c linux/net/irda/irproc.c --- v2.2.5/linux/net/irda/irproc.c Wed Mar 10 15:29:53 1999 +++ linux/net/irda/irproc.c Thu Apr 15 05:42:42 1999 @@ -1,12 +1,12 @@ /********************************************************************* * * Filename: irproc.c - * Version: + * Version: 1.0 * Description: Various entries in the /proc file system * Status: Experimental. * Author: Thomas Davis, * Created at: Sat Feb 21 21:33:24 1998 - * Modified at: Thu Feb 11 15:23:23 1999 + * Modified at: Tue Apr 6 19:07:06 1999 * Modified by: Dag Brattli * * Copyright (c) 1998, Thomas Davis, , @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -46,6 +47,8 @@ int unused); extern int irias_proc_read(char *buf, char **start, off_t offset, int len, int unused); +extern int discovery_proc_read(char *buf, char **start, off_t offset, int len, + int unused); static int proc_discovery_read(char *buf, char **start, off_t offset, int len, int unused); @@ -118,7 +121,7 @@ 0, 9, "discovery", S_IFREG | S_IRUGO, 1, 0, 0, 0, NULL /* ops -- default to array */, - &proc_discovery_read /* get_info */, + &discovery_proc_read /* get_info */, }; struct proc_dir_entry proc_irda_device = { @@ -184,7 +187,9 @@ */ void irda_proc_register(void) { proc_net_register(&proc_irda); +#ifdef MODULE proc_irda.fill_inode = &irda_proc_modcount; +#endif /* MODULE */ proc_register(&proc_irda, &proc_lap); proc_register(&proc_irda, &proc_lmp); proc_register(&proc_irda, &proc_ttp); @@ -311,73 +316,5 @@ return 1; } -/* - * Function proc_discovery_read (buf, start, offset, len, unused) - * - * Print discovery information in /proc file system - * - */ -int proc_discovery_read(char *buf, char **start, off_t offset, int len, - int unused) -{ - DISCOVERY *discovery; - struct lap_cb *lap; - unsigned long flags; - - if ( !irlmp) - return len; - len = sprintf(buf, "IrLMP: Discovery log:\n\n"); - - save_flags(flags); - cli(); - - lap = ( struct lap_cb *) hashbin_get_first( irlmp->links); - while( lap != NULL) { - ASSERT( lap->magic == LMP_LAP_MAGIC, return 0;); - - len += sprintf( buf+len, "Link saddr=0x%08x\n", lap->saddr); - discovery = ( DISCOVERY *) hashbin_get_first( lap->cachelog); - while ( discovery != NULL) { - len += sprintf( buf+len, " name: %s,", - discovery->info); - - len += sprintf( buf+len, " hint: "); - if ( discovery->hint[0] & HINT_PNP) - len += sprintf( buf+len, "PnP Compatible "); - if ( discovery->hint[0] & HINT_PDA) - len += sprintf( buf+len, "PDA/Palmtop "); - if ( discovery->hint[0] & HINT_COMPUTER) - len += sprintf( buf+len, "Computer "); - if ( discovery->hint[0] & HINT_PRINTER) - len += sprintf( buf+len, "Printer "); - if ( discovery->hint[0] & HINT_MODEM) - len += sprintf( buf+len, "Modem "); - if ( discovery->hint[0] & HINT_FAX) - len += sprintf( buf+len, "Fax "); - if ( discovery->hint[0] & HINT_LAN) - len += sprintf( buf+len, "LAN Access"); - - if ( discovery->hint[1] & HINT_TELEPHONY) - len += sprintf( buf+len, "Telephony "); - if ( discovery->hint[1] & HINT_FILE_SERVER) - len += sprintf( buf+len, "File Server "); - if ( discovery->hint[1] & HINT_COMM) - len += sprintf( buf+len, "IrCOMM "); - if ( discovery->hint[1] & HINT_OBEX) - len += sprintf( buf+len, "IrOBEX "); - - len += sprintf( buf+len, ", daddr: 0x%08x\n", - discovery->daddr); - - len += sprintf( buf+len, "\n"); - - discovery = ( DISCOVERY *) hashbin_get_next( lap->cachelog); - } - lap = ( struct lap_cb *) hashbin_get_next( irlmp->links); - } - restore_flags(flags); - - return len; -} diff -u --recursive --new-file v2.2.5/linux/net/irda/irqueue.c linux/net/irda/irqueue.c --- v2.2.5/linux/net/irda/irqueue.c Wed Mar 10 15:29:53 1999 +++ linux/net/irda/irqueue.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Tue Jun 9 13:29:31 1998 - * Modified at: Mon Feb 8 09:05:51 1999 + * Modified at: Thu Mar 11 13:27:04 1999 * Modified by: Dag Brattli * * Copyright (C) 1998, Aage Kvalnes @@ -45,9 +45,10 @@ * Create hashbin! * */ -hashbin_t *hashbin_new( int type) +hashbin_t *hashbin_new(int type) { hashbin_t* hashbin; + int i; DEBUG( 4, __FUNCTION__ "()\n"); @@ -61,9 +62,13 @@ /* * Initialize structure */ - memset( hashbin, 0, sizeof(hashbin_t)); + memset(hashbin, 0, sizeof(hashbin_t)); hashbin->hb_type = type; hashbin->magic = HB_MAGIC; + + /* Make sure all spinlock's are unlocked */ + for (i=0;ihb_mutex[i] = SPIN_LOCK_UNLOCKED; return hashbin; } @@ -161,10 +166,9 @@ bin = GET_HASHBIN( hashv); /* Synchronize */ - if ( hashbin->hb_type & HB_GLOBAL ) { - + if ( hashbin->hb_type & HB_GLOBAL ) spin_lock_irqsave( &hashbin->hb_mutex[ bin], flags); - } else { + else { save_flags( flags); cli(); } @@ -176,27 +180,27 @@ * Unlock the hashbin * */ -void hashbin_unlock( hashbin_t* hashbin, __u32 hashv, char* name, - unsigned long flags) +void hashbin_unlock(hashbin_t* hashbin, __u32 hashv, char* name, + unsigned long flags) { int bin; - DEBUG( 0, "hashbin_unlock()\n"); + DEBUG(0, "hashbin_unlock()\n"); - ASSERT( hashbin != NULL, return;); - ASSERT( hashbin->magic == HB_MAGIC, return;); + ASSERT(hashbin != NULL, return;); + ASSERT(hashbin->magic == HB_MAGIC, return;); /* * Locate hashbin */ - if ( name ) - hashv = hash( name ); - bin = GET_HASHBIN( hashv ); + if (name ) + hashv = hash(name); + bin = GET_HASHBIN(hashv); /* Release lock */ - if ( hashbin->hb_type & HB_GLOBAL) { + if ( hashbin->hb_type & HB_GLOBAL) spin_unlock_irq( &hashbin->hb_mutex[ bin]); - } else if ( hashbin->hb_type & HB_LOCAL) { + else if (hashbin->hb_type & HB_LOCAL) { restore_flags( flags); } } diff -u --recursive --new-file v2.2.5/linux/net/irda/irttp.c linux/net/irda/irttp.c --- v2.2.5/linux/net/irda/irttp.c Wed Mar 10 15:29:53 1999 +++ linux/net/irda/irttp.c Thu Apr 15 05:42:42 1999 @@ -1,12 +1,12 @@ /********************************************************************* * * Filename: irttp.c - * Version: 1.0 + * Version: 1.2 * Description: Tiny Transport Protocol (TTP) implementation * Status: Experimental. * Author: Dag Brattli * Created at: Sun Aug 31 20:14:31 1997 - * Modified at: Sat Feb 20 01:30:39 1999 + * Modified at: Thu Mar 25 10:27:08 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -37,15 +38,15 @@ static void __irttp_close_tsap(struct tsap_cb *self); -static void irttp_data_indication(void *instance, void *sap, +static int irttp_data_indication(void *instance, void *sap, + struct sk_buff *skb); +static int irttp_udata_indication(void *instance, void *sap, struct sk_buff *skb); -static void irttp_udata_indication(void *instance, void *sap, - struct sk_buff *skb); static void irttp_disconnect_indication(void *instance, void *sap, LM_REASON reason, struct sk_buff *); static void irttp_connect_indication(void *instance, void *sap, - struct qos_info *qos, int max_sdu_size, + struct qos_info *qos, __u32 max_sdu_size, struct sk_buff *skb); static void irttp_run_tx_queue(struct tsap_cb *self); @@ -127,8 +128,7 @@ self = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC); if (self == NULL) { - printk(KERN_ERR "IrTTP: Can't allocate memory for " - "TSAP control block!\n"); + DEBUG(0, __FUNCTION__ "(), unable to kmalloc!\n"); return NULL; } memset(self, 0, sizeof(struct tsap_cb)); @@ -136,7 +136,6 @@ init_timer(&self->todo_timer); /* Initialize callbacks for IrLMP to use */ - irda_notify_init(&ttp_notify); ttp_notify.connect_confirm = irttp_connect_confirm; ttp_notify.connect_indication = irttp_connect_indication; @@ -146,6 +145,12 @@ ttp_notify.instance = self; strncpy(ttp_notify.name, notify->name, NOTIFY_MAX_NAME); + self->magic = TTP_TSAP_MAGIC; + self->connected = FALSE; + + skb_queue_head_init(&self->rx_queue); + skb_queue_head_init(&self->tx_queue); + skb_queue_head_init(&self->rx_fragments); /* * Create LSAP at IrLMP layer */ @@ -165,24 +170,15 @@ self->notify = *notify; self->lsap = lsap; - self->magic = TTP_TSAP_MAGIC; - self->connected = FALSE; - - skb_queue_head_init(&self->rx_queue); - skb_queue_head_init(&self->tx_queue); - skb_queue_head_init(&self->rx_fragments); - /* - * Insert ourself into the hashbin - */ - hashbin_insert(irttp->tsaps, (QUEUE *) self, self->stsap_sel, NULL); + hashbin_insert(irttp->tsaps, (QUEUE *) self, (int) self, NULL); if (credit > TTP_MAX_QUEUE) self->initial_credit = TTP_MAX_QUEUE; else self->initial_credit = credit; - - return self; + + return self; } /* @@ -194,8 +190,6 @@ */ static void __irttp_close_tsap(struct tsap_cb *self) { - DEBUG(4, __FUNCTION__ "()\n"); - /* First make sure we're connected. */ ASSERT(self != NULL, return;); ASSERT(self->magic == TTP_TSAP_MAGIC, return;); @@ -239,7 +233,7 @@ return 0; /* Will be back! */ } - tsap = hashbin_remove(irttp->tsaps, self->stsap_sel, NULL); + tsap = hashbin_remove(irttp->tsaps, (int) self, NULL); ASSERT(tsap == self, return -1;); @@ -295,8 +289,6 @@ { __u8 *frame; - DEBUG(4, __FUNCTION__ "()\n"); - ASSERT(self != NULL, return -1;); ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); ASSERT(skb != NULL, return -1;); @@ -304,7 +296,7 @@ /* Check that nothing bad happens */ if ((skb->len == 0) || (!self->connected)) { DEBUG(4, __FUNCTION__ "(), No data, or not connected\n"); - return -1; + return -ENOTCONN; } /* @@ -314,7 +306,7 @@ if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) { DEBUG(1, __FUNCTION__ "(), SAR disabled, and data is to large for IrLAP!\n"); - return -1; + return -EMSGSIZE; } /* @@ -322,11 +314,12 @@ * TxMaxSduSize */ if ((self->tx_max_sdu_size != 0) && + (self->tx_max_sdu_size != SAR_UNBOUND) && (skb->len > self->tx_max_sdu_size)) { DEBUG(1, __FUNCTION__ "(), SAR enabled, " "but data is larger than TxMaxSduSize!\n"); - return -1; + return -EMSGSIZE; } /* * Check if transmit queue is full @@ -337,7 +330,7 @@ */ irttp_run_tx_queue(self); - return -1; + return -ENOBUFS; } /* Queue frame, or queue frame segments */ @@ -378,7 +371,7 @@ } /* - * Function irttp_xmit (self) + * Function irttp_run_tx_queue (self) * * If possible, transmit a frame queued for transmission. * @@ -396,8 +389,7 @@ if (irda_lock(&self->tx_queue_lock) == FALSE) return; - while ((self->send_credit > 0) && !skb_queue_empty(&self->tx_queue)){ - + while ((self->send_credit > 0) && !skb_queue_empty(&self->tx_queue)) { skb = skb_dequeue(&self->tx_queue); ASSERT(skb != NULL, return;); @@ -409,13 +401,12 @@ * the code below is a critical region and we must assure that * nobody messes with the credits while we update them. */ - save_flags(flags); - cli(); + spin_lock_irqsave(&self->lock, flags); n = self->avail_credit; self->avail_credit = 0; - /* Only space for 127 credits in frame */ + /* Only room for 127 credits in frame */ if (n > 127) { self->avail_credit = n-127; n = 127; @@ -423,10 +414,8 @@ self->remote_credit += n; self->send_credit--; - restore_flags(flags); + spin_unlock_irqrestore(&self->lock, flags); - DEBUG(4, "irttp_xmit: Giving away %d credits\n", n); - /* * More bit must be set by the data_request() or fragment() * functions @@ -443,12 +432,14 @@ /* Check if we can accept more frames from client */ if ((self->tx_sdu_busy) && - (skb_queue_len(&self->tx_queue) < LOW_THRESHOLD)) { + (skb_queue_len(&self->tx_queue) < LOW_THRESHOLD)) + { self->tx_sdu_busy = FALSE; if (self->notify.flow_indication) self->notify.flow_indication( - self->notify.instance, self, FLOW_START); + self->notify.instance, self, + FLOW_START); } } @@ -487,8 +478,7 @@ * the code below is a critical region and we must assure that * nobody messes with the credits while we update them. */ - save_flags(flags); - cli(); + spin_lock_irqsave(&self->lock, flags); n = self->avail_credit; self->avail_credit = 0; @@ -500,7 +490,7 @@ } self->remote_credit += n; - restore_flags(flags); + spin_unlock_irqrestore(&self->lock, flags); skb_put(tx_skb, 1); tx_skb->data[0] = (__u8) (n & 0x7f); @@ -512,10 +502,11 @@ /* * Function irttp_udata_indication (instance, sap, skb) * - * + * Received some unit-data (unreliable) * */ -void irttp_udata_indication(void *instance, void *sap, struct sk_buff *skb) +static int irttp_udata_indication(void *instance, void *sap, + struct sk_buff *skb) { struct tsap_cb *self; @@ -523,15 +514,17 @@ self = (struct tsap_cb *) instance; - ASSERT(self != NULL, return;); - ASSERT(self->magic == TTP_TSAP_MAGIC, return;); - ASSERT(skb != NULL, return;); + ASSERT(self != NULL, return -1;); + ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); + ASSERT(skb != NULL, return -1;); /* Just pass data to layer above */ if (self->notify.udata_indication) { self->notify.udata_indication(self->notify.instance, self, skb); } self->stats.rx_packets++; + + return 0; } /* @@ -540,7 +533,8 @@ * Receive segment from IrLMP. * */ -void irttp_data_indication(void *instance, void *sap, struct sk_buff *skb) +static int irttp_data_indication(void *instance, void *sap, + struct sk_buff *skb) { struct tsap_cb *self; int more; @@ -549,17 +543,17 @@ self = (struct tsap_cb *) instance; - ASSERT(self != NULL, return;); - ASSERT(self->magic == TTP_TSAP_MAGIC, return;); - ASSERT(skb != NULL, return;); + ASSERT(self != NULL, return -1;); + ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); + ASSERT(skb != NULL, return -1;); frame = skb->data; n = frame[0] & 0x7f; /* Extract the credits */ more = frame[0] & 0x80; - DEBUG(4, __FUNCTION__"(), got %d credits, TSAP sel=%02x\n", - n, self->stsap_sel); + DEBUG(3, __FUNCTION__"(), got %d credits, TSAP sel=%02x\n", + n, self->stsap_sel); self->stats.rx_packets++; @@ -600,6 +594,7 @@ */ if (self->send_credit == n) irttp_start_todo_timer(self, 0); + return 0; } /* @@ -638,25 +633,26 @@ * Try to connect to remote destination TSAP selector * */ -void irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, - __u32 saddr, __u32 daddr, - struct qos_info *qos, int max_sdu_size, - struct sk_buff *userdata) +int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, + __u32 saddr, __u32 daddr, + struct qos_info *qos, __u32 max_sdu_size, + struct sk_buff *userdata) { struct sk_buff *skb; + __u16 tmp_be; __u8 *frame; __u8 n; DEBUG(4, __FUNCTION__ "(), max_sdu_size=%d\n", max_sdu_size); - ASSERT(self != NULL, return;); - ASSERT(self->magic == TTP_TSAP_MAGIC, return;); + ASSERT(self != NULL, return -1;); + ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); /* Any userdata supplied? */ if (userdata == NULL) { skb = dev_alloc_skb(64); if (!skb) - return; + return -ENOMEM; /* Reserve space for MUX_CONTROL and LAP header */ skb_reserve(skb, (TTP_HEADER+LMP_CONTROL_HEADER+LAP_HEADER)); @@ -667,7 +663,7 @@ * headers */ ASSERT(skb_headroom(userdata) >= - (TTP_HEADER+LMP_CONTROL_HEADER+LAP_HEADER), return;); + (TTP_HEADER+LMP_CONTROL_HEADER+LAP_HEADER), return -1;); } /* Initialize connection parameters */ @@ -697,7 +693,7 @@ if (max_sdu_size > 0) { ASSERT(skb_headroom(skb) >= (TTP_HEADER_WITH_SAR+LMP_CONTROL_HEADER+LAP_HEADER), - return;); + return -1;); /* Insert SAR parameters */ frame = skb_push(skb, TTP_HEADER_WITH_SAR); @@ -706,7 +702,9 @@ frame[1] = 0x04; /* Length */ frame[2] = 0x01; /* MaxSduSize */ frame[3] = 0x02; /* Value length */ - *((__u16 *) (frame+4))= htons(max_sdu_size); /* Big endian! */ + + tmp_be = cpu_to_be16((__u16) max_sdu_size); + memcpy(frame+4, &tmp_be, 2); } else { /* Insert plain TTP header */ frame = skb_push(skb, TTP_HEADER); @@ -716,7 +714,8 @@ } /* Connect with IrLMP. No QoS parameters for now */ - irlmp_connect_request(self->lsap, dtsap_sel, saddr, daddr, qos, skb); + return irlmp_connect_request(self->lsap, dtsap_sel, saddr, daddr, qos, + skb); } /* @@ -726,12 +725,14 @@ * */ void irttp_connect_confirm(void *instance, void *sap, struct qos_info *qos, - int max_seg_size, struct sk_buff *skb) + __u32 max_seg_size, struct sk_buff *skb) { struct tsap_cb *self; + __u16 tmp_cpu; __u8 *frame; __u8 n; int parameters; + __u8 plen, pi, pl; DEBUG(4, __FUNCTION__ "()\n"); @@ -765,9 +766,16 @@ parameters = frame[0] & 0x80; if (parameters) { - DEBUG(4, __FUNCTION__ "(), Contains parameters!\n"); - - self->tx_max_sdu_size = ntohs(*(__u16 *)(frame+4)); + plen = frame[1]; + pi = frame[2]; + pl = frame[3]; + + ASSERT(pl == 2, return;); + + memcpy(&tmp_cpu, frame+4, 2); /* Align value */ + be16_to_cpus(&tmp_cpu); /* Convert to host order */ + self->tx_max_sdu_size = tmp_cpu; + DEBUG(4, __FUNCTION__ "(), RxMaxSduSize=%d\n", self->tx_max_sdu_size); } @@ -791,14 +799,16 @@ * */ void irttp_connect_indication(void *instance, void *sap, - struct qos_info *qos, int max_seg_size, + struct qos_info *qos, __u32 max_seg_size, struct sk_buff *skb) { struct tsap_cb *self; struct lsap_cb *lsap; + __u16 tmp_cpu; __u8 *frame; int parameters; int n; + __u8 plen, pi, pl; self = (struct tsap_cb *) instance; @@ -827,15 +837,23 @@ parameters = frame[0] & 0x80; if (parameters) { DEBUG(4, __FUNCTION__ "(), Contains parameters!\n"); - - self->tx_max_sdu_size = ntohs(*(__u16 *)(frame+4)); + plen = frame[1]; + pi = frame[2]; + pl = frame[3]; + + ASSERT(pl == 2, return;); + + memcpy(&tmp_cpu, frame+4, 2); /* Align value */ + be16_to_cpus(&tmp_cpu); /* Convert to host order */ + + self->tx_max_sdu_size = tmp_cpu; DEBUG(4, __FUNCTION__ "(), MaxSduSize=%d\n", self->tx_max_sdu_size); } DEBUG(4, __FUNCTION__ "(), initial send_credit=%d\n", n); - skb_pull(skb, 1); + skb_pull(skb, 1); /* Remove TTP header */ if (self->notify.connect_indication) { self->notify.connect_indication(self->notify.instance, self, @@ -851,10 +869,11 @@ * IrLMP! * */ -void irttp_connect_response(struct tsap_cb *self, int max_sdu_size, +void irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size, struct sk_buff *userdata) { struct sk_buff *skb; + __u32 tmp_be; __u8 *frame; __u8 n; @@ -912,7 +931,9 @@ frame[1] = 0x04; /* Length */ frame[2] = 0x01; /* MaxSduSize */ frame[3] = 0x02; /* Value length */ - *((__u16 *) (frame+4))= htons(max_sdu_size); + + tmp_be = cpu_to_be16((__u16)max_sdu_size); + memcpy(frame+4, &tmp_be, 2); } else { /* Insert TTP header */ frame = skb_push(skb, TTP_HEADER); @@ -924,6 +945,44 @@ } /* + * Function irttp_dup (self, instance) + * + * Duplicate TSAP, can be used by servers to confirm a connection on a + * new TSAP so it can keep listening on the old one. + */ +struct tsap_cb *irttp_dup(struct tsap_cb *orig, void *instance) +{ + struct tsap_cb *new; + + DEBUG(1, __FUNCTION__ "()\n"); + + if (!hashbin_find(irttp->tsaps, (int) orig, NULL)) { + DEBUG(0, __FUNCTION__ "(), unable to find TSAP\n"); + return NULL; + } + new = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC); + if (!new) { + DEBUG(0, __FUNCTION__ "(), unable to kmalloc\n"); + return NULL; + } + /* Dup */ + memcpy(new, orig, sizeof(struct tsap_cb)); + new->notify.instance = instance; + new->lsap = irlmp_dup(orig->lsap, new); + + /* Not everything should be copied */ + init_timer(&new->todo_timer); + + skb_queue_head_init(&new->rx_queue); + skb_queue_head_init(&new->tx_queue); + skb_queue_head_init(&new->rx_fragments); + + hashbin_insert(irttp->tsaps, (QUEUE *) new, (int) new, NULL); + + return new; +} + +/* * Function irttp_disconnect_request (self) * * Close this connection please! If priority is high, the queued data @@ -1028,12 +1087,44 @@ self->connected = FALSE; - /* - * Use callback to notify layer above + if (!self->notify.disconnect_indication) + return; + + self->notify.disconnect_indication(self->notify.instance, self, reason, + userdata); +} + +/* + * Function irttp_do_data_indication (self, skb) + * + * Try to deliver reassebled skb to layer above, and requeue it if that + * for some reason should fail. We mark rx sdu as busy to apply back + * pressure is necessary. + */ +void irttp_do_data_indication(struct tsap_cb *self, struct sk_buff *skb) +{ + int err; + + err = self->notify.data_indication(self->notify.instance, self, skb); + + /* Usually the layer above will notify that it's input queue is + * starting to get filled by using the flow request, but this may + * be difficult, so it can instead just refuse to eat it and just + * give an error back */ - if (self->notify.disconnect_indication) - self->notify.disconnect_indication(self->notify.instance, - self, reason, userdata); + if (err == -ENOMEM) { + DEBUG(0, __FUNCTION__ "() requeueing skb!\n"); + + /* Make sure we take a break */ + self->rx_sdu_busy = TRUE; + + /* Need to push the header in again */ + skb_push(skb, TTP_HEADER); + skb->data[0] = 0x00; /* Make sure MORE bit is cleared */ + + /* Put skb back on queue */ + skb_queue_head(&self->rx_queue, skb); + } } /* @@ -1045,15 +1136,7 @@ void irttp_run_rx_queue(struct tsap_cb *self) { struct sk_buff *skb; - __u8 *frame; int more = 0; - void *instance; - - ASSERT(self != NULL, return;); - ASSERT(self->magic == TTP_TSAP_MAGIC, return;); - - instance = self->notify.instance; - ASSERT(instance != NULL, return;); DEBUG(4, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n", self->send_credit, self->avail_credit, self->remote_credit); @@ -1062,20 +1145,12 @@ return; /* - * Process receive queue + * Reassemble all frames in receive queue and deliver them */ - while ((!skb_queue_empty(&self->rx_queue)) && !self->rx_sdu_busy) { - - skb = skb_dequeue(&self->rx_queue); - if (!skb) - break; /* Should not happend, but ... */ - + while (!self->rx_sdu_busy && (skb = skb_dequeue(&self->rx_queue))) { self->avail_credit++; - frame = skb->data; - more = frame[0] & 0x80; - DEBUG(4, __FUNCTION__ "(), More=%s\n", more ? "TRUE" : - "FALSE"); + more = skb->data[0] & 0x80; /* Remove TTP header */ skb_pull(skb, TTP_HEADER); @@ -1089,10 +1164,10 @@ * immediately. This can be requested by clients that * implements byte streams without any message boundaries */ - if ((self->no_defrag) || (self->rx_max_sdu_size == 0)) { - self->notify.data_indication(instance, self, skb); + if (self->rx_max_sdu_size == SAR_DISABLE) { + irttp_do_data_indication(self, skb); self->rx_sdu_size = 0; - + continue; } @@ -1103,43 +1178,47 @@ * limits of the maximum size of the rx_sdu */ if (self->rx_sdu_size <= self->rx_max_sdu_size) { - DEBUG(4, __FUNCTION__ - "(), queueing fragment\n"); - + DEBUG(4, __FUNCTION__ "(), queueing frag\n"); skb_queue_tail(&self->rx_fragments, skb); } else { - DEBUG(1, __FUNCTION__ "(), Error!\n"); + /* Free the part of the SDU that is too big */ + dev_kfree_skb(skb); } - } else { - /* - * This is the last fragment, so time to reassemble! + continue; + } + /* + * This is the last fragment, so time to reassemble! + */ + if ((self->rx_sdu_size <= self->rx_max_sdu_size) || + (self->rx_max_sdu_size == SAR_UNBOUND)) + { + /* + * A little optimizing. Only queue the fragment if + * there are other fragments. Since if this is the + * last and only fragment, there is no need to + * reassemble :-) */ - if (self->rx_sdu_size <= self->rx_max_sdu_size) { - - /* A little optimizing. Only queue the - * fragment if there is other fragments. Since - * if this is the last and only fragment, - * there is no need to reassemble - */ - if (!skb_queue_empty(&self->rx_fragments)) { - - DEBUG(4, __FUNCTION__ - "(), queueing fragment\n"); - skb_queue_tail(&self->rx_fragments, - skb); - - skb = irttp_reassemble_skb(self); - } - self->notify.data_indication(instance, self, - skb); - } else { - DEBUG(1, __FUNCTION__ - "(), Truncated frame\n"); - self->notify.data_indication( - self->notify.instance, self, skb); + if (!skb_queue_empty(&self->rx_fragments)) { + skb_queue_tail(&self->rx_fragments, + skb); + + skb = irttp_reassemble_skb(self); } - self->rx_sdu_size = 0; + + /* Now we can deliver the reassembled skb */ + irttp_do_data_indication(self, skb); + } else { + DEBUG(1, __FUNCTION__ "(), Truncated frame\n"); + + /* Free the part of the SDU that is too big */ + dev_kfree_skb(skb); + + /* Deliver only the valid but truncated part of SDU */ + skb = irttp_reassemble_skb(self); + + irttp_do_data_indication(self, skb); } + self->rx_sdu_size = 0; } /* Reset lock */ self->rx_queue_lock = 0; @@ -1194,6 +1273,11 @@ if (!skb) return NULL; + /* + * Need to reserve space for TTP header in case this skb needs to + * be requeued in case delivery failes + */ + skb_reserve(skb, TTP_HEADER); skb_put(skb, self->rx_sdu_size); /* @@ -1310,6 +1394,9 @@ if (self->disconnect_pend) { /* Check if it's possible to disconnect yet */ if (skb_queue_empty(&self->tx_queue)) { + + /* Make sure disconnect is not pending anymore */ + self->disconnect_pend = FALSE; if (self->disconnect_skb) { irttp_disconnect_request( self, self->disconnect_skb, P_NORMAL); diff -u --recursive --new-file v2.2.5/linux/net/irda/wrapper.c linux/net/irda/wrapper.c --- v2.2.5/linux/net/irda/wrapper.c Wed Mar 10 15:29:53 1999 +++ linux/net/irda/wrapper.c Thu Apr 15 05:42:42 1999 @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli * Created at: Mon Aug 4 20:40:53 1997 - * Modified at: Tue Feb 16 17:27:23 1999 + * Modified at: Fri Mar 26 21:52:53 1999 * Modified by: Dag Brattli * * Copyright (c) 1998 Dag Brattli , @@ -60,10 +60,9 @@ fcs.value = INIT_FCS; n = 0; - if ( skb->len > 2048) { - DEBUG( 0, __FUNCTION__ "Warning size=%d of sk_buff to big!\n", - (int) skb->len); - + if (skb->len > 2048) { + DEBUG(0, __FUNCTION__ "Warning size=%d of sk_buff to big!\n", + (int) skb->len); return 0; } @@ -71,8 +70,13 @@ * Send XBOF's for required min. turn time and for the negotiated * additional XBOFS */ - xbofs = ((struct irlap_skb_cb *)(skb->cb))->xbofs; - for ( i=0; icb))->magic != LAP_MAGIC) { + DEBUG(1, __FUNCTION__ "(), wrong magic in skb!\n"); + xbofs = 11; + } else + xbofs = ((struct irlap_skb_cb *)(skb->cb))->xbofs; + + for (i=0; ilen; i++) { + for (i=0; i < skb->len; i++) { byte = skb->data[i]; /* @@ -100,11 +104,11 @@ /* Insert CRC in little endian format (LSB first) */ fcs.value = ~fcs.value; #ifdef __LITTLE_ENDIAN - n += stuff_byte( fcs.bytes[0], tx_buff+n); - n += stuff_byte( fcs.bytes[1], tx_buff+n); + n += stuff_byte(fcs.bytes[0], tx_buff+n); + n += stuff_byte(fcs.bytes[1], tx_buff+n); #else ifdef __BIG_ENDIAN - n += stuff_byte( fcs.bytes[1], tx_buff+n); - n += stuff_byte( fcs.bytes[0], tx_buff+n); + n += stuff_byte(fcs.bytes[1], tx_buff+n); + n += stuff_byte(fcs.bytes[0], tx_buff+n); #endif tx_buff[n++] = EOF; @@ -127,7 +131,7 @@ return; } - /* Align to 20 bytes */ + /* Align IP header to 20 bytes */ skb_reserve( skb, 1); ASSERT( len-2 > 0, return;); diff -u --recursive --new-file v2.2.5/linux/net/netlink/af_netlink.c linux/net/netlink/af_netlink.c --- v2.2.5/linux/net/netlink/af_netlink.c Mon Mar 29 11:09:12 1999 +++ linux/net/netlink/af_netlink.c Thu Apr 15 05:42:43 1999 @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff -u --recursive --new-file v2.2.5/linux/scripts/ver_linux linux/scripts/ver_linux --- v2.2.5/linux/scripts/ver_linux Tue Mar 23 14:35:48 1999 +++ linux/scripts/ver_linux Fri Apr 16 08:20:23 1999 @@ -20,10 +20,7 @@ '{print "Linux C++ Library " $4"."$5"."$6}' ps --version 2>&1 | awk 'NR==1{print "Procps ", $NF}' mount --version | awk -F\- '{print "Mount ", $NF}' -netstat --version | awk \ -'NR==1{if ($5 != "") { n=split($5,buf,"-"); ver=buf[n]; done=1 }} - NR==2{if (done != 1) ver=$3 } - END{print "Net-tools ",ver}' +hostname -V 2>&1 | awk 'NR==1{print "Net-tools ", $NF}' loadkeys -h 2>&1 | awk \ '(NR==1 && $3) {ver=$3} (NR==2 && $1 ~ /console-tools/) {print "Console-tools ",$3; done=1}