]> git.neil.brown.name Git - history.git/commitdiff
Import 2.0.34pre3 2.0.34pre3
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:11:39 +0000 (15:11 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:11:39 +0000 (15:11 -0500)
109 files changed:
CREDITS
Documentation/Configure.help
Documentation/filesystems/00-INDEX
Documentation/filesystems/isofs.txt [new file with mode: 0644]
Documentation/filesystems/vfat.txt
Makefile
arch/alpha/defconfig
arch/i386/defconfig
arch/i386/kernel/ptrace.c
arch/i386/kernel/signal.c
arch/ppc/kernel/setup.c
drivers/block/ide-cd.c
drivers/char/psaux.c
drivers/char/random.c
drivers/char/scc.c
drivers/char/serial.c
drivers/char/specialix.c
drivers/isdn/avmb1/capiutil.c
drivers/isdn/sc/includes.h
drivers/net/ne.c
drivers/net/strip.c
drivers/scsi/BusLogic.c
drivers/scsi/BusLogic.h
drivers/scsi/FlashPoint.c
drivers/scsi/Makefile
drivers/scsi/README.BusLogic
drivers/scsi/README.Mylex [new file with mode: 0644]
drivers/scsi/dc390.h
drivers/scsi/sd.c
drivers/scsi/sr_ioctl.c
drivers/scsi/tmscsim.c
drivers/sound/.defines [new file with mode: 0644]
drivers/sound/Config.in
drivers/sound/local.h [new file with mode: 0644]
drivers/sound/lowlevel/aci.c
fs/Config.in
fs/Makefile
fs/ext2/namei.c
fs/fat/buffer.c
fs/fat/cache.c
fs/fat/dir.c
fs/fat/fatfs_syms.c
fs/fat/file.c
fs/fat/inode.c
fs/fat/misc.c
fs/fat/mmap.c
fs/fat/tables.c
fs/fat/tables.h
fs/filesystems.c
fs/isofs/Makefile
fs/isofs/dir.c
fs/isofs/inode.c
fs/isofs/joliet.c [new file with mode: 0644]
fs/isofs/namei.c
fs/isofs/rock.c
fs/isofs/util.c
fs/msdos/namei.c
fs/nls.c [new file with mode: 0644]
fs/nls_cp437.c [new file with mode: 0644]
fs/nls_cp737.c [new file with mode: 0644]
fs/nls_cp775.c [new file with mode: 0644]
fs/nls_cp850.c [new file with mode: 0644]
fs/nls_cp852.c [new file with mode: 0644]
fs/nls_cp855.c [new file with mode: 0644]
fs/nls_cp857.c [new file with mode: 0644]
fs/nls_cp860.c [new file with mode: 0644]
fs/nls_cp861.c [new file with mode: 0644]
fs/nls_cp862.c [new file with mode: 0644]
fs/nls_cp863.c [new file with mode: 0644]
fs/nls_cp864.c [new file with mode: 0644]
fs/nls_cp865.c [new file with mode: 0644]
fs/nls_cp866.c [new file with mode: 0644]
fs/nls_cp869.c [new file with mode: 0644]
fs/nls_cp874.c [new file with mode: 0644]
fs/nls_iso8859_1.c [new file with mode: 0644]
fs/nls_iso8859_2.c [new file with mode: 0644]
fs/nls_iso8859_3.c [new file with mode: 0644]
fs/nls_iso8859_4.c [new file with mode: 0644]
fs/nls_iso8859_5.c [new file with mode: 0644]
fs/nls_iso8859_6.c [new file with mode: 0644]
fs/nls_iso8859_7.c [new file with mode: 0644]
fs/nls_iso8859_8.c [new file with mode: 0644]
fs/nls_iso8859_9.c [new file with mode: 0644]
fs/nls_koi8_r.c [new file with mode: 0644]
fs/smbfs/dir.c
fs/smbfs/inode.c
fs/smbfs/proc.c
fs/vfat/Makefile
fs/vfat/namei.c
fs/vfat/vfatfs_syms.c [new file with mode: 0644]
include/linux/iso_fs.h
include/linux/iso_fs_i.h
include/linux/iso_fs_sb.h
include/linux/module.h
include/linux/modversions.h [new file with mode: 0644]
include/linux/msdos_fs.h
include/linux/msdos_fs_i.h
include/linux/msdos_fs_sb.h
include/linux/nls.h [new file with mode: 0644]
include/linux/smbno.h
init/main.c
kernel/ksyms.c
kernel/module.c
kernel/panic.c
mm/filemap.c
net/ax25/af_ax25.c
net/ipv4/Config.in
net/ipv4/raw.c
net/netrom/af_netrom.c

diff --git a/CREDITS b/CREDITS
index 7ef572d583ac9d90eb5bb797b7b74e79d8aaae84..b97f56ac0e14006a14f897d3bb2c72ed1453d68b 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -207,7 +207,8 @@ S: USA
 
 N: Gordon Chaffee
 E: chaffee@plateau.cs.berkeley.edu
-D: vfat filesystem
+W: http://bmrc.berkeley.edu/people/chaffee/
+D: vfat, fat32, joliet, native language support
 S: 3674 Oakwood Terrace #201
 S: Fremont, California 94536
 S: USA
index b401f41cfa18b0ca2e6d020549429f0cab389db2..fa589d01c2f89093295537235f1712c70cede859 100644 (file)
@@ -1851,6 +1851,8 @@ CONFIG_SCSI_AM53C974
   drivers/scsi/README.AM53C974 for details. Also, the SCSI-HOWTO,
   available via ftp (user: anonymous) at
   sunsite.unc.edu:/pub/Linux/docs/HOWTO, is for you.
+  Use the native DC390 driver if you've got a Tekram DC390(T) PCI-SCSI
+  host adapter.
 
 GDT SCSI Disk Array Controller support
 CONFIG_SCSI_GDTH
@@ -3142,6 +3144,155 @@ CONFIG_UMSDOS_FS
   Documentation/modules.txt. Note that the filesystem of your root
   partition cannot be a module.
 
+nls: Native language codepages and Unicode support
+CONFIG_NLS
+  This is required by the FAT based filesystems and by the ISO9660
+  filesystem with Joliet support.  Joliet is a Microsoft extension
+  for CDROMs that supports Unicode.
+  This allows translation between different character sets. When dealing
+  with the FAT based filesystems, there are two character sets that
+  are important. The first is the codepage.  Codepages are character sets
+  that are used by DOS to
+  allow filenames to have native language characters when character sets
+  were limited to 256 characters. The codepage is the character
+  set that is used to store native language characters on disk. 
+  The two most common codepages are 437 in the United States and 850
+  in much of Europe. The second important character set is the
+  input/output character set. This is the character set that is displayed
+  on the screen. In the United States, this will almost always be the
+  ISO 8859-1 character set. This is the default. Linux will only do a
+  translation of the FAT filenames, not the contents of the files.
+
+nls iso8859-1
+CONFIG_NLS_ISO8859_1
+  ISO8859-1 is the Latin 1 character set, and it 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.
+
+nls iso8859-2
+CONFIG_NLS_ISO8859_2
+  ISO8859-2 is the Latin 2 character set, and it works for most
+  Latin-written Slavic and Central European languages: Czech, German,
+  Hungarian, Polish, Rumanian, Croatian, Slovak, Slovene.
+
+nls iso8859-3
+CONFIG_NLS_ISO8859_3
+  ISO8859-3 is the Latin 3 character set, and it s popular with authors
+  of Esperanto, Galician, Maltese, and Turkish.
+
+nls iso8859-4
+CONFIG_NLS_ISO8859_4
+  ISO8859-4 is the Latin 4 character set, and it introduces letters
+  for Estonian, Latvian, and Lithuanian. It is an incomplete predecessor of
+  Latin 6.
+
+nls iso8859-5
+CONFIG_NLS_ISO8859_5
+  ISO8859-5 is a Cyrillic character set, and you can type Bulgarian,
+  Byelorussian, Macedonian, Russian, Serbian, and Ukrainian.
+  Note that the charset KOI8-R is preferred in Russia.
+
+nls iso8859-6
+CONFIG_NLS_ISO8859_6
+  ISO8859-6 is the Arabic character set.
+
+nls iso8859-7
+CONFIG_NLS_ISO8859_7
+  ISO8859-7 is the Modern Greek character set.
+
+nls iso8859-8
+CONFIG_NLS_ISO8859_8
+  ISO8859-8 is the Hebrew character set.
+
+nls iso8859-9
+CONFIG_NLS_ISO8859_9
+  ISO8859-9 is the Latin 5 character set, and it replaces the rarely
+  needed Icelandic letters in Latin 1 with the Turkish ones. Useful in
+  Turkey.
+
+nls iso8859-10
+CONFIG_NLS_ISO8859_10
+  ISO8859-10 is the Latin 6 character set, and it adds the last Inuit
+  (Greenlandic) and Sami (Lappish) letters that were missing in Latin 4 to
+  cover the entire Nordic area. 
+
+nls koi8-r
+CONFIG_NLS_KOI8_R
+  This is the preferred Russian character set.
+
+nls codepage 437
+CONFIG_NLS_CODEPAGE_437
+  This is the DOS codepage that is used in the United States and parts of
+  Canada.
+
+nls codepage 737
+CONFIG_NLS_CODEPAGE_737
+  This is the codepage used by DOS for Greek.
+
+nls codepage 775
+CONFIG_NLS_CODEPAGE_775
+  This is the codepage used by DOS for the Baltic Rim Languages.
+
+nls codepage 850
+CONFIG_NLS_CODEPAGE_850
+  This is the DOS codepage that is used in much of Europe--United Kingdom,
+  Germany, Spain, Italy, and [add more countries here]. It has some
+  characters useful to many European languages that are not part of
+  codepage 437.
+
+nls codepage 852
+CONFIG_NLS_CODEPAGE_852
+  This is the Latin 2 codepage used by DOS for much of Central and
+  Eastern Europe.  It has all the required characters for these languages:
+  Albanian, Croatian, Czech, English, Finnish, Hungarian, Irish, German,
+  Polish, Romanian, Serbian (Latin transcription), Slovak, Slovenian, and
+  Sorbian.
+
+nls codepage 855
+CONFIG_NLS_CODEPAGE_855
+  This is the DOS codepage that is used for Cyrillic.
+
+nls codepage 857
+CONFIG_NLS_CODEPAGE_857
+  This is the DOS codepage that is used for Turkish.
+
+nls codepage 860
+CONFIG_NLS_CODEPAGE_860
+  This is the DOS codepage that is used for Portuguese.
+
+nls codepage 861
+CONFIG_NLS_CODEPAGE_861
+  This is the DOS codepage that is used for Icelandic.
+
+nls codepage 862
+CONFIG_NLS_CODEPAGE_862
+  This is the DOS codepage that is used for Hebrew.
+
+nls codepage 863
+CONFIG_NLS_CODEPAGE_863
+  This is the DOS codepage that is used for Canadian French.
+
+nls codepage 864
+CONFIG_NLS_CODEPAGE_864
+  This is the DOS codepage that is used for Arabic.
+
+nls codepage 865
+CONFIG_NLS_CODEPAGE_865
+  This is the DOS codepage that is used in the Nordic European countries.
+
+nls codepage 866
+CONFIG_NLS_CODEPAGE_866
+  This is the DOS codepage that is used for Cyrillic/Russian.
+
+nls codepage 869
+CONFIG_NLS_CODEPAGE_869
+  This is the DOS codepage that is used for Greek.
+
+nls codepage 874
+CONFIG_NLS_CODEPAGE_874
+  This is the DOS codepage that is used for Thai.
+
 /proc filesystem support
 CONFIG_PROC_FS
   This is a virtual filesystem providing information about the status
index edb8c52124eb3b53783fbe30ffd857aca87d20c9..025c6691644eec623eaa35ecfdc0f7daed861716 100644 (file)
@@ -4,6 +4,8 @@ affs.txt
        - info and mount options for the Amiga Fast File System.
 hpfs.txt
        - info and mount options for the OS/2 HPFS.
+isofs.txt
+       - info and mount options for the ISO9660 (CDROM) filesystem.
 ncpfs.txt
        - info on Novell Netware(tm) filesystem using NCP protocol.
 smbfs.txt
diff --git a/Documentation/filesystems/isofs.txt b/Documentation/filesystems/isofs.txt
new file mode 100644 (file)
index 0000000..26b59cd
--- /dev/null
@@ -0,0 +1,31 @@
+Mount options that are the same as for msdos partitions.
+
+  uid=nnn      All files in the partition will be owned by user id nnn.
+  gid=nnn      All files in the partition will be in group nnn.
+  umask=nnn    The permission mask (see umask(1)) for the partition.
+  conv=binary   Data is returned exactly as is, with CRLF's.  [default]
+  conv=text     (Carriage return, line feed) is replaced with newline.
+  conv=mtext    (Carriage return, line feed) is returned as is (?).
+  conv=auto     Chooses, file by file, conv=binary or conv=text (by guessing)
+
+Mount options that are the same as vfat partitions. These are only useful
+when using discs encoded using Microsoft's Joliet extensions.
+  iocharset=name Character set to use for converting from Unicode to
+               ASCII.  Joliet filenames are stored in Unicode format, but
+               Unix for the most part doesn't know how to deal with Unicode.
+               There is also an option of doing UTF8 translations with the
+               utf8 option.
+  utf8          Encode Unicode names in UTF8 format. Default is no.
+
+Mount options that are unique to the isofs filesystem.
+  nojoliet      Ignore Joliet extensions if they are present.
+  norock        Ignore rockridge extensions if they are present.
+  unhide        Show hidden files (?).
+  cruft         Handle badly formatted CDs (?)
+  map=off       Do not map non-rockridge filenames to lowercase
+  map=normal    Map rockridge filenames to lowercase
+  check=relaxed 
+  check=strict
+  block=512     Set the block size for the disk to 512 bytes
+  block=1024    Set the block size for the disk to 1024 bytes
+  block=2048    Set the block size for the disk to 2048 bytes
index 6f03cc799ae45a57dc87def6449d3c06c4503f12..dae08b4527e20eb6dfdfbc77113d9e7620c21009 100644 (file)
@@ -8,6 +8,19 @@ if you want to format from within Linux.
 
 VFAT MOUNT OPTIONS
 ----------------------------------------------------------------------
+codepage=###  -- Sets the codepage for converting to shortname characters
+                on FAT and VFAT filesystems.  By default, codepage 437
+                is used.  This is the default for the U.S. and some
+                European countries.
+iocharset=name-- Character set to use for converting between 8 bit characters
+                and 16 bit Unicode characters. Long filenames are stored on
+                disk in Unicode format, but Unix for the most part doesn't
+                know how to deal with Unicode. There is also an option of
+                doing UTF8 translations with the utf8 option.
+utf8         -- UTF8 is the filesystem safe version of Unicode that
+                is used by the console.  It can be be enabled for the
+                filesystem with this option. If 'uni_xlate' gets set,
+                UTF8 gets disabled.
 uni_xlate     -- Translate unhandled Unicode characters to special
                 escaped sequences.  This would let you backup and
                 restore filenames that are created with any Unicode
@@ -31,18 +44,59 @@ nonumtail     -- When creating 8.3 aliases, normally the alias will
                   
 quiet         -- Stops printing certain warning messages.
 
+Explanation of Native Language Support in the VFAT Filesystem
+----------------------------------------------------------------------
+There are two different character sets are needed by the vfat
+filesystem.  The first is the codepage character set.  The codepage is
+the character set that is used to store short filenames on disk.  Its
+mount option is 'codepage=437' which 437 is the codepage number.
+
+Long filenames are stored in Unicode, but since the Linux filesystem
+doesn't deal with 16 bit characters, we need some way of converting
+characters.  There are a couple options of how to do this.  One is to
+use the 'utf8' mount option and I will cover that a bit later.  The
+other is to use the 'iocharset=iso8859-1' mount option where the
+iso8859-1 tells the filesystem which character set is used for input
+and output.  If you are in Russia, you might specify koi8-r here.
+If a Unicode character on disk cannot be mapped to anything in the
+iocharset, it is replaced with a '?'.
+
+The iocharset is used to convert long filenames to and from Unicode.
+It is currently implemented.  The codepage is used to convert short
+filenames to and from the iocharset.  This translation is not currently
+implemented.
+
+If no iocharset is specified and the default is unable to be loaded,
+the mount will succeed while falling back to doing no conversions at
+all.  If a charset is explicity specified and the charset cannot be
+loaded, the mount will fail.
+
+For the codepage, the default mount option is 'codepage=437'.  If a
+codepage is explicitly asked for and the load of the character set
+fails, the mount will fail.  Is no codepage is explicitly asked for
+and the load of the character set fails, the load will still succeed.
+
+UTF8 is an 8 bit, filesystem safe representation of Unicode.  It does
+not lose any information in the conversion.  However, you need to have
+a terminal or a program that knows how to deal with UTF8.  The Linux
+console can be put into a mode where it will correctly display UTF8
+characters.  I don't know if there is a similar mode for xterms, but
+I don't believe there is.  More information about UTF8 can be found
+at http://www.unicode.com
 
 TODO
 ----------------------------------------------------------------------
-* Need to get rid of the raw scanning stuff.  Instead, always use
-  a get next directory entry approach.  The only thing left that uses
-  raw scanning is the directory renaming code.
+* When only shortnames exist, translate them from the codepage character
+  set to the iocharset.  Currently, translations only occur when longnames
+  exist.  To translate, first convert from codepage to Unicode and then
+  to the output character set.
 
 * Need to add dcache_lookup code msdos filesystem.  This means the
   directories need to be versioned like the vfat filesystem.
 
-* Add support for different codepages.  Right now, we only support
-  the a single English codepage.
+* Need to get rid of the raw scanning stuff.  Instead, always use
+  a get next directory entry approach.  The only thing left that uses
+  raw scanning is the directory renaming code.
 
 * Fix the Posix filesystem support to work in 8.3 space.  This involves
   renaming aliases if a conflict occurs between a new filename and
@@ -55,6 +109,7 @@ POSSIBLE PROBLEMS
 * When a volume name is the same as a directory name in the root
   directory of the filesystem, the directory name sometimes shows
   up empty an empty file.
+* autoconv option does not work correctly.
 
 BUG REPORTS
 ----------------------------------------------------------------------
@@ -194,271 +249,3 @@ the following:
 
 Finally, note that the extended name is stored in Unicode.  Each Unicode
 character takes two bytes.
-
-
-NOTES ON UNICODE TRANSLATION IN VFAT FILESYSTEM
-----------------------------------------------------------------------
-(Information provided by Steve Searle <steve@mgu.bath.ac.uk>)
-
-Char used as   Char(s) used   Char(s) used in     Entries which have
-filename       in shortname   longname slot       been corrected
-0x80 (128)     0x80           0xC7                   
-0x81 (129)     0x9A           0xFC
-0x82 (130)     0x90           0xE9                     E
-0x83 (131)     0xB6           0xE2                     E
-0x84 (132)     0x8E           0xE4                     E
-0x85 (133)     0xB7           0xE0                     E
-0x86 (134)     0x8F           0xE5                     E
-0x87 (135)     0x80           0xE7                     E
-0x88 (136)     0xD2           0xEA                     E
-0x89 (137)     0xD3           0xEB                     E
-0x8A (138)     0xD4           0xE8                     E
-0x8B (139)     0xD8           0xEF                     E
-0x8C (140)     0xD7           0xEE                     E
-0x8D (141)     0xDE           0xEC                     E
-0x8E (142)     0x8E           0xC4                     E
-0x8F (143)     0x8F           0xC5                     E
-0x90 (144)     0x90           0xC9                     E
-0x91 (145)     0x92           0xE6                     E
-0x92 (146)     0x92           0xC6                     E
-0x93 (147)     0xE2           0xF4                     E
-0x94 (148)     0x99           0xF6
-0x95 (149)     0xE3           0xF2
-0x96 (150)     0xEA           0xFB
-0x97 (151)     0xEB           0xF9
-0x98 (152)     "_~1"          0xFF
-0x99 (153)     0x99           0xD6
-0x9A (154)     0x9A           0xDC
-0x9B (155)     0x9D           0xF8
-0x9C (156)     0x9C           0xA3
-0x9D (157)     0x9D           0xD8
-0x9E (158)     0x9E           0xD7
-0x9F (159)     0x9F           0x92
-0xA0 (160)     0xB5           0xE1
-0xA1 (161)     0xD6           0xE0
-0xA2 (162)     0xE0           0xF3
-0xA3 (163)     0xE9           0xFA
-0xA4 (164)     0xA5           0xF1
-0xA5 (165)     0xA5           0xD1
-0xA6 (166)     0xA6           0xAA
-0xA7 (167)     0xA7           0xBA
-0xA8 (168)     0xA8           0xBF
-0xA9 (169)     0xA9           0xAE
-0xAA (170)     0xAA           0xAC
-0xAB (171)     0xAB           0xBD
-0xAC (172)     0xAC           0xBC
-0xAD (173)     0xAD           0xA1
-0xAE (174)     0xAE           0xAB
-0xAF (175)     0xAF           0xBB
-0xB0 (176)     0xB0           0x91 0x25
-0xB1 (177)     0xB1           0x92 0x25
-0xB2 (178)     0xB2           0x93 0x25
-0xB3 (179)     0xB3           0x02 0x25
-0xB4 (180)     0xB4           0x24 0x25
-0xB5 (181)     0xB5           0xC1
-0xB6 (182)     0xB6           0xC2
-0xB7 (183)     0xB7           0xC0
-0xB8 (184)     0xB8           0xA9
-0xB9 (185)     0xB9           0x63 0x25
-0xBA (186)     0xBA           0x51 0x25
-0xBB (187)     0xBB           0x57 0x25
-0xBC (188)     0xBC           0x5D 0x25
-0xBD (189)     0xBD           0xA2
-0xBE (190)     0xBE           0xA5
-0xBF (191)     0xBF           0x10 0x25
-0xC0 (192)     0xC0           0x14 0x25
-0xC1 (193)     0xC1           0x34 0x25
-0xC2 (194)     0xC2           0x2C 0x25
-0xC3 (195)     0xC3           0x1C 0x25
-0xC4 (196)     0xC4           0x00 0x25
-0xC5 (197)     0xC5           0x3C 0x25
-0xC6 (198)     0xC7           0xE3                     E
-0xC7 (199)     0xC7           0xC3
-0xC8 (200)     0xC8           0x5A 0x25                E
-0xC9 (201)     0xC9           0x54 0x25                E
-0xCA (202)     0xCA           0x69 0x25                E
-0xCB (203)     0xCB           0x66 0x25                E
-0xCC (204)     0xCC           0x60 0x25                E
-0xCD (205)     0xCD           0x50 0x25                E
-0xCE (206)     0xCE           0x6C 0x25                E
-0xCF (207)     0xCF           0xA4                     E
-0xD0 (208)     0xD1           0xF0
-0xD1 (209)     0xD1           0xD0
-0xD2 (210)     0xD2           0xCA
-0xD3 (211)     0xD3           0xCB
-0xD4 (212)     0xD4           0xC8
-0xD5 (213)     0x49           0x31 0x01
-0xD6 (214)     0xD6           0xCD
-0xD7 (215)     0xD7           0xCE
-0xD8 (216)     0xD8           0xCF
-0xD9 (217)     0xD9           0x18 0x25
-0xDA (218)     0xDA           0x0C 0x25
-0xDB (219)     0xDB           0x88 0x25
-0xDC (220)     0xDC           0x84 0x25
-0xDD (221)     0xDD           0xA6
-0xDE (222)     0xDE           0xCC
-0xDF (223)     0xDF           0x80 0x25
-0xE0 (224)     0xE0           0xD3
-0xE1 (225)     0xE1           0xDF
-0xE2 (226)     0xE2           0xD4
-0xE3 (227)     0xE3           0xD2
-0xE4 (228)     0x05           0xF5
-0xE5 (229)     0x05           0xD5
-0xE6 (230)     0xE6           0xB5
-0xE7 (231)     0xE8           0xFE
-0xE8 (232)     0xE8           0xDE
-0xE9 (233)     0xE9           0xDA
-0xEA (234)     0xEA           0xDB
-0xEB (235)     0xEB           0xD9
-0xEC (236)     0xED           0xFD
-0xED (237)     0xED           0xDD
-0xEE (238)     0xEE           0xAF
-0xEF (239)     0xEF           0xB4
-0xF0 (240)     0xF0           0xAD
-0xF1 (241)     0xF1           0xB1
-0xF2 (242)     0xF2           0x17 0x20
-0xF3 (243)     0xF3           0xBE
-0xF4 (244)     0xF4           0xB6
-0xF5 (245)     0xF5           0xA7
-0xF6 (246)     0xF6           0xF7
-0xF7 (247)     0xF7           0xB8
-0xF8 (248)     0xF8           0xB0
-0xF9 (249)     0xF9           0xA8
-0xFA (250)     0xFA           0xB7
-0xFB (251)     0xFB           0xB9
-0xFC (252)     0xFC           0xB3
-0xFD (253)     0xFD           0xB2
-0xFE (254)     0xFE           0xA0 0x25
-0xFF (255)     0xFF           0xA0
-
-
-Page 0
-0x80 (128)     0x00
-0x81 (129)     0x00
-0x82 (130)     0x00
-0x83 (131)     0x00
-0x84 (132)     0x00
-0x85 (133)     0x00
-0x86 (134)     0x00
-0x87 (135)     0x00
-0x88 (136)     0x00
-0x89 (137)     0x00
-0x8A (138)     0x00
-0x8B (139)     0x00
-0x8C (140)     0x00
-0x8D (141)     0x00
-0x8E (142)     0x00
-0x8F (143)     0x00
-0x90 (144)     0x00
-0x91 (145)     0x00
-0x92 (146)     0x00
-0x93 (147)     0x00
-0x94 (148)     0x00
-0x95 (149)     0x00
-0x96 (150)     0x00
-0x97 (151)     0x00
-0x98 (152)     0x00
-0x99 (153)     0x00
-0x9A (154)     0x00
-0x9B (155)     0x00
-0x9C (156)     0x00
-0x9D (157)     0x00
-0x9E (158)     0x00
-0x9F (159)     0x92
-0xA0 (160)     0xFF
-0xA1 (161)     0xAD
-0xA2 (162)     0xBD
-0xA3 (163)     0x9C
-0xA4 (164)     0xCF
-0xA5 (165)     0xBE
-0xA6 (166)     0xDD
-0xA7 (167)     0xF5
-0xA8 (168)     0xF9
-0xA9 (169)     0xB8
-0xAA (170)     0x00
-0xAB (171)     0xAE
-0xAC (172)     0xAA
-0xAD (173)     0xF0
-0xAE (174)     0x00
-0xAF (175)     0xEE
-0xB0 (176)     0xF8
-0xB1 (177)     0xF1
-0xB2 (178)     0xFD
-0xB3 (179)     0xFC
-0xB4 (180)     0xEF
-0xB5 (181)     0xE6
-0xB6 (182)     0xF4
-0xB7 (183)     0xFA
-0xB8 (184)     0xF7
-0xB9 (185)     0xFB
-0xBA (186)     0x00
-0xBB (187)     0xAF
-0xBC (188)     0xAC
-0xBD (189)     0xAB
-0xBE (190)     0xF3
-0xBF (191)     0x00
-0xC0 (192)     0xB7
-0xC1 (193)     0xB5
-0xC2 (194)     0xB6
-0xC3 (195)     0xC7
-0xC4 (196)     0x8E
-0xC5 (197)     0x8F
-0xC6 (198)     0x92
-0xC7 (199)     0x80
-0xC8 (200)     0xD4
-0xC9 (201)     0x90
-0xCA (202)     0xD2
-0xCB (203)     0xD3
-0xCC (204)     0xDE
-0xCD (205)     0xD6
-0xCE (206)     0xD7
-0xCF (207)     0xD8
-0xD0 (208)     0x00
-0xD1 (209)     0xA5
-0xD2 (210)     0xE3
-0xD3 (211)     0xE0
-0xD4 (212)     0xE2
-0xD5 (213)     0xE5
-0xD6 (214)     0x99
-0xD7 (215)     0x9E
-0xD8 (216)     0x9D
-0xD9 (217)     0xEB
-0xDA (218)     0xE9
-0xDB (219)     0xEA
-0xDC (220)     0x9A
-0xDD (221)     0xED
-0xDE (222)     0xE8
-0xDF (223)     0xE1
-0xE0 (224)     0x85, 0xA1
-0xE1 (225)     0xA0
-0xE2 (226)     0x83
-0xE3 (227)     0xC6
-0xE4 (228)     0x84
-0xE5 (229)     0x86
-0xE6 (230)     0x91
-0xE7 (231)     0x87
-0xE8 (232)     0x8A
-0xE9 (233)     0x82
-0xEA (234)     0x88
-0xEB (235)     0x89
-0xEC (236)     0x8D
-0xED (237)     0x00
-0xEE (238)     0x8C
-0xEF (239)     0x8B
-0xF0 (240)     0xD0
-0xF1 (241)     0xA4
-0xF2 (242)     0x95
-0xF3 (243)     0xA2
-0xF4 (244)     0x93
-0xF5 (245)     0xE4
-0xF6 (246)     0x94
-0xF7 (247)     0xF6
-0xF8 (248)     0x9B
-0xF9 (249)     0x97
-0xFA (250)     0xA3
-0xFB (251)     0x96
-0xFC (252)     0x81
-0xFD (253)     0xEC
-0xFE (254)     0xE7
-0xFF (255)     0x98
-
index 5300782c5d95eb0cb2c1863a5607e2069b7acb9b..413eb9c421994bfd1bb03bc8c39b2f4bfe162d66 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@ CPP   =$(CC) -E
 AR     =$(CROSS_COMPILE)ar
 NM     =$(CROSS_COMPILE)nm
 STRIP  =$(CROSS_COMPILE)strip
-MAKE   =make
+MAKE   =make -j3
 
 all:   do-it-all
 
index 9f33eeaa45afe87be8031aec32651c73d053adeb..118edbd92557ff425e85f233de0d3af2d3c34aaf 100644 (file)
@@ -146,6 +146,7 @@ CONFIG_SCSI_QLOGIC_ISP=y
 CONFIG_NETDEVICES=y
 CONFIG_DUMMY=m
 # CONFIG_EQUALIZER is not set
+# CONFIG_DLCI is not set
 # CONFIG_PLIP is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
@@ -161,6 +162,7 @@ CONFIG_DE4X5=y
 # CONFIG_DEC_ELCP is not set
 # CONFIG_DGRS is not set
 # CONFIG_NET_POCKET is not set
+# CONFIG_GIGAETHER is not set
 # CONFIG_TR is not set
 # CONFIG_FDDI is not set
 # CONFIG_ARCNET is not set
index b568a45b0e8547ed0a0601d31b23c8cb3c88d9f0..1e6d733934e37903201effebfafcc2e2cf937d0b 100644 (file)
@@ -101,6 +101,7 @@ CONFIG_SKB_LARGE=y
 CONFIG_NETDEVICES=y
 CONFIG_DUMMY=m
 # CONFIG_EQUALIZER is not set
+# CONFIG_DLCI is not set
 # CONFIG_PLIP is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
@@ -116,6 +117,7 @@ CONFIG_EL3=y
 # CONFIG_NET_ISA is not set
 # CONFIG_NET_EISA is not set
 # CONFIG_NET_POCKET is not set
+# CONFIG_GIGAETHER is not set
 # CONFIG_TR is not set
 # CONFIG_FDDI is not set
 # CONFIG_ARCNET is not set
index e3e5209f4b7b91b11310053fafb24ab0825d5e03..c1d7390564d0a4fbc4e7dc03bf73861fa5eab80f 100644 (file)
@@ -2,6 +2,7 @@
 /* By Ross Biro 1/23/92 */
 /* edited by Linus Torvalds */
 
+#include <linux/config.h> /* CONFIG_MATH_EMULATION */
 #include <linux/head.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -416,60 +417,6 @@ static unsigned long get_fpreg_word(struct task_struct *child,
        return tmp;
 }
 
-void safe_wake_up_process(struct task_struct * p)
-{
-       struct desc_struct * d;
-       unsigned long limit;
-
-       void check(int index, int mask, int value) {
-               unsigned long selector, limit;
-
-               if (!p) return;
-
-               selector = get_stack_long(p, sizeof(long)*index - MAGICNUMBER);
-               if (selector & 4) {
-                       d = p->ldt;
-                       if (d) limit = get_limit(p->tss.ldt); else limit = 0;
-               } else {
-                       d = gdt;
-                       limit = 8 * 8;
-               }
-
-               if ((selector & 0xFFF8) >= limit) {
-                       d = NULL;
-                       force_sig(SIGSEGV, p); p = NULL;
-               } else {
-                       d += selector >> 3;
-                       if ((d->b & mask) != value ||
-                           (d->b >> 13) < (selector & 3)) {
-                               force_sig(SIGSEGV, p); p = NULL;
-                       }
-               }
-       }
-
-       check(DS, 0x9800, 0x9000); /* Allow present data segments only */
-       check(ES, 0x9800, 0x9000);
-       check(FS, 0x9800, 0x9000);
-       check(GS, 0x9800, 0x9000);
-       check(SS, 0x9A00, 0x9200); /* Stack segment should not be read-only */
-       check(CS, 0x9800, 0x9800); /* Allow present code segments only */
-
-       if (!p) return;
-
-       if (d) {
-               limit = (d->a & 0xFFFF) | (d->b & 0xF0000);
-               if (d->b & 0x800000) {
-                       limit <<= 12; limit |= 0xFFF;
-               }
-
-               if (get_stack_long(p, sizeof(long)*EIP - MAGICNUMBER) > limit) {
-                       force_sig(SIGSEGV, p); return;
-               }
-       }
-
-       wake_up_process(p);
-}
-
 asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 {
        struct task_struct *child;
@@ -663,7 +610,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
                        else
                                child->flags &= ~PF_TRACESYS;
                        child->exit_code = data;
-                       safe_wake_up_process(child);
+                       wake_up_process(child);
        /* make sure the single step bit is not set. */
                        tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) & ~TRAP_FLAG;
                        put_stack_long(child, sizeof(long)*EFL-MAGICNUMBER,tmp);
@@ -696,8 +643,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
                        child->flags &= ~PF_TRACESYS;
                        tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) | TRAP_FLAG;
                        put_stack_long(child, sizeof(long)*EFL-MAGICNUMBER,tmp);
+                       wake_up_process(child);
                        child->exit_code = data;
-                       safe_wake_up_process(child);
        /* give it a chance to run. */
                        return 0;
                }
@@ -708,8 +655,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
                        if ((unsigned long) data > NSIG)
                                return -EIO;
                        child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+                       wake_up_process(child);
                        child->exit_code = data;
-                       safe_wake_up_process(child);
                        REMOVE_LINKS(child);
                        child->p_pptr = child->p_opptr;
                        SET_LINKS(child);
index 274080167faf838e8f7819dd131c997c6b951373..b5544a69a42c6660beb3142d2205582839b038d1 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/ptrace.h>
 #include <linux/unistd.h>
 
-#include <asm/system.h>
 #include <asm/segment.h>
 
 #define _S(nr) (1<<((nr)-1))
@@ -81,40 +80,13 @@ static void restore_i387(struct _fpstate *buf)
 asmlinkage int sys_sigreturn(unsigned long __unused)
 {
 #define COPY(x) regs->x = context.x
-#define CHECK_DATA(x, mask, value) \
-__asm__("larw %0,%%ax\n\t" \
-       "jnz asm_badframe\n\t" \
-       "andl $" mask ",%%eax\n\t" \
-       "cmpl $" value ",%%eax\n\t" \
-       "jne asm_badframe" \
-       : \
-       : "g" (context.x) \
-       : "ax", "cc");
-#define CHECK_CODE(x, y) \
-__asm__("larw %0,%%ax\n\t" \
-       "jnz asm_badframe\n\t" \
-       "andl $0x9800,%%eax\n\t" \
-       "cmpl $0x9800,%%eax\n\t" /* Allow present code segments only */ \
-       "jne asm_badframe\n\t" \
-       "lsll %0,%%eax\n\t" \
-       "cmp %1,%%eax\n\t" /* Check context.eip against the segment limit */ \
-       "jb asm_badframe" \
-       : \
-       : "g" (context.x), "g" (context.y) \
-       : "ax", "cc");
 #define COPY_SEG(x) \
-CHECK_DATA(x, "0x9800", "0x9000") /* Allow present data segments only */ \
 if (   (context.x & 0xfffc)     /* not a NULL selectors */ \
     && (context.x & 0x4) != 0x4 /* not a LDT selector */ \
     && (context.x & 3) != 3     /* not a RPL3 GDT selector */ \
    ) goto badframe; COPY(x);
-#define COPY_STACK(x) \
-CHECK_DATA(x, "0x9A00", "0x9200") /* Stack segment should not be read-only */ \
+#define COPY_SEG_STRICT(x) \
 if (!(context.x & 0xfffc) || (context.x & 3) != 3) goto badframe; COPY(x);
-#define COPY_CODE(x, y) \
-CHECK_CODE(x, y) \
-if (!(context.x & 0xfffc) || (context.x & 3) != 3) goto badframe; \
-COPY(x); COPY(y);
        struct sigcontext_struct context;
        struct pt_regs * regs;
 
@@ -127,8 +99,9 @@ COPY(x); COPY(y);
        COPY_SEG(es);
        COPY_SEG(fs);
        COPY_SEG(gs);
-       COPY_STACK(ss);
-       COPY_CODE(cs, eip);
+       COPY_SEG_STRICT(ss);
+       COPY_SEG_STRICT(cs);
+       COPY(eip);
        COPY(ecx); COPY(edx);
        COPY(ebx);
        COPY(esp); COPY(ebp);
@@ -147,11 +120,6 @@ badframe:
        do_exit(SIGSEGV);
 }
 
-void asm_badframe(void)
-{
-       do_exit(SIGSEGV);
-}
-
 static inline struct _fpstate * save_i387_hard(struct _fpstate * buf)
 {
 #ifdef __SMP__
index 6f330b0529740f370e0870cd2e070e6920b15b8f..0087bb9c0fa385868329123844b5bf86f1664772 100644 (file)
@@ -9,6 +9,7 @@
  * bootup setup stuff..
  */
 
+#include <linux/config.h> /* CONFIG_BLK_DEV_RAM */
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 6cabb54fb4643481fda72ea8ccfbc92f665209c8..ddfd532179af6982e07ce3b62852c1e35d289cb8 100644 (file)
@@ -1980,7 +1980,7 @@ cdrom_read_block (ide_drive_t *drive, int format, int lba, int nblocks,
        pc.c[7] = ((nblocks>>8) & 0xff);
        pc.c[6] = ((nblocks>>16) & 0xff);
        if (format <= 1)
-               pc.c[9] = 0xf0;
+               pc.c[9] = 0xf8;
        else
                pc.c[9] = 0x10;
 
@@ -2409,7 +2409,7 @@ int ide_cdrom_ioctl (ide_drive_t *drive, struct inode *inode,
                kfree (buf);
                return stat;
        }
-
+       case CDROMREADRAW:
        case CDROMREADMODE1:
        case CDROMREADMODE2: {
                struct cdrom_msf msf;
@@ -2420,10 +2420,13 @@ int ide_cdrom_ioctl (ide_drive_t *drive, struct inode *inode,
                if (cmd == CDROMREADMODE1) {
                        blocksize = CD_FRAMESIZE;
                        format = 2;
-               } else {
-                       blocksize = CD_FRAMESIZE_RAW0;
-                       format = 3;
-               }
+               } else if (cmd == CDROMREADMODE2) {
+                               blocksize = CD_FRAMESIZE_RAW0;
+                               format = 3;
+                      } else {
+                               blocksize = CD_FRAMESIZE_RAW;
+                               format = 0;             
+                      }
 
                stat = verify_area (VERIFY_WRITE, (char *)arg, blocksize);
                if (stat) return stat;
@@ -2434,16 +2437,16 @@ int ide_cdrom_ioctl (ide_drive_t *drive, struct inode *inode,
                                  msf.cdmsf_sec0,
                                  msf.cdmsf_frame0);
        
-               /* Make sure the TOC is up to date. */
-               stat = cdrom_read_toc (drive, NULL);
+               /* DON'T make sure the TOC is up to date. */
+            /* stat = cdrom_read_toc (drive, NULL);
                if (stat) return stat;
 
                toc = drive->cdrom_info.toc;
 
                if (lba < 0 || lba >= toc->capacity)
-                       return -EINVAL;
+                       return -EINVAL; */
 
-               buf = (char *) kmalloc (CD_FRAMESIZE_RAW0, GFP_KERNEL);
+               buf = (char *) kmalloc (CD_FRAMESIZE_RAW, GFP_KERNEL);
                if (buf == NULL)
                        return -ENOMEM;
 
index d9b52af4f3b91b4528c6f1cdddd49a789b620e81..50a6bc67b251eadb7efe5f994c79b9c6c7ea3552 100644 (file)
@@ -561,7 +561,7 @@ int psaux_init(void)
 #ifdef MODULE
 int init_module(void)
 {
-       return psaux_init(); /*?? Bjorn */
+       return psaux_init(); /*??  Bjorn */
 }
 
 void cleanup_module(void)
index 2104168a27dc0d94c573a957b6fed908dcf208b3..ab0ed7f2fe0b30f505c8446f089c120534661c09 100644 (file)
  * Eastlake, Steve Crocker, and Jeff Schiller.
  */
 
+#include <linux/config.h> /* CONFIG_RST_COOKIES and CONFIG_SYN_COOKIES */
 #include <linux/utsname.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
index fbc3fd9e4c72e77910ae2002612b53bd33f029d3..3157979114732ec62f39e142c9e84c5268dde73b 100644 (file)
 
 /* ----------------------------------------------------------------------- */
 
+#include <linux/config.h> /* CONFIG_INET and CONFIG_SCC_* */
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <asm/segment.h>
 #include <asm/bitops.h>
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <time.h>
 #include <linux/kernel.h>
 #include <linux/proc_fs.h>
 
index 8c64e4c9613c0cbb2b264479ba56a35d7253f0a3..7b4c751f6ec9766a7cdf4496c020982d22510d7f 100644 (file)
@@ -1170,6 +1170,7 @@ static void change_speed(struct async_struct *info)
        int     quot = 0;
        unsigned cflag,cval,fcr;
        int     i;
+       unsigned long flags;
 
        if (!info->tty || !info->tty->termios)
                return;
@@ -1208,15 +1209,15 @@ static void change_speed(struct async_struct *info)
        if (quot) {
                info->MCR |= UART_MCR_DTR;
                info->MCR_noint |= UART_MCR_DTR;
-               cli();
+               save_flags(flags); cli();
                serial_out(info, UART_MCR, info->MCR);
-               sti();
+               restore_flags(flags);
        } else {
                info->MCR &= ~UART_MCR_DTR;
                info->MCR_noint &= ~UART_MCR_DTR;
-               cli();
+               save_flags(flags); cli();
                serial_out(info, UART_MCR, info->MCR);
-               sti();
+               restore_flags(flags);
                return;
        }
        /* byte size and parity */
@@ -1302,13 +1303,13 @@ static void change_speed(struct async_struct *info)
                                UART_LSR_PE | UART_LSR_FE;
                }
        }
-       cli();
+       save_flags(flags); cli();
        serial_outp(info, UART_LCR, cval | UART_LCR_DLAB);      /* set DLAB */
        serial_outp(info, UART_DLL, quot & 0xff);       /* LS of divisor */
        serial_outp(info, UART_DLM, quot >> 8);         /* MS of divisor */
        serial_outp(info, UART_LCR, cval);              /* reset DLAB */
        serial_outp(info, UART_FCR, fcr);       /* set fcr */
-       sti();
+       restore_flags(flags);
 }
 
 static void rs_put_char(struct tty_struct *tty, unsigned char ch)
index 3b2292f7767d0f43c070aae2f81deeb294c7f547..db1c198a31ddc1aa4a76e8782d1ced8ad2dd87fb 100644 (file)
@@ -69,7 +69,7 @@
  */
 
 #include <linux/module.h>
-
+#include <linux/config.h> /* CONFIG_SPECIALIX_RTSCTS */
 #include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index b3c25cd2af9fc333606ac1a0762947470f71dee3..4adf3fb5bb9f8bfbdc715ee39670f1e352ad179e 100644 (file)
@@ -25,6 +25,7 @@
  * Initial revision
  *
  */
+#include <linux/config.h> /* CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON */
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
index 6ce4fb06e5a8ed02c1a8193af19f9f19c8438762..951f06f258f81f1d191eeab1cb207de49917e9b0 100644 (file)
@@ -1,6 +1,5 @@
 #include <linux/module.h>
 #include <linux/version.h>
-#include <stdio.h>
 #include <linux/errno.h>
 #include <asm/segment.h>
 #include <asm/io.h>
index 1b68ae94b818f9d30c99f8fc18209eb0a52d10b5..791c44a9cc63e8ed7074538a6f460769ca6bc39a 100644 (file)
@@ -207,6 +207,7 @@ static int ne_probe_pci(struct device *dev)
        for (i = 0; pci_clone_list[i].vendor != 0; i++) {
                unsigned char pci_bus, pci_device_fn;
                unsigned int pci_ioaddr;
+               u16 pci_command, new_command;
                int pci_index;
                
                for (pci_index = 0; pci_index < 8; pci_index++) {
@@ -228,6 +229,20 @@ static int ne_probe_pci(struct device *dev)
                if (pci_irq_line == 0) continue;        /* Try next PCI ID */
                printk("ne.c: PCI BIOS reports NE 2000 clone at i/o %#x, irq %d.\n",
                                pci_ioaddr, pci_irq_line);
+
+               pcibios_read_config_word(pci_bus, pci_device_fn, 
+                                       PCI_COMMAND, &pci_command);
+
+               /* Activate the card: fix for brain-damaged Win98 BIOSes. */
+               new_command = pci_command | PCI_COMMAND_IO;
+               if (pci_command != new_command) {
+                       printk(KERN_INFO "  The PCI BIOS has not enabled this"
+                               " NE2k clone!  Updating PCI command %4.4x->%4.4x.\n",
+                                       pci_command, new_command);
+                       pcibios_write_config_word(pci_bus, pci_device_fn,
+                                       PCI_COMMAND, new_command);
+               }
+
                if (ne_probe1(dev, pci_ioaddr) != 0) {  /* Shouldn't happen. */
                        printk(KERN_ERR "ne.c: Probe of PCI card at %#x failed.\n", pci_ioaddr);
                        pci_irq_line = 0;
@@ -422,9 +437,10 @@ static int ne_probe1(struct device *dev, int ioaddr)
     }
     
     /* Snarf the interrupt now.  There's no point in waiting since we cannot
-       share and the board will usually be enabled. */
+       share (with ISA cards) and the board will usually be enabled. */
     {
-       int irqval = request_irq(dev->irq, ei_interrupt, 0, name, NULL);
+       int irqval = request_irq(dev->irq, ei_interrupt,
+                       pci_irq_line ? SA_SHIRQ : 0, name, dev);
        if (irqval) {
            printk (" unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval);
            return EAGAIN;
@@ -732,6 +748,7 @@ static struct device dev_ne[MAX_NE_CARDS] = {
 
 static int io[MAX_NE_CARDS] = { 0, };
 static int irq[MAX_NE_CARDS]  = { 0, };
+static int bad[MAX_NE_CARDS]  = { 0, };
 
 /* This is set up so that no autoprobe takes place. We can't guarantee
 that the ne2k probe is the last 8390 based probe to take place (as it
@@ -749,6 +766,7 @@ init_module(void)
                dev->irq = irq[this_dev];
                dev->base_addr = io[this_dev];
                dev->init = ne_probe;
+               dev->mem_end = bad[this_dev];
                if (register_netdev(dev) == 0) {
                        found++;
                        continue;
index 77c68434995ba4c5ffd54a77b0b9aad49dda7b8e..b027c8661abdc3fde4ce845e82f1c52e67192fcf 100644 (file)
@@ -73,7 +73,6 @@
 #include <linux/version.h>
 #endif
 
-#include <stdlib.h>
 #include <asm/system.h>
 #include <asm/segment.h>
 #include <asm/bitops.h>
index 9119be7f39137bad65bc7992ac4269156b59cae4..b81756cc851ff4a3b0cb58477fd4a617aae160da 100644 (file)
@@ -6,8 +6,7 @@
 
   This program is free software; you may redistribute and/or modify it under
   the terms of the GNU General Public License Version 2 as published by the
-  Free Software Foundation, provided that none of the source code or runtime
-  copyright notices are removed or modified.
+  Free Software Foundation.
 
   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
 */
 
 
-#define BusLogic_DriverVersion         "2.0.10"
-#define BusLogic_DriverDate            "11 August 1997"
+#define BusLogic_DriverVersion         "2.0.11"
+#define BusLogic_DriverDate            "31 January 1998"
 
 
+#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/blkdev.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
-#include <linux/kernel_stat.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/stat.h>
 #include <linux/bios32.h>
 #include <asm/dma.h>
 #include <asm/io.h>
+#include <asm/irq.h>
 #include <asm/system.h>
 #include "scsi.h"
 #include "hosts.h"
 #include "sd.h"
 #include "BusLogic.h"
+#include "FlashPoint.c"
 
 
 /*
-  BusLogic_CommandLineEntryCount is a count of the number of "BusLogic="
-  entries provided on the Linux Kernel Command Line.
+  BusLogic_DriverOptionsCount is a count of the number of BusLogic Driver
+  Options specifications provided via the Linux Kernel Command Line or via
+  the Loadable Kernel Module Installation Facility.
 */
 
 static int
-  BusLogic_CommandLineEntryCount =     0;
+  BusLogic_DriverOptionsCount =                        0;
 
 
 /*
-  BusLogic_CommandLineEntries is an array of Command Line Entry structures
-  representing the "BusLogic=" entries provided on the Linux Kernel Command
-  Line.
+  BusLogic_DriverOptions is an array of Driver Options structures representing
+  BusLogic Driver Options specifications provided via the Linux Kernel Command
+  Line or via the Loadable Kernel Module Installation Facility.
 */
 
-static BusLogic_CommandLineEntry_T
-  BusLogic_CommandLineEntries[BusLogic_MaxHostAdapters];
+static BusLogic_DriverOptions_T
+  BusLogic_DriverOptions[BusLogic_MaxHostAdapters];
+
+
+/*
+  BusLogic_Options can be assigned a string by the Loadable Kernel Module
+  Installation Facility to be parsed for BusLogic Driver Options
+  specifications.
+*/
+
+static char
+  *BusLogic_Options =                          NULL;
 
 
 /*
@@ -77,7 +89,7 @@ static BusLogic_CommandLineEntry_T
 */
 
 static BusLogic_ProbeOptions_T
-  BusLogic_ProbeOptions =              { 0 };
+  BusLogic_ProbeOptions =                      { 0 };
 
 
 /*
@@ -86,7 +98,17 @@ static BusLogic_ProbeOptions_T
 */
 
 static BusLogic_GlobalOptions_T
-  BusLogic_GlobalOptions =             { 0 };
+  BusLogic_GlobalOptions =                     { 0 };
+
+
+/*
+  BusLogic_FirstRegisteredHostAdapter and BusLogic_LastRegisteredHostAdapter
+  are pointers to the first and last registered BusLogic Host Adapters.
+*/
+
+static BusLogic_HostAdapter_T
+  *BusLogic_FirstRegisteredHostAdapter =       NULL,
+  *BusLogic_LastRegisteredHostAdapter =                NULL;
 
 
 /*
@@ -99,11 +121,11 @@ static BusLogic_HostAdapter_T
 
 
 /*
-  BusLogic_ProbeInfoCount is the numbers of entries in BusLogic_ProbeInfoList.
+  BusLogic_ProbeInfoCount is the number of entries in BusLogic_ProbeInfoList.
 */
 
 static int
-  BusLogic_ProbeInfoCount =            0;
+  BusLogic_ProbeInfoCount =                    0;
 
 
 /*
@@ -114,7 +136,7 @@ static int
 */
 
 static BusLogic_ProbeInfo_T
-  BusLogic_ProbeInfoList[BusLogic_MaxHostAdapters] =   { { 0 } };
+  *BusLogic_ProbeInfoList =                    NULL;
 
 
 /*
@@ -133,8 +155,8 @@ static char
 */
 
 static BusLogic_CCB_T
-  *BusLogic_FirstCompletedCCB =                NULL,
-  *BusLogic_LastCompletedCCB =         NULL;
+  *BusLogic_FirstCompletedCCB =                        NULL,
+  *BusLogic_LastCompletedCCB =                 NULL;
 
 
 /*
@@ -181,6 +203,17 @@ const char *BusLogic_DriverInfo(SCSI_Host_T *Host)
 
 static void BusLogic_RegisterHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
 {
+  HostAdapter->NextAll = NULL;
+  if (BusLogic_FirstRegisteredHostAdapter == NULL)
+    {
+      BusLogic_FirstRegisteredHostAdapter = HostAdapter;
+      BusLogic_LastRegisteredHostAdapter = HostAdapter;
+    }
+  else
+    {
+      BusLogic_LastRegisteredHostAdapter->NextAll = HostAdapter;
+      BusLogic_LastRegisteredHostAdapter = HostAdapter;
+    }
   HostAdapter->Next = NULL;
   if (BusLogic_RegisteredHostAdapters[HostAdapter->IRQ_Channel] != NULL)
     {
@@ -202,14 +235,33 @@ static void BusLogic_RegisterHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
 
 static void BusLogic_UnregisterHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
 {
+  if (HostAdapter == BusLogic_FirstRegisteredHostAdapter)
+    {
+      BusLogic_FirstRegisteredHostAdapter =
+       BusLogic_FirstRegisteredHostAdapter->NextAll;
+      if (HostAdapter == BusLogic_LastRegisteredHostAdapter)
+       BusLogic_LastRegisteredHostAdapter = NULL;
+    }
+  else
+    {
+      BusLogic_HostAdapter_T *PreviousHostAdapter =
+       BusLogic_FirstRegisteredHostAdapter;
+      while (PreviousHostAdapter != NULL &&
+            PreviousHostAdapter->NextAll != HostAdapter)
+       PreviousHostAdapter = PreviousHostAdapter->NextAll;
+      if (PreviousHostAdapter != NULL)
+       PreviousHostAdapter->NextAll = HostAdapter->NextAll;
+    }
+  HostAdapter->NextAll = NULL;
   if (BusLogic_RegisteredHostAdapters[HostAdapter->IRQ_Channel] != HostAdapter)
     {
-      BusLogic_HostAdapter_T *LastHostAdapter =
+      BusLogic_HostAdapter_T *PreviousHostAdapter =
        BusLogic_RegisteredHostAdapters[HostAdapter->IRQ_Channel];
-      while (LastHostAdapter != NULL && LastHostAdapter->Next != HostAdapter)
-       LastHostAdapter = LastHostAdapter->Next;
-      if (LastHostAdapter != NULL)
-       LastHostAdapter->Next = HostAdapter->Next;
+      while (PreviousHostAdapter != NULL &&
+            PreviousHostAdapter->Next != HostAdapter)
+       PreviousHostAdapter = PreviousHostAdapter->Next;
+      if (PreviousHostAdapter != NULL)
+       PreviousHostAdapter->Next = HostAdapter->Next;
     }
   else BusLogic_RegisteredHostAdapters[HostAdapter->IRQ_Channel] =
         HostAdapter->Next;
@@ -218,85 +270,33 @@ static void BusLogic_UnregisterHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
 
 
 /*
-  BusLogic_CreateMailboxes allocates the Outgoing and Incoming Mailboxes for
-  Host Adapter.
-*/
-
-static boolean BusLogic_CreateMailboxes(BusLogic_HostAdapter_T *HostAdapter)
-{
-  /*
-    FlashPoint Host Adapters do not use Outgoing and Incoming Mailboxes.
-  */
-  if (BusLogic_FlashPointHostAdapterP(HostAdapter)) return true;
-  /*
-    Allocate space for the Outgoing and Incoming Mailboxes.
-  */
-  HostAdapter->FirstOutgoingMailbox =
-    (BusLogic_OutgoingMailbox_T *)
-      scsi_init_malloc(HostAdapter->MailboxCount
-                      * (sizeof(BusLogic_OutgoingMailbox_T)
-                         + sizeof(BusLogic_IncomingMailbox_T)),
-                      (HostAdapter->BounceBuffersRequired
-                       ? GFP_ATOMIC | GFP_DMA
-                       : GFP_ATOMIC));
-  if (HostAdapter->FirstOutgoingMailbox == NULL)
-    {
-      BusLogic_Error("UNABLE TO ALLOCATE MAILBOXES - DETACHING\n",
-                    HostAdapter, HostAdapter->HostNumber);
-      return false;
-    }
-  HostAdapter->LastOutgoingMailbox =
-    HostAdapter->FirstOutgoingMailbox + HostAdapter->MailboxCount - 1;
-  HostAdapter->FirstIncomingMailbox =
-    (BusLogic_IncomingMailbox_T *) (HostAdapter->LastOutgoingMailbox + 1);
-  HostAdapter->LastIncomingMailbox =
-    HostAdapter->FirstIncomingMailbox + HostAdapter->MailboxCount - 1;
-  return true;
-}
-
-
-/*
-  BusLogic_DestroyMailboxes deallocates the Outgoing and Incoming Mailboxes
-  for Host Adapter.
+  BusLogic_InitializeCCBs initializes a group of Command Control Blocks (CCBs)
+  for Host Adapter from the BlockSize bytes located at BlockPointer.  The newly
+  created CCBs are added to Host Adapter's free list.
 */
 
-static void BusLogic_DestroyMailboxes(BusLogic_HostAdapter_T *HostAdapter)
+static void BusLogic_InitializeCCBs(BusLogic_HostAdapter_T *HostAdapter,
+                                   void *BlockPointer, int BlockSize)
 {
-  if (HostAdapter->FirstOutgoingMailbox == NULL) return;
-  scsi_init_free((char *) HostAdapter->FirstOutgoingMailbox,
-                HostAdapter->MailboxCount
-                * (sizeof(BusLogic_OutgoingMailbox_T)
-                   + sizeof(BusLogic_IncomingMailbox_T)));
-}
-
-
-/*
-  BusLogic_CreateCCB allocates and initializes a single Command Control
-  Block (CCB) for Host Adapter, and adds it to Host Adapter's free list.
-*/
-
-static boolean BusLogic_CreateCCB(BusLogic_HostAdapter_T *HostAdapter)
-{
-  BusLogic_CCB_T *CCB = (BusLogic_CCB_T *)
-    scsi_init_malloc(sizeof(BusLogic_CCB_T),
-                    (HostAdapter->BounceBuffersRequired
-                     ? GFP_ATOMIC | GFP_DMA
-                     : GFP_ATOMIC));
-  if (CCB == NULL) return false;
-  memset(CCB, 0, sizeof(BusLogic_CCB_T));
-  CCB->HostAdapter = HostAdapter;
-  CCB->Status = BusLogic_CCB_Free;
-  if (BusLogic_FlashPointHostAdapterP(HostAdapter))
+  BusLogic_CCB_T *CCB = (BusLogic_CCB_T *) BlockPointer;
+  memset(BlockPointer, 0, BlockSize);
+  CCB->AllocationGroupHead = true;
+  while ((BlockSize -= sizeof(BusLogic_CCB_T)) >= 0)
     {
-      CCB->CallbackFunction = BusLogic_QueueCompletedCCB;
-      CCB->BaseAddress = HostAdapter->IO_Address;
+      CCB->Status = BusLogic_CCB_Free;
+      CCB->HostAdapter = HostAdapter;
+      if (BusLogic_FlashPointHostAdapterP(HostAdapter))
+       {
+         CCB->CallbackFunction = BusLogic_QueueCompletedCCB;
+         CCB->BaseAddress = HostAdapter->FlashPointInfo.BaseAddress;
+       }
+      CCB->Next = HostAdapter->Free_CCBs;
+      CCB->NextAll = HostAdapter->All_CCBs;
+      HostAdapter->Free_CCBs = CCB;
+      HostAdapter->All_CCBs = CCB;
+      HostAdapter->AllocatedCCBs++;
+      CCB++;
     }
-  CCB->Next = HostAdapter->Free_CCBs;
-  CCB->NextAll = HostAdapter->All_CCBs;
-  HostAdapter->Free_CCBs = CCB;
-  HostAdapter->All_CCBs = CCB;
-  HostAdapter->AllocatedCCBs++;
-  return true;
 }
 
 
@@ -306,14 +306,21 @@ static boolean BusLogic_CreateCCB(BusLogic_HostAdapter_T *HostAdapter)
 
 static boolean BusLogic_CreateInitialCCBs(BusLogic_HostAdapter_T *HostAdapter)
 {
-  int Allocated;
-  for (Allocated = 0; Allocated < HostAdapter->InitialCCBs; Allocated++)
-    if (!BusLogic_CreateCCB(HostAdapter))
-      {
-       BusLogic_Error("UNABLE TO ALLOCATE CCB %d - DETACHING\n",
-                      HostAdapter, Allocated);
-       return false;
-      }
+  int BlockSize = BusLogic_CCB_AllocationGroupSize * sizeof(BusLogic_CCB_T);
+  while (HostAdapter->AllocatedCCBs < HostAdapter->InitialCCBs)
+    {
+      void *BlockPointer = kmalloc(BlockSize,
+                                  (HostAdapter->BounceBuffersRequired
+                                   ? GFP_ATOMIC | GFP_DMA
+                                   : GFP_ATOMIC));
+      if (BlockPointer == NULL)
+       {
+         BusLogic_Error("UNABLE TO ALLOCATE CCB GROUP - DETACHING\n",
+                        HostAdapter);
+         return false;
+       }
+      BusLogic_InitializeCCBs(HostAdapter, BlockPointer, BlockSize);
+    }
   return true;
 }
 
@@ -330,7 +337,8 @@ static void BusLogic_DestroyCCBs(BusLogic_HostAdapter_T *HostAdapter)
   while ((CCB = NextCCB) != NULL)
     {
       NextCCB = CCB->NextAll;
-      scsi_init_free((char *) CCB, sizeof(BusLogic_CCB_T));
+      if (CCB->AllocationGroupHead)
+       kfree(CCB);
     }
 }
 
@@ -346,18 +354,35 @@ static void BusLogic_CreateAdditionalCCBs(BusLogic_HostAdapter_T *HostAdapter,
                                          int AdditionalCCBs,
                                          boolean SuccessMessageP)
 {
-  int Allocated;
+  int BlockSize = BusLogic_CCB_AllocationGroupSize * sizeof(BusLogic_CCB_T);
+  int PreviouslyAllocated = HostAdapter->AllocatedCCBs;
   if (AdditionalCCBs <= 0) return;
-  for (Allocated = 0; Allocated < AdditionalCCBs; Allocated++)
-    if (!BusLogic_CreateCCB(HostAdapter)) break;
-  if (Allocated > 0 && SuccessMessageP)
-    BusLogic_Notice("Allocated %d additional CCBs (total now %d)\n",
-                   HostAdapter, Allocated, HostAdapter->AllocatedCCBs);
-  if (Allocated > 0) return;
+  while (HostAdapter->AllocatedCCBs - PreviouslyAllocated < AdditionalCCBs)
+    {
+      void *BlockPointer = kmalloc(BlockSize,
+                                  (HostAdapter->BounceBuffersRequired
+                                   ? GFP_ATOMIC | GFP_DMA
+                                   : GFP_ATOMIC));
+      if (BlockPointer == NULL) break;
+      BusLogic_InitializeCCBs(HostAdapter, BlockPointer, BlockSize);
+    }
+  if (HostAdapter->AllocatedCCBs > PreviouslyAllocated)
+    {
+      if (SuccessMessageP)
+       BusLogic_Notice("Allocated %d additional CCBs (total now %d)\n",
+                       HostAdapter,
+                       HostAdapter->AllocatedCCBs - PreviouslyAllocated,
+                       HostAdapter->AllocatedCCBs);
+      return;
+    }
   BusLogic_Notice("Failed to allocate additional CCBs\n", HostAdapter);
-  HostAdapter->DriverQueueDepth =
-    HostAdapter->AllocatedCCBs - (HostAdapter->MaxTargetDevices - 1);
-  HostAdapter->SCSI_Host->can_queue = HostAdapter->DriverQueueDepth;
+  if (HostAdapter->DriverQueueDepth >
+      HostAdapter->AllocatedCCBs - HostAdapter->TargetDeviceCount)
+    {
+      HostAdapter->DriverQueueDepth =
+       HostAdapter->AllocatedCCBs - HostAdapter->TargetDeviceCount;
+      HostAdapter->SCSI_Host->can_queue = HostAdapter->DriverQueueDepth;
+    }
 }
 
 
@@ -412,47 +437,6 @@ static void BusLogic_DeallocateCCB(BusLogic_CCB_T *CCB)
 }
 
 
-/*
-  BusLogic_CreateTargetDeviceStatistics creates the Target Device Statistics
-  structure for Host Adapter.
-*/
-
-static boolean BusLogic_CreateTargetDeviceStatistics(BusLogic_HostAdapter_T
-                                                    *HostAdapter)
-{
-  HostAdapter->TargetDeviceStatistics =
-    (BusLogic_TargetDeviceStatistics_T *)
-      scsi_init_malloc(HostAdapter->MaxTargetDevices
-                      * sizeof(BusLogic_TargetDeviceStatistics_T),
-                      GFP_ATOMIC);
-  if (HostAdapter->TargetDeviceStatistics == NULL)
-    {
-      BusLogic_Error("UNABLE TO ALLOCATE TARGET DEVICE STATISTICS - "
-                    "DETACHING\n", HostAdapter, HostAdapter->HostNumber);
-      return false;
-    }
-  memset(HostAdapter->TargetDeviceStatistics, 0,
-        HostAdapter->MaxTargetDevices
-        * sizeof(BusLogic_TargetDeviceStatistics_T));
-  return true;
-}
-
-
-/*
-  BusLogic_DestroyTargetDeviceStatistics destroys the Target Device Statistics
-  structure for Host Adapter.
-*/
-
-static void BusLogic_DestroyTargetDeviceStatistics(BusLogic_HostAdapter_T
-                                                  *HostAdapter)
-{
-  if (HostAdapter->TargetDeviceStatistics == NULL) return;
-  scsi_init_free((char *) HostAdapter->TargetDeviceStatistics,
-                HostAdapter->MaxTargetDevices
-                * sizeof(BusLogic_TargetDeviceStatistics_T));
-}
-
-
 /*
   BusLogic_Command sends the command OperationCode to HostAdapter, optionally
   providing ParameterLength bytes of ParameterData and receiving at most
@@ -494,7 +478,7 @@ static int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter,
     If the IRQ Channel has not yet been acquired, then interrupts must be
     disabled while issuing host adapter commands since a Command Complete
     interrupt could occur if the IRQ Channel was previously enabled by another
-    BusLogic Host Adapter or other driver sharing the same IRQ Channel.
+    BusLogic Host Adapter or another driver sharing the same IRQ Channel.
   */
   if (!HostAdapter->IRQ_ChannelAcquired)
     {
@@ -572,7 +556,7 @@ static int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter,
          Result = -1;
          goto Done;
        }
-      if (BusLogic_GlobalOptions.Bits.TraceConfiguration)
+      if (BusLogic_GlobalOptions.TraceConfiguration)
        BusLogic_Notice("BusLogic_Command(%02X) Status = %02X: "
                        "(Modify I/O Address)\n", HostAdapter,
                        OperationCode, StatusRegister.All);
@@ -607,9 +591,11 @@ static int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter,
       if (InterruptRegister.Bits.CommandComplete) break;
       if (HostAdapter->HostAdapterCommandCompleted) break;
       if (StatusRegister.Bits.DataInRegisterReady)
-       if (++ReplyBytes <= ReplyLength)
-         *ReplyPointer++ = BusLogic_ReadDataInRegister(HostAdapter);
-       else BusLogic_ReadDataInRegister(HostAdapter);
+       {
+         if (++ReplyBytes <= ReplyLength)
+           *ReplyPointer++ = BusLogic_ReadDataInRegister(HostAdapter);
+         else BusLogic_ReadDataInRegister(HostAdapter);
+       }
       if (OperationCode == BusLogic_FetchHostAdapterLocalRAM &&
          StatusRegister.Bits.HostAdapterReady) break;
       udelay(100);
@@ -620,15 +606,6 @@ static int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter,
       Result = -2;
       goto Done;
     }
-  /*
-    If testing Command Complete Interrupts, wait a short while in case the
-    loop immediately above terminated due to the Command Complete bit being
-    set in the Interrupt Register, but the interrupt hasn't actually been
-    processed yet.  Otherwise, acknowledging the interrupt here could prevent
-    the interrupt test from succeeding.
-  */
-  if (OperationCode == BusLogic_TestCommandCompleteInterrupt)
-    udelay(10000);
   /*
     Clear any pending Command Complete Interrupt.
   */
@@ -636,19 +613,18 @@ static int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter,
   /*
     Provide tracing information if requested.
   */
-  if (BusLogic_GlobalOptions.Bits.TraceConfiguration)
-    if (OperationCode != BusLogic_TestCommandCompleteInterrupt)
-      {
-       int i;
-       BusLogic_Notice("BusLogic_Command(%02X) Status = %02X: %2d ==> %2d:",
-                       HostAdapter, OperationCode,
-                       StatusRegister.All, ReplyLength, ReplyBytes);
-       if (ReplyLength > ReplyBytes) ReplyLength = ReplyBytes;
-       for (i = 0; i < ReplyLength; i++)
-         BusLogic_Notice(" %02X", HostAdapter,
-                         ((unsigned char *) ReplyData)[i]);
-       BusLogic_Notice("\n", HostAdapter);
-      }
+  if (BusLogic_GlobalOptions.TraceConfiguration)
+    {
+      int i;
+      BusLogic_Notice("BusLogic_Command(%02X) Status = %02X: %2d ==> %2d:",
+                     HostAdapter, OperationCode,
+                     StatusRegister.All, ReplyLength, ReplyBytes);
+      if (ReplyLength > ReplyBytes) ReplyLength = ReplyBytes;
+      for (i = 0; i < ReplyLength; i++)
+       BusLogic_Notice(" %02X", HostAdapter,
+                       ((unsigned char *) ReplyData)[i]);
+      BusLogic_Notice("\n", HostAdapter);
+    }
   /*
     Process Command Invalid conditions.
   */
@@ -704,39 +680,64 @@ Done:
 }
 
 
+/*
+  BusLogic_AppendProbeAddressISA appends a single ISA I/O Address to the list
+  of I/O Address and Bus Probe Information to be checked for potential BusLogic
+  Host Adapters.
+*/
+
+static void BusLogic_AppendProbeAddressISA(BusLogic_IO_Address_T IO_Address)
+{
+  BusLogic_ProbeInfo_T *ProbeInfo;
+  if (BusLogic_ProbeInfoCount >= BusLogic_MaxHostAdapters) return;
+  ProbeInfo = &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount++];
+  ProbeInfo->HostAdapterType = BusLogic_MultiMaster;
+  ProbeInfo->HostAdapterBusType = BusLogic_ISA_Bus;
+  ProbeInfo->IO_Address = IO_Address;
+}
+
+
 /*
   BusLogic_InitializeProbeInfoListISA initializes the list of I/O Address and
   Bus Probe Information to be checked for potential BusLogic SCSI Host Adapters
   only from the list of standard BusLogic MultiMaster ISA I/O Addresses.
 */
 
-static void BusLogic_InitializeProbeInfoListISA(void)
+static void BusLogic_InitializeProbeInfoListISA(BusLogic_HostAdapter_T
+                                               *PrototypeHostAdapter)
 {
-  int StandardAddressIndex;
-  /*
-    If BusLogic_Setup has provided an I/O Address probe list, do not override
-    the Kernel Command Line specifications.
-  */
-  if (BusLogic_ProbeInfoCount > 0) return;
   /*
-    If a Kernel Command Line specification has requested that ISA Bus Probes
+    If BusLogic Driver Options specifications requested that ISA Bus Probes
     be inhibited, do not proceed further.
   */
-  if (BusLogic_ProbeOptions.Bits.NoProbeISA) return;
+  if (BusLogic_ProbeOptions.NoProbeISA) return;
   /*
     Append the list of standard BusLogic MultiMaster ISA I/O Addresses.
   */
-  StandardAddressIndex = 0;
-  while (BusLogic_ProbeInfoCount < BusLogic_MaxHostAdapters &&
-        StandardAddressIndex < BusLogic_ISA_StandardAddressesCount)
-    {
-      BusLogic_ProbeInfo_T *ProbeInfo =
-       &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount++];
-      ProbeInfo->IO_Address =
-       BusLogic_ISA_StandardAddresses[StandardAddressIndex++];
-      ProbeInfo->HostAdapterType = BusLogic_MultiMaster;
-      ProbeInfo->HostAdapterBusType = BusLogic_ISA_Bus;
-    }
+  if (BusLogic_ProbeOptions.LimitedProbeISA
+      ? BusLogic_ProbeOptions.Probe330
+      : check_region(0x330, BusLogic_MultiMasterAddressCount) == 0)
+    BusLogic_AppendProbeAddressISA(0x330);
+  if (BusLogic_ProbeOptions.LimitedProbeISA
+      ? BusLogic_ProbeOptions.Probe334
+      : check_region(0x334, BusLogic_MultiMasterAddressCount) == 0)
+    BusLogic_AppendProbeAddressISA(0x334);
+  if (BusLogic_ProbeOptions.LimitedProbeISA
+      ? BusLogic_ProbeOptions.Probe230
+      : check_region(0x230, BusLogic_MultiMasterAddressCount) == 0)
+    BusLogic_AppendProbeAddressISA(0x230);
+  if (BusLogic_ProbeOptions.LimitedProbeISA
+      ? BusLogic_ProbeOptions.Probe234
+      : check_region(0x234, BusLogic_MultiMasterAddressCount) == 0)
+    BusLogic_AppendProbeAddressISA(0x234);
+  if (BusLogic_ProbeOptions.LimitedProbeISA
+      ? BusLogic_ProbeOptions.Probe130
+      : check_region(0x130, BusLogic_MultiMasterAddressCount) == 0)
+    BusLogic_AppendProbeAddressISA(0x130);
+  if (BusLogic_ProbeOptions.LimitedProbeISA
+      ? BusLogic_ProbeOptions.Probe134
+      : check_region(0x134, BusLogic_MultiMasterAddressCount) == 0)
+    BusLogic_AppendProbeAddressISA(0x134);
 }
 
 
@@ -783,25 +784,26 @@ static void BusLogic_SortProbeInfo(BusLogic_ProbeInfo_T *ProbeInfoList,
   I/O Addresses.  It returns the number of PCI MultiMaster Host Adapters found.
 */
 
-static int BusLogic_InitializeMultiMasterProbeInfo(void)
+static int BusLogic_InitializeMultiMasterProbeInfo(BusLogic_HostAdapter_T
+                                                  *PrototypeHostAdapter)
 {
-  boolean StandardAddressSeen[BusLogic_ISA_StandardAddressesCount];
   BusLogic_ProbeInfo_T *PrimaryProbeInfo =
     &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount];
   int NonPrimaryPCIMultiMasterIndex = BusLogic_ProbeInfoCount + 1;
   int NonPrimaryPCIMultiMasterCount = 0, PCIMultiMasterCount = 0;
   boolean ForceBusDeviceScanningOrder = false;
   boolean ForceBusDeviceScanningOrderChecked = false;
-  unsigned char Bus, DeviceFunction, IRQ_Channel;
+  boolean StandardAddressSeen[6];
+  unsigned char Bus, DeviceFunction;
   unsigned int BaseAddress0, BaseAddress1;
+  unsigned char IRQ_Channel;
   BusLogic_IO_Address_T IO_Address;
   BusLogic_PCI_Address_T PCI_Address;
   unsigned short Index = 0;
-  int StandardAddressIndex, i;
-  if (BusLogic_ProbeInfoCount >= BusLogic_MaxHostAdapters)
-    return 0;
+  int i;
+  if (BusLogic_ProbeInfoCount >= BusLogic_MaxHostAdapters) return 0;
   BusLogic_ProbeInfoCount++;
-  for (i = 0; i < BusLogic_ISA_StandardAddressesCount; i++)
+  for (i = 0; i < 6; i++)
     StandardAddressSeen[i] = false;
   /*
     Iterate over the MultiMaster PCI Host Adapters.  For each enumerated host
@@ -826,8 +828,7 @@ static int BusLogic_InitializeMultiMasterProbeInfo(void)
        pcibios_read_config_byte(Bus, DeviceFunction,
                                 PCI_INTERRUPT_LINE, &IRQ_Channel) == 0)
       {
-       BusLogic_HostAdapter_T HostAdapterPrototype;
-       BusLogic_HostAdapter_T *HostAdapter = &HostAdapterPrototype;
+       BusLogic_HostAdapter_T *HostAdapter = PrototypeHostAdapter;
        BusLogic_PCIHostAdapterInformation_T PCIHostAdapterInformation;
        BusLogic_ModifyIOAddressRequest_T ModifyIOAddressRequest;
        unsigned char Device = DeviceFunction >> 3;
@@ -859,7 +860,7 @@ static int BusLogic_InitializeMultiMasterProbeInfo(void)
                           NULL, Bus, Device, IO_Address);
            continue;
          }
-       if (BusLogic_GlobalOptions.Bits.TraceProbe)
+       if (BusLogic_GlobalOptions.TraceProbe)
          {
            BusLogic_Notice("BusLogic: PCI MultiMaster Host Adapter "
                            "detected at\n", NULL);
@@ -871,7 +872,7 @@ static int BusLogic_InitializeMultiMasterProbeInfo(void)
          Issue the Inquire PCI Host Adapter Information command to determine
          the ISA Compatible I/O Port.  If the ISA Compatible I/O Port is
          known and enabled, note that the particular Standard ISA I/O
-         Address need not be probed.
+         Address should not be probed.
        */
        HostAdapter->IO_Address = IO_Address;
        if (BusLogic_Command(HostAdapter,
@@ -880,8 +881,7 @@ static int BusLogic_InitializeMultiMasterProbeInfo(void)
                             sizeof(PCIHostAdapterInformation))
            == sizeof(PCIHostAdapterInformation))
          {
-           if (PCIHostAdapterInformation.ISACompatibleIOPort <
-               BusLogic_ISA_StandardAddressesCount)
+           if (PCIHostAdapterInformation.ISACompatibleIOPort < 6)
              StandardAddressSeen[PCIHostAdapterInformation
                                  .ISACompatibleIOPort] = true;
          }
@@ -933,10 +933,10 @@ static int BusLogic_InitializeMultiMasterProbeInfo(void)
        */
        if (PCIHostAdapterInformation.ISACompatibleIOPort == BusLogic_IO_330)
          {
-           PrimaryProbeInfo->IO_Address = IO_Address;
-           PrimaryProbeInfo->PCI_Address = PCI_Address;
            PrimaryProbeInfo->HostAdapterType = BusLogic_MultiMaster;
            PrimaryProbeInfo->HostAdapterBusType = BusLogic_PCI_Bus;
+           PrimaryProbeInfo->IO_Address = IO_Address;
+           PrimaryProbeInfo->PCI_Address = PCI_Address;
            PrimaryProbeInfo->Bus = Bus;
            PrimaryProbeInfo->Device = Device;
            PrimaryProbeInfo->IRQ_Channel = IRQ_Channel;
@@ -946,10 +946,10 @@ static int BusLogic_InitializeMultiMasterProbeInfo(void)
          {
            BusLogic_ProbeInfo_T *ProbeInfo =
              &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount++];
-           ProbeInfo->IO_Address = IO_Address;
-           ProbeInfo->PCI_Address = PCI_Address;
            ProbeInfo->HostAdapterType = BusLogic_MultiMaster;
            ProbeInfo->HostAdapterBusType = BusLogic_PCI_Bus;
+           ProbeInfo->IO_Address = IO_Address;
+           ProbeInfo->PCI_Address = PCI_Address;
            ProbeInfo->Bus = Bus;
            ProbeInfo->Device = Device;
            ProbeInfo->IRQ_Channel = IRQ_Channel;
@@ -978,31 +978,48 @@ static int BusLogic_InitializeMultiMasterProbeInfo(void)
     then the Primary I/O Address must be probed explicitly before any PCI
     host adapters are probed.
   */
-  if (PrimaryProbeInfo->IO_Address == 0 &&
-      !BusLogic_ProbeOptions.Bits.NoProbeISA)
-    {
-      PrimaryProbeInfo->IO_Address = BusLogic_ISA_StandardAddresses[0];
-      PrimaryProbeInfo->HostAdapterType = BusLogic_MultiMaster;
-      PrimaryProbeInfo->HostAdapterBusType = BusLogic_ISA_Bus;
-    }
+  if (!BusLogic_ProbeOptions.NoProbeISA)
+    if (PrimaryProbeInfo->IO_Address == 0 &&
+       (BusLogic_ProbeOptions.LimitedProbeISA
+        ? BusLogic_ProbeOptions.Probe330
+        : check_region(0x330, BusLogic_MultiMasterAddressCount) == 0))
+      {
+       PrimaryProbeInfo->HostAdapterType = BusLogic_MultiMaster;
+       PrimaryProbeInfo->HostAdapterBusType = BusLogic_ISA_Bus;
+       PrimaryProbeInfo->IO_Address = 0x330;
+      }
   /*
     Append the list of standard BusLogic MultiMaster ISA I/O Addresses,
     omitting the Primary I/O Address which has already been handled.
   */
-  if (!BusLogic_ProbeOptions.Bits.NoProbeISA)
-    for (StandardAddressIndex = 1;
-        StandardAddressIndex < BusLogic_ISA_StandardAddressesCount;
-        StandardAddressIndex++)
-      if (!StandardAddressSeen[StandardAddressIndex] &&
-         BusLogic_ProbeInfoCount < BusLogic_MaxHostAdapters)
-       {
-         BusLogic_ProbeInfo_T *ProbeInfo =
-           &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount++];
-         ProbeInfo->IO_Address =
-           BusLogic_ISA_StandardAddresses[StandardAddressIndex];
-         ProbeInfo->HostAdapterType = BusLogic_MultiMaster;
-         ProbeInfo->HostAdapterBusType = BusLogic_ISA_Bus;
-       }
+  if (!BusLogic_ProbeOptions.NoProbeISA)
+    {
+      if (!StandardAddressSeen[1] &&
+         (BusLogic_ProbeOptions.LimitedProbeISA
+          ? BusLogic_ProbeOptions.Probe334
+          : check_region(0x334, BusLogic_MultiMasterAddressCount) == 0))
+       BusLogic_AppendProbeAddressISA(0x334);
+      if (!StandardAddressSeen[2] &&
+         (BusLogic_ProbeOptions.LimitedProbeISA
+          ? BusLogic_ProbeOptions.Probe230
+          : check_region(0x230, BusLogic_MultiMasterAddressCount) == 0))
+       BusLogic_AppendProbeAddressISA(0x230);
+      if (!StandardAddressSeen[3] &&
+         (BusLogic_ProbeOptions.LimitedProbeISA
+          ? BusLogic_ProbeOptions.Probe234
+          : check_region(0x234, BusLogic_MultiMasterAddressCount) == 0))
+       BusLogic_AppendProbeAddressISA(0x234);
+      if (!StandardAddressSeen[4] &&
+         (BusLogic_ProbeOptions.LimitedProbeISA
+          ? BusLogic_ProbeOptions.Probe130
+          : check_region(0x130, BusLogic_MultiMasterAddressCount) == 0))
+       BusLogic_AppendProbeAddressISA(0x130);
+      if (!StandardAddressSeen[5] &&
+         (BusLogic_ProbeOptions.LimitedProbeISA
+          ? BusLogic_ProbeOptions.Probe134
+          : check_region(0x134, BusLogic_MultiMasterAddressCount) == 0))
+       BusLogic_AppendProbeAddressISA(0x134);
+    }
   return PCIMultiMasterCount;
 }
 
@@ -1014,11 +1031,13 @@ static int BusLogic_InitializeMultiMasterProbeInfo(void)
   number of FlashPoint Host Adapters found.
 */
 
-static int BusLogic_InitializeFlashPointProbeInfo(void)
+static int BusLogic_InitializeFlashPointProbeInfo(BusLogic_HostAdapter_T
+                                                 *PrototypeHostAdapter)
 {
   int FlashPointIndex = BusLogic_ProbeInfoCount, FlashPointCount = 0;
-  unsigned char Bus, DeviceFunction, IRQ_Channel;
+  unsigned char Bus, DeviceFunction;
   unsigned int BaseAddress0, BaseAddress1;
+  unsigned char IRQ_Channel;
   BusLogic_IO_Address_T IO_Address;
   BusLogic_PCI_Address_T PCI_Address;
   unsigned short Index = 0;
@@ -1065,7 +1084,7 @@ static int BusLogic_InitializeFlashPointProbeInfo(void)
                           NULL, Bus, Device, IO_Address);
            continue;
          }
-       if (BusLogic_GlobalOptions.Bits.TraceProbe)
+       if (BusLogic_GlobalOptions.TraceProbe)
          {
            BusLogic_Notice("BusLogic: FlashPoint Host Adapter "
                            "detected at\n", NULL);
@@ -1077,10 +1096,10 @@ static int BusLogic_InitializeFlashPointProbeInfo(void)
          {
            BusLogic_ProbeInfo_T *ProbeInfo =
              &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount++];
-           ProbeInfo->IO_Address = IO_Address;
-           ProbeInfo->PCI_Address = PCI_Address;
            ProbeInfo->HostAdapterType = BusLogic_FlashPoint;
            ProbeInfo->HostAdapterBusType = BusLogic_PCI_Bus;
+           ProbeInfo->IO_Address = IO_Address;
+           ProbeInfo->PCI_Address = PCI_Address;
            ProbeInfo->Bus = Bus;
            ProbeInfo->Device = Device;
            ProbeInfo->IRQ_Channel = IRQ_Channel;
@@ -1116,44 +1135,41 @@ static int BusLogic_InitializeFlashPointProbeInfo(void)
   FlashPoint and PCI MultiMaster Host Adapters are present, this driver will
   probe for FlashPoint Host Adapters first unless the BIOS primary disk is
   controlled by the first PCI MultiMaster Host Adapter, in which case
-  MultiMaster Host Adapters will be probed first.  The Kernel Command Line
-  options "MultiMasterFirst" and "FlashPointFirst" can be used to force a
-  particular probe order.
+  MultiMaster Host Adapters will be probed first.  The BusLogic Driver Options
+  specifications "MultiMasterFirst" and "FlashPointFirst" can be used to force
+  particular probe order.
 */
 
-static void BusLogic_InitializeProbeInfoList(void)
+static void BusLogic_InitializeProbeInfoList(BusLogic_HostAdapter_T
+                                            *PrototypeHostAdapter)
 {
-  /*
-    If BusLogic_Setup has provided an I/O Address probe list, do not override
-    the Kernel Command Line specifications.
-  */
-  if (BusLogic_ProbeInfoCount > 0) return;
   /*
     If a PCI BIOS is present, interrogate it for MultiMaster and FlashPoint
     Host Adapters; otherwise, default to the standard ISA MultiMaster probe.
   */
-  if (!BusLogic_ProbeOptions.Bits.NoProbePCI && pcibios_present())
+  if (!BusLogic_ProbeOptions.NoProbePCI && pcibios_present())
     {
-      if (BusLogic_ProbeOptions.Bits.ProbeMultiMasterFirst)
+      if (BusLogic_ProbeOptions.MultiMasterFirst)
        {
-         BusLogic_InitializeMultiMasterProbeInfo();
-         BusLogic_InitializeFlashPointProbeInfo();
+         BusLogic_InitializeMultiMasterProbeInfo(PrototypeHostAdapter);
+         BusLogic_InitializeFlashPointProbeInfo(PrototypeHostAdapter);
        }
-      else if (BusLogic_ProbeOptions.Bits.ProbeFlashPointFirst)
+      else if (BusLogic_ProbeOptions.FlashPointFirst)
        {
-         BusLogic_InitializeFlashPointProbeInfo();
-         BusLogic_InitializeMultiMasterProbeInfo();
+         BusLogic_InitializeFlashPointProbeInfo(PrototypeHostAdapter);
+         BusLogic_InitializeMultiMasterProbeInfo(PrototypeHostAdapter);
        }
       else
        {
-         int FlashPointCount = BusLogic_InitializeFlashPointProbeInfo();
-         int PCIMultiMasterCount = BusLogic_InitializeMultiMasterProbeInfo();
+         int FlashPointCount =
+           BusLogic_InitializeFlashPointProbeInfo(PrototypeHostAdapter);
+         int PCIMultiMasterCount =
+           BusLogic_InitializeMultiMasterProbeInfo(PrototypeHostAdapter);
          if (FlashPointCount > 0 && PCIMultiMasterCount > 0)
            {
              BusLogic_ProbeInfo_T *ProbeInfo =
                &BusLogic_ProbeInfoList[FlashPointCount];
-             BusLogic_HostAdapter_T HostAdapterPrototype;
-             BusLogic_HostAdapter_T *HostAdapter = &HostAdapterPrototype;
+             BusLogic_HostAdapter_T *HostAdapter = PrototypeHostAdapter;
              BusLogic_FetchHostAdapterLocalRAMRequest_T
                FetchHostAdapterLocalRAMRequest;
              BusLogic_BIOSDriveMapByte_T Drive0MapByte;
@@ -1195,7 +1211,7 @@ static void BusLogic_InitializeProbeInfoList(void)
            }
        }
     }
-  else BusLogic_InitializeProbeInfoListISA();
+  else BusLogic_InitializeProbeInfoListISA(PrototypeHostAdapter);
 }
 
 
@@ -1240,20 +1256,14 @@ static boolean BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
   */
   if (BusLogic_FlashPointHostAdapterP(HostAdapter))
     {
-      FlashPoint_Info_T *FlashPointInfo = (FlashPoint_Info_T *)
-       scsi_init_malloc(sizeof(FlashPoint_Info_T), GFP_ATOMIC);
-      int Retries = 10;
-      if (FlashPointInfo == NULL)
-       return BusLogic_Failure(HostAdapter, "ALLOCATING FLASHPOINT INFO");
-      FlashPointInfo->BaseAddress = HostAdapter->IO_Address;
+      FlashPoint_Info_T *FlashPointInfo = &HostAdapter->FlashPointInfo;
+      FlashPointInfo->BaseAddress =
+       (BusLogic_Base_Address_T) HostAdapter->IO_Address;
       FlashPointInfo->IRQ_Channel = HostAdapter->IRQ_Channel;
       FlashPointInfo->Present = false;
-      while (!(FlashPoint_ProbeHostAdapter(FlashPointInfo) == 0 &&
-              FlashPointInfo->Present) &&
-            --Retries >= 0) ;
-      if (!FlashPointInfo->Present)
+      if (!(FlashPoint_ProbeHostAdapter(FlashPointInfo) == 0 &&
+           FlashPointInfo->Present))
        {
-         scsi_init_free((char *) FlashPointInfo, sizeof(FlashPoint_Info_T));
          BusLogic_Error("BusLogic: FlashPoint Host Adapter detected at "
                         "PCI Bus %d Device %d\n", HostAdapter,
                         HostAdapter->Bus, HostAdapter->Device);
@@ -1264,8 +1274,7 @@ static boolean BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
                         HostAdapter);
          return false;
        }
-      HostAdapter->FlashPointInfo = FlashPointInfo;
-      if (BusLogic_GlobalOptions.Bits.TraceProbe)
+      if (BusLogic_GlobalOptions.TraceProbe)
        BusLogic_Notice("BusLogic_Probe(0x%X): FlashPoint Found\n",
                        HostAdapter, HostAdapter->IO_Address);
       /*
@@ -1283,7 +1292,7 @@ static boolean BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
   StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter);
   InterruptRegister.All = BusLogic_ReadInterruptRegister(HostAdapter);
   GeometryRegister.All = BusLogic_ReadGeometryRegister(HostAdapter);
-  if (BusLogic_GlobalOptions.Bits.TraceProbe)
+  if (BusLogic_GlobalOptions.TraceProbe)
     BusLogic_Notice("BusLogic_Probe(0x%X): Status 0x%02X, Interrupt 0x%02X, "
                    "Geometry 0x%02X\n", HostAdapter,
                    HostAdapter->IO_Address, StatusRegister.All,
@@ -1318,12 +1327,16 @@ static boolean BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
 
 
 /*
-  BusLogic_HardResetHostAdapter issues a Hard Reset to the Host Adapter,
-  and waits for Host Adapter Diagnostics to complete.
+  BusLogic_HardwareResetHostAdapter issues a Hardware Reset to the Host Adapter
+  and waits for Host Adapter Diagnostics to complete.  If HardReset is true, a
+  Hard Reset is performed which also initiates a SCSI Bus Reset.  Otherwise, a
+  Soft Reset is performed which only resets the Host Adapter without forcing a
+  SCSI Bus Reset.
 */
 
-static boolean BusLogic_HardResetHostAdapter(BusLogic_HostAdapter_T
-                                            *HostAdapter)
+static boolean BusLogic_HardwareResetHostAdapter(BusLogic_HostAdapter_T
+                                                  *HostAdapter,
+                                                boolean HardReset)
 {
   BusLogic_StatusRegister_T StatusRegister;
   int TimeoutCounter;
@@ -1332,9 +1345,11 @@ static boolean BusLogic_HardResetHostAdapter(BusLogic_HostAdapter_T
   */
   if (BusLogic_FlashPointHostAdapterP(HostAdapter))
     {
-      HostAdapter->FlashPointInfo->ReportDataUnderrun = true;
+      FlashPoint_Info_T *FlashPointInfo = &HostAdapter->FlashPointInfo;
+      FlashPointInfo->HostSoftReset = !HardReset;
+      FlashPointInfo->ReportDataUnderrun = true;
       HostAdapter->CardHandle =
-       FlashPoint_HardResetHostAdapter(HostAdapter->FlashPointInfo);
+       FlashPoint_HardwareResetHostAdapter(FlashPointInfo);
       if (HostAdapter->CardHandle == FlashPoint_BadCardHandle) return false;
       /*
        Indicate the Host Adapter Hard Reset completed successfully.
@@ -1342,10 +1357,12 @@ static boolean BusLogic_HardResetHostAdapter(BusLogic_HostAdapter_T
       return true;
     }
   /*
-    Issue a Hard Reset Command to the Host Adapter.  The Host Adapter should
-    respond by setting Diagnostic Active in the Status Register.
+    Issue a Hard Reset or Soft Reset Command to the Host Adapter.  The Host
+    Adapter should respond by setting Diagnostic Active in the Status Register.
   */
-  BusLogic_HardReset(HostAdapter);
+  if (HardReset)
+    BusLogic_HardReset(HostAdapter);
+  else BusLogic_SoftReset(HostAdapter);
   /*
     Wait until Diagnostic Active is set in the Status Register.
   */
@@ -1356,8 +1373,8 @@ static boolean BusLogic_HardResetHostAdapter(BusLogic_HostAdapter_T
       if (StatusRegister.Bits.DiagnosticActive) break;
       udelay(100);
     }
-  if (BusLogic_GlobalOptions.Bits.TraceHardReset)
-    BusLogic_Notice("BusLogic_HardReset(0x%X): Diagnostic Active, "
+  if (BusLogic_GlobalOptions.TraceHardwareReset)
+    BusLogic_Notice("BusLogic_HardwareReset(0x%X): Diagnostic Active, "
                    "Status 0x%02X\n", HostAdapter,
                    HostAdapter->IO_Address, StatusRegister.All);
   if (TimeoutCounter < 0) return false;
@@ -1377,8 +1394,8 @@ static boolean BusLogic_HardResetHostAdapter(BusLogic_HostAdapter_T
       if (!StatusRegister.Bits.DiagnosticActive) break;
       udelay(100);
     }
-  if (BusLogic_GlobalOptions.Bits.TraceHardReset)
-    BusLogic_Notice("BusLogic_HardReset(0x%X): Diagnostic Completed, "
+  if (BusLogic_GlobalOptions.TraceHardwareReset)
+    BusLogic_Notice("BusLogic_HardwareReset(0x%X): Diagnostic Completed, "
                    "Status 0x%02X\n", HostAdapter,
                    HostAdapter->IO_Address, StatusRegister.All);
   if (TimeoutCounter < 0) return false;
@@ -1396,8 +1413,8 @@ static boolean BusLogic_HardResetHostAdapter(BusLogic_HostAdapter_T
        break;
       udelay(100);
     }
-  if (BusLogic_GlobalOptions.Bits.TraceHardReset)
-    BusLogic_Notice("BusLogic_HardReset(0x%X): Host Adapter Ready, "
+  if (BusLogic_GlobalOptions.TraceHardwareReset)
+    BusLogic_Notice("BusLogic_HardwareReset(0x%X): Host Adapter Ready, "
                    "Status 0x%02X\n", HostAdapter,
                    HostAdapter->IO_Address, StatusRegister.All);
   if (TimeoutCounter < 0) return false;
@@ -1447,25 +1464,27 @@ static boolean BusLogic_CheckHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
     Issue the Inquire Configuration command if the IRQ Channel is unknown.
   */
   if (HostAdapter->IRQ_Channel == 0)
-    if (BusLogic_Command(HostAdapter, BusLogic_InquireConfiguration,
-                        NULL, 0, &Configuration, sizeof(Configuration))
-       == sizeof(Configuration))
-      {
-       if (Configuration.IRQ_Channel9)
-         HostAdapter->IRQ_Channel = 9;
-       else if (Configuration.IRQ_Channel10)
-         HostAdapter->IRQ_Channel = 10;
-       else if (Configuration.IRQ_Channel11)
-         HostAdapter->IRQ_Channel = 11;
-       else if (Configuration.IRQ_Channel12)
-         HostAdapter->IRQ_Channel = 12;
-       else if (Configuration.IRQ_Channel14)
-         HostAdapter->IRQ_Channel = 14;
-       else if (Configuration.IRQ_Channel15)
-         HostAdapter->IRQ_Channel = 15;
-       else Result = false;
-      }
-    else Result = false;
+    {
+      if (BusLogic_Command(HostAdapter, BusLogic_InquireConfiguration,
+                          NULL, 0, &Configuration, sizeof(Configuration))
+         == sizeof(Configuration))
+       {
+         if (Configuration.IRQ_Channel9)
+           HostAdapter->IRQ_Channel = 9;
+         else if (Configuration.IRQ_Channel10)
+           HostAdapter->IRQ_Channel = 10;
+         else if (Configuration.IRQ_Channel11)
+           HostAdapter->IRQ_Channel = 11;
+         else if (Configuration.IRQ_Channel12)
+           HostAdapter->IRQ_Channel = 12;
+         else if (Configuration.IRQ_Channel14)
+           HostAdapter->IRQ_Channel = 14;
+         else if (Configuration.IRQ_Channel15)
+           HostAdapter->IRQ_Channel = 15;
+         else Result = false;
+       }
+      else Result = false;
+    }
   /*
     Issue the Inquire Extended Setup Information command.  Only genuine
     BusLogic Host Adapters and true clones support this command.  Adaptec 1542C
@@ -1484,7 +1503,7 @@ static boolean BusLogic_CheckHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
   /*
     Provide tracing information if requested and return.
   */
-  if (BusLogic_GlobalOptions.Bits.TraceProbe)
+  if (BusLogic_GlobalOptions.TraceProbe)
     BusLogic_Notice("BusLogic_Check(0x%X): MultiMaster %s\n", HostAdapter,
                    HostAdapter->IO_Address, (Result ? "Found" : "Not Found"));
   return Result;
@@ -1512,7 +1531,7 @@ static boolean BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T
   BusLogic_GeometryRegister_T GeometryRegister;
   BusLogic_RequestedReplyLength_T RequestedReplyLength;
   unsigned char *TargetPointer, Character;
-  int i;
+  int TargetID, i;
   /*
     Configuration Information for FlashPoint Host Adapters is provided in the
     FlashPoint_Info structure by the FlashPoint SCCB Manager's Probe Function.
@@ -1521,7 +1540,7 @@ static boolean BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T
   */
   if (BusLogic_FlashPointHostAdapterP(HostAdapter))
     {
-      FlashPoint_Info_T *FlashPointInfo = HostAdapter->FlashPointInfo;
+      FlashPoint_Info_T *FlashPointInfo = &HostAdapter->FlashPointInfo;
       TargetPointer = HostAdapter->ModelName;
       *TargetPointer++ = 'B';
       *TargetPointer++ = 'T';
@@ -1550,8 +1569,8 @@ static boolean BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T
       HostAdapter->DriverScatterGatherLimit = BusLogic_ScatterGatherLimit;
       HostAdapter->MaxTargetDevices = (HostAdapter->HostWideSCSI ? 16 : 8);
       HostAdapter->MaxLogicalUnits = 32;
-      HostAdapter->InitialCCBs = 64;
-      HostAdapter->IncrementalCCBs = 16;
+      HostAdapter->InitialCCBs = 4 * BusLogic_CCB_AllocationGroupSize;
+      HostAdapter->IncrementalCCBs = BusLogic_CCB_AllocationGroupSize;
       HostAdapter->DriverQueueDepth = 255;
       HostAdapter->HostAdapterQueueDepth = HostAdapter->DriverQueueDepth;
       HostAdapter->SynchronousPermitted = FlashPointInfo->SynchronousPermitted;
@@ -1698,12 +1717,14 @@ static boolean BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T
   HostAdapter->HostAdapterBusType =
     BusLogic_HostAdapterBusTypes[HostAdapter->ModelName[3] - '4'];
   if (HostAdapter->HostAdapterBusType == BusLogic_ISA_Bus)
-    if (Configuration.DMA_Channel5)
-      HostAdapter->DMA_Channel = 5;
-    else if (Configuration.DMA_Channel6)
-      HostAdapter->DMA_Channel = 6;
-    else if (Configuration.DMA_Channel7)
-      HostAdapter->DMA_Channel = 7;
+    {
+      if (Configuration.DMA_Channel5)
+       HostAdapter->DMA_Channel = 5;
+      else if (Configuration.DMA_Channel6)
+       HostAdapter->DMA_Channel = 6;
+      else if (Configuration.DMA_Channel7)
+       HostAdapter->DMA_Channel = 7;
+    }
   /*
     Determine whether Extended Translation is enabled and save it in
     the Host Adapter structure.
@@ -1837,7 +1858,7 @@ static boolean BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T
   HostAdapter->MaxTargetDevices = (HostAdapter->HostWideSCSI ? 16 : 8);
   HostAdapter->MaxLogicalUnits = (HostAdapter->ExtendedLUNSupport ? 32 : 8);
   /*
-    Select appropriate values for the Driver Queue Depth, Mailbox Count,
+    Select appropriate values for the Mailbox Count, Driver Queue Depth, 
     Initial CCBs, and Incremental CCBs variables based on whether or not Strict
     Round Robin Mode is supported.  If Strict Round Robin Mode is supported,
     then there is no performance degradation in using the maximum possible
@@ -1868,18 +1889,16 @@ static boolean BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T
   if (strcmp(HostAdapter->FirmwareVersion, "3.31") >= 0)
     {
       HostAdapter->StrictRoundRobinModeSupport = true;
-      HostAdapter->MailboxCount = 255;
-      HostAdapter->InitialCCBs = 64;
-      HostAdapter->IncrementalCCBs = 16;
+      HostAdapter->MailboxCount = BusLogic_MaxMailboxes;
     }
   else
     {
       HostAdapter->StrictRoundRobinModeSupport = false;
       HostAdapter->MailboxCount = 32;
-      HostAdapter->InitialCCBs = 32;
-      HostAdapter->IncrementalCCBs = 8;
     }
   HostAdapter->DriverQueueDepth = HostAdapter->MailboxCount;
+  HostAdapter->InitialCCBs = 4 * BusLogic_CCB_AllocationGroupSize;
+  HostAdapter->IncrementalCCBs = BusLogic_CCB_AllocationGroupSize;
   /*
     Tagged Queuing support is available and operates properly on all "W" series
     MultiMaster Host Adapters, on "C" series MultiMaster Host Adapters with
@@ -1931,57 +1950,32 @@ static boolean BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T
   */
 Common:
   /*
-    Initialize the Host Adapter Name and Interrupt Label fields from the
-    Model Name.
+    Initialize the Host Adapter Full Model Name and Interrupt Label fields
+    from the Model Name.
   */
   strcpy(HostAdapter->FullModelName, "BusLogic ");
   strcat(HostAdapter->FullModelName, HostAdapter->ModelName);
   strcpy(HostAdapter->InterruptLabel, HostAdapter->FullModelName);
   /*
     Select an appropriate value for the Tagged Queue Depth either from a
-    Command Line Entry, or based on whether this Host Adapter requires that ISA
-    Bounce Buffers be used.  The Tagged Queue Depth is left at 0 for automatic
-    determination in BusLogic_SelectQueueDepths.  Initialize the Untagged Queue
-    Depth.  Tagged Queuing is disabled by default when the Tagged Queue Depth
-    is 1 since queuing multiple commands is not possible.
-  */
-  if (HostAdapter->CommandLineEntry != NULL &&
-      HostAdapter->CommandLineEntry->TaggedQueueDepth > 0)
-    HostAdapter->TaggedQueueDepth =
-      HostAdapter->CommandLineEntry->TaggedQueueDepth;
-  else if (HostAdapter->BounceBuffersRequired)
-    HostAdapter->TaggedQueueDepth = BusLogic_TaggedQueueDepthBounceBuffers;
-  else HostAdapter->TaggedQueueDepth = BusLogic_TaggedQueueDepthAutomatic;
-  HostAdapter->UntaggedQueueDepth = BusLogic_UntaggedQueueDepth;
-  if (HostAdapter->UntaggedQueueDepth > HostAdapter->TaggedQueueDepth &&
-      HostAdapter->TaggedQueueDepth > 0)
-    HostAdapter->UntaggedQueueDepth = HostAdapter->TaggedQueueDepth;
-  if (HostAdapter->TaggedQueueDepth == 1)
-    HostAdapter->TaggedQueuingPermitted = 0;
-  /*
-    Select an appropriate value for Bus Settle Time either from a Command
-    Line Entry, or from BusLogic_DefaultBusSettleTime.
-  */
-  if (HostAdapter->CommandLineEntry != NULL &&
-      HostAdapter->CommandLineEntry->BusSettleTime > 0)
-    HostAdapter->BusSettleTime = HostAdapter->CommandLineEntry->BusSettleTime;
-  else HostAdapter->BusSettleTime = BusLogic_DefaultBusSettleTime;
-  /*
-    Select an appropriate value for Local Options from a Command Line Entry.
-  */
-  if (HostAdapter->CommandLineEntry != NULL)
-    HostAdapter->LocalOptions = HostAdapter->CommandLineEntry->LocalOptions;
-  /*
-    Select appropriate values for the Error Recovery Strategy array either from
-    a Command Line Entry, or using BusLogic_ErrorRecovery_Default.
+    BusLogic Driver Options specification, or based on whether this Host
+    Adapter requires that ISA Bounce Buffers be used.  The Tagged Queue Depth
+    is left at 0 for automatic determination in BusLogic_SelectQueueDepths.
+    Initialize the Untagged Queue Depth.
   */
-  if (HostAdapter->CommandLineEntry != NULL)
-    memcpy(HostAdapter->ErrorRecoveryStrategy,
-          HostAdapter->CommandLineEntry->ErrorRecoveryStrategy,
-          sizeof(HostAdapter->ErrorRecoveryStrategy));
-  else memset(HostAdapter->ErrorRecoveryStrategy,
-             BusLogic_ErrorRecovery_Default,
-             sizeof(HostAdapter->ErrorRecoveryStrategy));
+  for (TargetID = 0; TargetID < BusLogic_MaxTargetDevices; TargetID++)
+    {
+      unsigned char QueueDepth = 0;
+      if (HostAdapter->DriverOptions != NULL &&
+         HostAdapter->DriverOptions->QueueDepth[TargetID] > 0)
+       QueueDepth = HostAdapter->DriverOptions->QueueDepth[TargetID];
+      else if (HostAdapter->BounceBuffersRequired)
+       QueueDepth = BusLogic_TaggedQueueDepthBB;
+      HostAdapter->QueueDepth[TargetID] = QueueDepth;
+    }
+  if (HostAdapter->BounceBuffersRequired)
+    HostAdapter->UntaggedQueueDepth = BusLogic_UntaggedQueueDepthBB;
+  else HostAdapter->UntaggedQueueDepth = BusLogic_UntaggedQueueDepth;
   /*
     Tagged Queuing is only allowed if Disconnect/Reconnect is permitted.
     Therefore, mask the Tagged Queuing Permitted Default bits with the
@@ -1989,15 +1983,34 @@ Common:
   */
   HostAdapter->TaggedQueuingPermitted &= HostAdapter->DisconnectPermitted;
   /*
-    Combine the default Tagged Queuing Permitted bits with any Command
-    Line Entry Tagged Queuing specification.
+    Combine the default Tagged Queuing Permitted bits with any BusLogic Driver
+    Options Tagged Queuing specification.
   */
-  if (HostAdapter->CommandLineEntry != NULL)
+  if (HostAdapter->DriverOptions != NULL)
     HostAdapter->TaggedQueuingPermitted =
-      (HostAdapter->CommandLineEntry->TaggedQueuingPermitted &
-       HostAdapter->CommandLineEntry->TaggedQueuingPermittedMask) |
+      (HostAdapter->DriverOptions->TaggedQueuingPermitted &
+       HostAdapter->DriverOptions->TaggedQueuingPermittedMask) |
       (HostAdapter->TaggedQueuingPermitted &
-       ~HostAdapter->CommandLineEntry->TaggedQueuingPermittedMask);
+       ~HostAdapter->DriverOptions->TaggedQueuingPermittedMask);
+  /*
+    Select appropriate values for the Error Recovery Strategy array
+    either from a BusLogic Driver Options specification, or using
+    BusLogic_ErrorRecovery_Default.
+  */
+  for (TargetID = 0; TargetID < BusLogic_MaxTargetDevices; TargetID++)
+    if (HostAdapter->DriverOptions != NULL)
+      HostAdapter->ErrorRecoveryStrategy[TargetID] =
+       HostAdapter->DriverOptions->ErrorRecoveryStrategy[TargetID];
+    else HostAdapter->ErrorRecoveryStrategy[TargetID] =
+          BusLogic_ErrorRecovery_Default;
+  /*
+    Select an appropriate value for Bus Settle Time either from a BusLogic
+    Driver Options specification, or from BusLogic_DefaultBusSettleTime.
+  */
+  if (HostAdapter->DriverOptions != NULL &&
+      HostAdapter->DriverOptions->BusSettleTime > 0)
+    HostAdapter->BusSettleTime = HostAdapter->DriverOptions->BusSettleTime;
+  else HostAdapter->BusSettleTime = BusLogic_DefaultBusSettleTime;
   /*
     Indicate reading the Host Adapter Configuration completed successfully.
   */
@@ -2017,7 +2030,8 @@ static boolean BusLogic_ReportHostAdapterConfiguration(BusLogic_HostAdapter_T
   unsigned short SynchronousPermitted, FastPermitted;
   unsigned short UltraPermitted, WidePermitted;
   unsigned short DisconnectPermitted, TaggedQueuingPermitted;
-  boolean CommonSynchronousNegotiation, CommonErrorRecovery;
+  boolean CommonSynchronousNegotiation, CommonTaggedQueueDepth;
+  boolean CommonErrorRecovery;
   char SynchronousString[BusLogic_MaxTargetDevices+1];
   char WideString[BusLogic_MaxTargetDevices+1];
   char DisconnectString[BusLogic_MaxTargetDevices+1];
@@ -2083,22 +2097,26 @@ static boolean BusLogic_ReportHostAdapterConfiguration(BusLogic_HostAdapter_T
          CommonSynchronousNegotiation = true;
        }
       else if (SynchronousPermitted == AllTargetsMask)
-       if (FastPermitted == 0)
-         {
-           SynchronousMessage = "Slow";
-           CommonSynchronousNegotiation = true;
-         }
-       else if (FastPermitted == AllTargetsMask)
-         if (UltraPermitted == 0)
+       {
+         if (FastPermitted == 0)
            {
-             SynchronousMessage = "Fast";
+             SynchronousMessage = "Slow";
              CommonSynchronousNegotiation = true;
            }
-         else if (UltraPermitted == AllTargetsMask)
+         else if (FastPermitted == AllTargetsMask)
            {
-             SynchronousMessage = "Ultra";
-             CommonSynchronousNegotiation = true;
+             if (UltraPermitted == 0)
+               {
+                 SynchronousMessage = "Fast";
+                 CommonSynchronousNegotiation = true;
+               }
+             else if (UltraPermitted == AllTargetsMask)
+               {
+                 SynchronousMessage = "Ultra";
+                 CommonSynchronousNegotiation = true;
+               }
            }
+       }
       if (!CommonSynchronousNegotiation)
        {
          for (TargetID = 0;
@@ -2175,9 +2193,20 @@ static boolean BusLogic_ReportHostAdapterConfiguration(BusLogic_HostAdapter_T
                     HostAdapter, HostAdapter->DriverQueueDepth,
                     HostAdapter->DriverScatterGatherLimit);
   BusLogic_Info("  Tagged Queue Depth: ", HostAdapter);
-  if (HostAdapter->TaggedQueueDepth > 0)
-    BusLogic_Info("%d", HostAdapter, HostAdapter->TaggedQueueDepth);
-  else BusLogic_Info("Automatic", HostAdapter);
+  CommonTaggedQueueDepth = true;
+  for (TargetID = 1; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
+    if (HostAdapter->QueueDepth[TargetID] != HostAdapter->QueueDepth[0])
+      {
+       CommonTaggedQueueDepth = false;
+       break;
+      }
+  if (CommonTaggedQueueDepth)
+    {
+      if (HostAdapter->QueueDepth[0] > 0)
+       BusLogic_Info("%d", HostAdapter, HostAdapter->QueueDepth[0]);
+      else BusLogic_Info("Automatic", HostAdapter);
+    }
+  else BusLogic_Info("Individual", HostAdapter);
   BusLogic_Info(", Untagged Queue Depth: %d\n", HostAdapter,
                HostAdapter->UntaggedQueueDepth);
   CommonErrorRecovery = true;
@@ -2313,50 +2342,6 @@ static void BusLogic_ReleaseResources(BusLogic_HostAdapter_T *HostAdapter)
 }
 
 
-/*
-  BusLogic_TestInterrupts tests for proper functioning of the Host Adapter
-  Interrupt Register and that interrupts generated by the Host Adapter are
-  getting through to the Interrupt Handler.  A large proportion of initial
-  problems with installing PCI Host Adapters are due to configuration problems
-  where either the Host Adapter or Motherboard is configured incorrectly, and
-  interrupts do not get through as a result.
-*/
-
-static boolean BusLogic_TestInterrupts(BusLogic_HostAdapter_T *HostAdapter)
-{
-  unsigned int InitialInterruptCount, FinalInterruptCount;
-  int TestCount = 5, i;
-  /*
-    FlashPoint Host Adapters do not provide for an interrupt test.
-  */
-  if (BusLogic_FlashPointHostAdapterP(HostAdapter)) return true;
-  /*
-    Inhibit the Interrupt Test if requested.
-  */
-  if (HostAdapter->LocalOptions.Bits.InhibitInterruptTest) return true;
-  /*
-    Issue the Test Command Complete Interrupt commands.
-  */
-  InitialInterruptCount = kstat.interrupts[HostAdapter->IRQ_Channel];
-  for (i = 0; i < TestCount; i++)
-    BusLogic_Command(HostAdapter, BusLogic_TestCommandCompleteInterrupt,
-                    NULL, 0, NULL, 0);
-  FinalInterruptCount = kstat.interrupts[HostAdapter->IRQ_Channel];
-  /*
-    Verify that BusLogic_InterruptHandler was called at least TestCount
-    times.  Shared IRQ Channels could cause more than TestCount interrupts to
-    occur, but there should never be fewer than TestCount, unless one or more
-    interrupts were lost.
-  */
-  if (FinalInterruptCount < InitialInterruptCount + TestCount)
-    return BusLogic_Failure(HostAdapter, "HOST ADAPTER INTERRUPT TEST");
-  /*
-    Indicate the Host Adapter Interrupt Test completed successfully.
-  */
-  return true;
-}
-
-
 /*
   BusLogic_InitializeHostAdapter initializes Host Adapter.  This is the only
   function called during SCSI Host Adapter detection which modifies the state
@@ -2376,19 +2361,30 @@ static boolean BusLogic_InitializeHostAdapter(BusLogic_HostAdapter_T
     for each Target Device.
   */
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-    HostAdapter->BusDeviceResetPendingCCB[TargetID] = NULL;
-  memset(HostAdapter->TaggedQueuingActive, false,
-        sizeof(HostAdapter->TaggedQueuingActive));
-  memset(HostAdapter->CommandSuccessfulFlag, false,
-        sizeof(HostAdapter->CommandSuccessfulFlag));
-  memset(HostAdapter->ActiveCommands, 0,
-        sizeof(HostAdapter->ActiveCommands));
-  memset(HostAdapter->CommandsSinceReset, 0,
-        sizeof(HostAdapter->CommandsSinceReset));
+    {
+      HostAdapter->BusDeviceResetPendingCCB[TargetID] = NULL;
+      HostAdapter->TargetFlags[TargetID].TaggedQueuingActive = false;
+      HostAdapter->TargetFlags[TargetID].CommandSuccessfulFlag = false;
+      HostAdapter->ActiveCommands[TargetID] = 0;
+      HostAdapter->CommandsSinceReset[TargetID] = 0;
+    }
   /*
     FlashPoint Host Adapters do not use Outgoing and Incoming Mailboxes.
   */
   if (BusLogic_FlashPointHostAdapterP(HostAdapter)) goto Done;
+  /*
+    Initialize the Outgoing and Incoming Mailbox pointers.
+  */
+  HostAdapter->FirstOutgoingMailbox =
+    (BusLogic_OutgoingMailbox_T *) HostAdapter->MailboxSpace;
+  HostAdapter->LastOutgoingMailbox =
+    HostAdapter->FirstOutgoingMailbox + HostAdapter->MailboxCount - 1;
+  HostAdapter->NextOutgoingMailbox = HostAdapter->FirstOutgoingMailbox;
+  HostAdapter->FirstIncomingMailbox =
+    (BusLogic_IncomingMailbox_T *) (HostAdapter->LastOutgoingMailbox + 1);
+  HostAdapter->LastIncomingMailbox =
+    HostAdapter->FirstIncomingMailbox + HostAdapter->MailboxCount - 1;
+  HostAdapter->NextIncomingMailbox = HostAdapter->FirstIncomingMailbox;
   /*
     Initialize the Outgoing and Incoming Mailbox structures.
   */
@@ -2396,11 +2392,6 @@ static boolean BusLogic_InitializeHostAdapter(BusLogic_HostAdapter_T
         HostAdapter->MailboxCount * sizeof(BusLogic_OutgoingMailbox_T));
   memset(HostAdapter->FirstIncomingMailbox, 0,
         HostAdapter->MailboxCount * sizeof(BusLogic_IncomingMailbox_T));
-  /*
-    Initialize the pointers to the Next Mailboxes.
-  */
-  HostAdapter->NextOutgoingMailbox = HostAdapter->FirstOutgoingMailbox;
-  HostAdapter->NextIncomingMailbox = HostAdapter->FirstIncomingMailbox;
   /*
     Initialize the Host Adapter's Pointer to the Outgoing/Incoming Mailboxes.
   */
@@ -2442,11 +2433,14 @@ static boolean BusLogic_InitializeHostAdapter(BusLogic_HostAdapter_T
     Announce Successful Initialization.
   */
 Done:
-  if (HostAdapter->HostAdapterInitialized)
-    BusLogic_Warning("*** %s Initialized Successfully ***\n",
-                    HostAdapter, HostAdapter->FullModelName);
-  else BusLogic_Info("*** %s Initialized Successfully ***\n",
-                    HostAdapter, HostAdapter->FullModelName);
+  if (!HostAdapter->HostAdapterInitialized)
+    {
+      BusLogic_Info("*** %s Initialized Successfully ***\n",
+                   HostAdapter, HostAdapter->FullModelName);
+      BusLogic_Info("\n", HostAdapter);
+    }
+  else BusLogic_Warning("*** %s Initialized Successfully ***\n",
+                       HostAdapter, HostAdapter->FullModelName);
   HostAdapter->HostAdapterInitialized = true;
   /*
     Indicate the Host Adapter Initialization completed successfully.
@@ -2457,7 +2451,7 @@ Done:
 
 /*
   BusLogic_TargetDeviceInquiry inquires about the Target Devices accessible
-  through Host Adapter and reports on the results.
+  through Host Adapter.
 */
 
 static boolean BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T
@@ -2468,7 +2462,7 @@ static boolean BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T
   BusLogic_SetupInformation_T SetupInformation;
   BusLogic_SynchronousPeriod_T SynchronousPeriod;
   BusLogic_RequestedReplyLength_T RequestedReplyLength;
-  int TargetDevicesFound = 0, TargetID;
+  int TargetID;
   /*
     Wait a few seconds between the Host Adapter Hard Reset which initiates
     a SCSI Bus Reset and issuing any SCSI Commands.  Some SCSI devices get
@@ -2480,13 +2474,11 @@ static boolean BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T
   */
   if (BusLogic_FlashPointHostAdapterP(HostAdapter)) return true;
   /*
-    Inhibit the Target Devices Inquiry if requested.
+    Inhibit the Target Device Inquiry if requested.
   */
-  if (HostAdapter->LocalOptions.Bits.InhibitTargetInquiry)
-    {
-      BusLogic_Info("  Target Device Inquiry Inhibited\n", HostAdapter);
-      return true;
-    }
+  if (HostAdapter->DriverOptions != NULL &&
+      HostAdapter->DriverOptions->LocalOptions.InhibitTargetInquiry)
+    return true;
   /*
     Issue the Inquire Target Devices command for host adapters with firmware
     version 4.25 or later, or the Inquire Installed Devices ID 0 to 7 command
@@ -2502,6 +2494,9 @@ static boolean BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T
                           &InstalledDevices, sizeof(InstalledDevices))
          != sizeof(InstalledDevices))
        return BusLogic_Failure(HostAdapter, "INQUIRE TARGET DEVICES");
+      for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
+       HostAdapter->TargetFlags[TargetID].TargetExists =
+         (InstalledDevices & (1 << TargetID) ? true : false);
     }
   else
     {
@@ -2511,10 +2506,9 @@ static boolean BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T
          != sizeof(InstalledDevicesID0to7))
        return BusLogic_Failure(HostAdapter,
                                "INQUIRE INSTALLED DEVICES ID 0 TO 7");
-      InstalledDevices = 0;
       for (TargetID = 0; TargetID < 8; TargetID++)
-       if (InstalledDevicesID0to7[TargetID] != 0)
-         InstalledDevices |= (1 << TargetID);
+       HostAdapter->TargetFlags[TargetID].TargetExists =
+         (InstalledDevicesID0to7[TargetID] != 0 ? true : false);
     }
   /*
     Issue the Inquire Setup Information command.
@@ -2525,6 +2519,19 @@ static boolean BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T
                       &SetupInformation, sizeof(SetupInformation))
       != sizeof(SetupInformation))
     return BusLogic_Failure(HostAdapter, "INQUIRE SETUP INFORMATION");
+  for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
+      HostAdapter->SynchronousOffset[TargetID] =
+       (TargetID < 8
+        ? SetupInformation.SynchronousValuesID0to7[TargetID].Offset
+        : SetupInformation.SynchronousValuesID8to15[TargetID-8].Offset);
+  if (strcmp(HostAdapter->FirmwareVersion, "5.06L") >= 0)
+    for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
+      HostAdapter->TargetFlags[TargetID].WideTransfersActive =
+       (TargetID < 8
+        ? (SetupInformation.WideTransfersActiveID0to7 & (1 << TargetID)
+           ? true : false)
+        : (SetupInformation.WideTransfersActiveID8to15 & (1 << (TargetID-8))
+           ? true : false));
   /*
     Issue the Inquire Synchronous Period command.
   */
@@ -2536,69 +2543,96 @@ static boolean BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T
                           &SynchronousPeriod, sizeof(SynchronousPeriod))
          != sizeof(SynchronousPeriod))
        return BusLogic_Failure(HostAdapter, "INQUIRE SYNCHRONOUS PERIOD");
+      for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
+       HostAdapter->SynchronousPeriod[TargetID] = SynchronousPeriod[TargetID];
     }
   else
     for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
       if (SetupInformation.SynchronousValuesID0to7[TargetID].Offset > 0)
-       SynchronousPeriod[TargetID] =
+       HostAdapter->SynchronousPeriod[TargetID] =
          20 + 5 * SetupInformation.SynchronousValuesID0to7[TargetID]
                                   .TransferPeriod;
-      else SynchronousPeriod[TargetID] = 0;
   /*
-    Save the Installed Devices, Synchronous Values, and Synchronous Period
-    information in the Host Adapter structure.
+    Indicate the Target Device Inquiry completed successfully.
+  */
+  return true;
+}
+
+
+/*
+  BusLogic_ReportTargetDeviceInfo reports about the Target Devices accessible
+  through Host Adapter.
+*/
+
+static void BusLogic_ReportTargetDeviceInfo(BusLogic_HostAdapter_T
+                                           *HostAdapter)
+{
+  int TargetID;
+  /*
+    Inhibit the Target Device Inquiry and Reporting if requested.
   */
-  HostAdapter->InstalledDevices = InstalledDevices;
-  memcpy(HostAdapter->SynchronousValues,
-        SetupInformation.SynchronousValuesID0to7,
-        sizeof(BusLogic_SynchronousValues8_T));
-  if (HostAdapter->HostWideSCSI)
-    memcpy(&HostAdapter->SynchronousValues[8],
-          SetupInformation.SynchronousValuesID8to15,
-          sizeof(BusLogic_SynchronousValues8_T));
-  memcpy(HostAdapter->SynchronousPeriod, SynchronousPeriod,
-        sizeof(BusLogic_SynchronousPeriod_T));
+  if (BusLogic_MultiMasterHostAdapterP(HostAdapter) &&
+      HostAdapter->DriverOptions != NULL &&
+      HostAdapter->DriverOptions->LocalOptions.InhibitTargetInquiry)
+    return;
   /*
     Report on the Target Devices found.
   */
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-    if (HostAdapter->InstalledDevices & (1 << TargetID))
-      {
-       int SynchronousPeriod = HostAdapter->SynchronousPeriod[TargetID];
-       if (SynchronousPeriod > 10)
-         {
-           int SynchronousTransferRate = 100000000 / SynchronousPeriod;
-           int RoundedSynchronousTransferRate =
-             (SynchronousTransferRate + 5000) / 10000;
-           BusLogic_Info("  Target %d: Synchronous at "
-                         "%d.%02d mega-transfers/second, offset %d\n",
-                         HostAdapter, TargetID,
-                         RoundedSynchronousTransferRate / 100,
-                         RoundedSynchronousTransferRate % 100,
-                         HostAdapter->SynchronousValues[TargetID].Offset);
-         }
-       else if (SynchronousPeriod > 0)
-         {
-           int SynchronousTransferRate = 100000000 / SynchronousPeriod;
-           int RoundedSynchronousTransferRate =
-             (SynchronousTransferRate + 50000) / 100000;
-           BusLogic_Info("  Target %d: Synchronous at "
-                         "%d.%01d mega-transfers/second, offset %d\n",
-                         HostAdapter, TargetID,
-                         RoundedSynchronousTransferRate / 10,
-                         RoundedSynchronousTransferRate % 10,
-                         HostAdapter->SynchronousValues[TargetID].Offset);
-         }
-       else BusLogic_Info("  Target %d: Asynchronous\n",
-                          HostAdapter, TargetID);
-       TargetDevicesFound++;
-      }
-  if (TargetDevicesFound == 0)
-    BusLogic_Info("  No Target Devices Found\n", HostAdapter);
-  /*
-    Indicate the Target Device Inquiry completed successfully.
-  */
-  return true;
+    {
+      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
+      if (TargetFlags->TargetExists && !TargetFlags->TargetInfoReported)
+       {
+         int SynchronousTransferRate = 0;
+         if (BusLogic_FlashPointHostAdapterP(HostAdapter))
+           {
+             boolean WideTransfersActive;
+             FlashPoint_InquireTargetInfo(
+               HostAdapter->CardHandle, TargetID,
+               &HostAdapter->SynchronousPeriod[TargetID],
+               &HostAdapter->SynchronousOffset[TargetID],
+               &WideTransfersActive);
+             TargetFlags->WideTransfersActive = WideTransfersActive;
+           }
+         else if (TargetFlags->WideTransfersSupported &&
+                  (HostAdapter->WidePermitted & (1 << TargetID)) &&
+                  strcmp(HostAdapter->FirmwareVersion, "5.06L") < 0)
+           TargetFlags->WideTransfersActive = true;
+         if (HostAdapter->SynchronousPeriod[TargetID] > 0)
+           SynchronousTransferRate =
+             100000 / HostAdapter->SynchronousPeriod[TargetID];
+         if (TargetFlags->WideTransfersActive)
+           SynchronousTransferRate <<= 1;
+         if (SynchronousTransferRate >= 9950)
+           {
+             SynchronousTransferRate = (SynchronousTransferRate + 50) / 100;
+             BusLogic_Info("Target %d: Queue Depth %d, %sSynchronous at "
+                           "%d.%01d MB/sec, offset %d\n",
+                           HostAdapter, TargetID,
+                           HostAdapter->QueueDepth[TargetID],
+                           (TargetFlags->WideTransfersActive ? "Wide " : ""),
+                           SynchronousTransferRate / 10,
+                           SynchronousTransferRate % 10,
+                           HostAdapter->SynchronousOffset[TargetID]);
+           }
+         else if (SynchronousTransferRate > 0)
+           {
+             SynchronousTransferRate = (SynchronousTransferRate + 5) / 10;
+             BusLogic_Info("Target %d: Queue Depth %d, %sSynchronous at "
+                           "%d.%02d MB/sec, offset %d\n",
+                           HostAdapter, TargetID,
+                           HostAdapter->QueueDepth[TargetID],
+                           (TargetFlags->WideTransfersActive ? "Wide " : ""),
+                           SynchronousTransferRate / 100,
+                           SynchronousTransferRate % 100,
+                           HostAdapter->SynchronousOffset[TargetID]);
+           }
+         else BusLogic_Info("Target %d: Queue Depth %d, Asynchronous\n",
+                            HostAdapter, TargetID,
+                            HostAdapter->QueueDepth[TargetID]);
+         TargetFlags->TargetInfoReported = true;
+       }
+    }
 }
 
 
@@ -2628,9 +2662,11 @@ static void BusLogic_InitializeHostStructure(BusLogic_HostAdapter_T
 
 
 /*
-  BusLogic_SelectQueueDepths selects Queue Depths for each Target Device
-  based on the Host Adapter's Total Queue Depth and the number, type, speed,
-  and capabilities of the Target Devices.
+  BusLogic_SelectQueueDepths selects Queue Depths for each Target Device based
+  on the Host Adapter's Total Queue Depth and the number, type, speed, and
+  capabilities of the Target Devices.  When called for the last Host Adapter,
+  it reports on the Target Device Information for all BusLogic Host Adapters
+  since all the Target Devices have now been probed.
 */
 
 static void BusLogic_SelectQueueDepths(SCSI_Host_T *Host,
@@ -2638,41 +2674,60 @@ static void BusLogic_SelectQueueDepths(SCSI_Host_T *Host,
 {
   BusLogic_HostAdapter_T *HostAdapter =
     (BusLogic_HostAdapter_T *) Host->hostdata;
-  int TaggedQueueDepth = HostAdapter->TaggedQueueDepth;
-  int UntaggedQueueDepth = HostAdapter->UntaggedQueueDepth;
-  int TaggedDeviceCount = 0, UntaggedDeviceCount = 0;
-  int DesiredCCBs = HostAdapter->MaxTargetDevices - 1;
+  int TaggedDeviceCount = 0, AutomaticTaggedDeviceCount = 0;
+  int UntaggedDeviceCount = 0, AutomaticTaggedQueueDepth = 0;
+  int AllocatedQueueDepth = 0;
   SCSI_Device_T *Device;
-  for (Device = DeviceList; Device != NULL; Device = Device->next)
-    if (Device->host == Host)
+  int TargetID;
+  for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
+    if (HostAdapter->TargetFlags[TargetID].TargetExists)
       {
-       if (Device->tagged_supported &&
-           (HostAdapter->TaggedQueuingPermitted & (1 << Device->id)))
-         TaggedDeviceCount++;
+       int QueueDepth = HostAdapter->UntaggedQueueDepth;
+       if (HostAdapter->TargetFlags[TargetID].TaggedQueuingSupported &&
+           (HostAdapter->TaggedQueuingPermitted & (1 << TargetID)))
+         {
+           QueueDepth = HostAdapter->QueueDepth[TargetID];
+           TaggedDeviceCount++;
+           if (QueueDepth == 0) AutomaticTaggedDeviceCount++;
+         }
        else UntaggedDeviceCount++;
+       HostAdapter->QueueDepth[TargetID] = QueueDepth;
+       AllocatedQueueDepth += QueueDepth;
       }
-  if (TaggedQueueDepth == 0 && TaggedDeviceCount > 0)
+  HostAdapter->TargetDeviceCount = TaggedDeviceCount + UntaggedDeviceCount;
+  if (AutomaticTaggedDeviceCount > 0)
     {
-      TaggedQueueDepth =
-       1 + ((HostAdapter->HostAdapterQueueDepth
-             - UntaggedDeviceCount * UntaggedQueueDepth)
-            / TaggedDeviceCount);
-      if (TaggedQueueDepth > BusLogic_PreferredTaggedQueueDepth)
-       TaggedQueueDepth = BusLogic_PreferredTaggedQueueDepth;
+      AutomaticTaggedQueueDepth =
+       (HostAdapter->HostAdapterQueueDepth - AllocatedQueueDepth)
+       / AutomaticTaggedDeviceCount;
+      if (AutomaticTaggedQueueDepth > BusLogic_MaxAutomaticTaggedQueueDepth)
+       AutomaticTaggedQueueDepth = BusLogic_MaxAutomaticTaggedQueueDepth;
+      if (AutomaticTaggedQueueDepth < BusLogic_MinAutomaticTaggedQueueDepth)
+       AutomaticTaggedQueueDepth = BusLogic_MinAutomaticTaggedQueueDepth;
+      for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
+       if (HostAdapter->TargetFlags[TargetID].TargetExists &&
+           HostAdapter->QueueDepth[TargetID] == 0)
+         {
+           AllocatedQueueDepth += AutomaticTaggedQueueDepth;
+           HostAdapter->QueueDepth[TargetID] = AutomaticTaggedQueueDepth;
+         }
     }
   for (Device = DeviceList; Device != NULL; Device = Device->next)
     if (Device->host == Host)
-      {
-       if (Device->tagged_supported &&
-           (HostAdapter->TaggedQueuingPermitted & (1 << Device->id)))
-         Device->queue_depth = TaggedQueueDepth;
-       else Device->queue_depth = UntaggedQueueDepth;
-       HostAdapter->QueueDepth[Device->id] = Device->queue_depth;
-       DesiredCCBs += Device->queue_depth;
-      }
+      Device->queue_depth = HostAdapter->QueueDepth[Device->id];
+  /* Allocate an extra CCB for each Target Device for a Bus Device Reset. */
+  AllocatedQueueDepth += HostAdapter->TargetDeviceCount;
+  if (AllocatedQueueDepth > HostAdapter->DriverQueueDepth)
+    AllocatedQueueDepth = HostAdapter->DriverQueueDepth;
   BusLogic_CreateAdditionalCCBs(HostAdapter,
-                               DesiredCCBs - HostAdapter->AllocatedCCBs,
+                               AllocatedQueueDepth
+                               - HostAdapter->AllocatedCCBs,
                                false);
+  if (HostAdapter == BusLogic_LastRegisteredHostAdapter)
+    for (HostAdapter = BusLogic_FirstRegisteredHostAdapter;
+        HostAdapter != NULL;
+        HostAdapter = HostAdapter->NextAll)
+      BusLogic_ReportTargetDeviceInfo(HostAdapter);
 }
 
 
@@ -2686,50 +2741,48 @@ static void BusLogic_SelectQueueDepths(SCSI_Host_T *Host,
 
 int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *HostTemplate)
 {
-  int BusLogicHostAdapterCount = 0, CommandLineEntryIndex = 0, ProbeIndex;
-  char *MessageBuffer = NULL;
-  if (BusLogic_ProbeOptions.Bits.NoProbe) return 0;
-  BusLogic_InitializeProbeInfoList();
+  int BusLogicHostAdapterCount = 0, DriverOptionsIndex = 0, ProbeIndex;
+  BusLogic_HostAdapter_T *PrototypeHostAdapter;
+  if (BusLogic_ProbeOptions.NoProbe) return 0;
+  BusLogic_ProbeInfoList = (BusLogic_ProbeInfo_T *)
+    kmalloc(BusLogic_MaxHostAdapters * sizeof(BusLogic_ProbeInfo_T),
+           GFP_ATOMIC);
+  if (BusLogic_ProbeInfoList == NULL)
+    {
+      BusLogic_Error("BusLogic: Unable to allocate Probe Info List\n", NULL);
+      return 0;
+    }
+  memset(BusLogic_ProbeInfoList, 0,
+        BusLogic_MaxHostAdapters * sizeof(BusLogic_ProbeInfo_T));
+  PrototypeHostAdapter = (BusLogic_HostAdapter_T *)
+    kmalloc(sizeof(BusLogic_HostAdapter_T), GFP_ATOMIC);
+  if (PrototypeHostAdapter == NULL)
+    {
+      kfree(BusLogic_ProbeInfoList);
+      BusLogic_Error("BusLogic: Unable to allocate Prototype "
+                    "Host Adapter\n", NULL);
+      return 0;
+    }
+  memset(PrototypeHostAdapter, 0, sizeof(BusLogic_HostAdapter_T));
+  if (BusLogic_Options != NULL)
+    BusLogic_ParseDriverOptions(BusLogic_Options);
+  BusLogic_InitializeProbeInfoList(PrototypeHostAdapter);
   for (ProbeIndex = 0; ProbeIndex < BusLogic_ProbeInfoCount; ProbeIndex++)
     {
       BusLogic_ProbeInfo_T *ProbeInfo = &BusLogic_ProbeInfoList[ProbeIndex];
-      BusLogic_HostAdapter_T HostAdapterPrototype;
-      BusLogic_HostAdapter_T *HostAdapter = &HostAdapterPrototype;
+      BusLogic_HostAdapter_T *HostAdapter = PrototypeHostAdapter;
       SCSI_Host_T *Host;
       if (ProbeInfo->IO_Address == 0) continue;
       memset(HostAdapter, 0, sizeof(BusLogic_HostAdapter_T));
-      HostAdapter->IO_Address = ProbeInfo->IO_Address;
-      HostAdapter->PCI_Address = ProbeInfo->PCI_Address;
       HostAdapter->HostAdapterType = ProbeInfo->HostAdapterType;
       HostAdapter->HostAdapterBusType = ProbeInfo->HostAdapterBusType;
+      HostAdapter->IO_Address = ProbeInfo->IO_Address;
+      HostAdapter->PCI_Address = ProbeInfo->PCI_Address;
       HostAdapter->Bus = ProbeInfo->Bus;
       HostAdapter->Device = ProbeInfo->Device;
       HostAdapter->IRQ_Channel = ProbeInfo->IRQ_Channel;
       HostAdapter->AddressCount =
-       BusLogic_HostAdapter_AddressCount[HostAdapter->HostAdapterType];
-      if (MessageBuffer == NULL)
-       MessageBuffer =
-         scsi_init_malloc(BusLogic_MessageBufferSize, GFP_ATOMIC);
-      if (MessageBuffer == NULL)
-       {
-         BusLogic_Error("BusLogic: Unable to allocate Message Buffer\n",
-                        HostAdapter);
-         return BusLogicHostAdapterCount;
-       }
-      HostAdapter->MessageBuffer = MessageBuffer;
-      /*
-       If an explicit I/O Address was specified, Initialize the Command Line
-       Entry field and inhibit the check for whether the I/O Address range is
-       already in use.
-      */
-      if (CommandLineEntryIndex < BusLogic_CommandLineEntryCount &&
-         BusLogic_CommandLineEntries[CommandLineEntryIndex].IO_Address ==
-         HostAdapter->IO_Address)
-       HostAdapter->CommandLineEntry =
-         &BusLogic_CommandLineEntries[CommandLineEntryIndex++];
-      else if (check_region(HostAdapter->IO_Address,
-                           HostAdapter->AddressCount) < 0)
-       continue;
+       BusLogic_HostAdapterAddressCount[HostAdapter->HostAdapterType];
       /*
        Probe the Host Adapter.  If unsuccessful, abort further initialization.
       */
@@ -2738,22 +2791,20 @@ int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *HostTemplate)
        Hard Reset the Host Adapter.  If unsuccessful, abort further
        initialization.
       */
-      if (!BusLogic_HardResetHostAdapter(HostAdapter)) continue;
+      if (!BusLogic_HardwareResetHostAdapter(HostAdapter, true)) continue;
       /*
        Check the Host Adapter.  If unsuccessful, abort further initialization.
       */
       if (!BusLogic_CheckHostAdapter(HostAdapter)) continue;
       /*
-       Initialize the Command Line Entry field if an explicit I/O Address
-       was not specified.
+       Initialize the Driver Options field if provided.
       */
-      if (CommandLineEntryIndex < BusLogic_CommandLineEntryCount &&
-         BusLogic_CommandLineEntries[CommandLineEntryIndex].IO_Address == 0)
-       HostAdapter->CommandLineEntry =
-         &BusLogic_CommandLineEntries[CommandLineEntryIndex++];
+      if (DriverOptionsIndex < BusLogic_DriverOptionsCount)
+       HostAdapter->DriverOptions =
+         &BusLogic_DriverOptions[DriverOptionsIndex++];
       /*
        Announce the Driver Version and Date, Author's Name, Copyright Notice,
-       and Contact Address.
+       and Electronic Mail Address.
       */
       BusLogic_AnnounceDriver(HostAdapter);
       /*
@@ -2771,8 +2822,7 @@ int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *HostTemplate)
       */
       Host = scsi_register(HostTemplate, sizeof(BusLogic_HostAdapter_T));
       HostAdapter = (BusLogic_HostAdapter_T *) Host->hostdata;
-      memcpy(HostAdapter, &HostAdapterPrototype,
-            sizeof(BusLogic_HostAdapter_T));
+      memcpy(HostAdapter, PrototypeHostAdapter, sizeof(BusLogic_HostAdapter_T));
       HostAdapter->SCSI_Host = Host;
       HostAdapter->HostNumber = Host->host_no;
       Host->select_queue_depths = BusLogic_SelectQueueDepths;
@@ -2785,18 +2835,14 @@ int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *HostTemplate)
       BusLogic_RegisterHostAdapter(HostAdapter);
       /*
        Read the Host Adapter Configuration, Configure the Host Adapter,
-       Acquire the System Resources necessary to use the Host Adapter,
-       then Test Interrupts, Create the Mailboxes, Initial CCBs, and
-       Target Device Statistics, Initialize the Host Adapter, and
-       finally perform Target Device Inquiry.
+       Acquire the System Resources necessary to use the Host Adapter, then
+       Create the Initial CCBs, Initialize the Host Adapter, and finally
+       perform Target Device Inquiry.
       */
       if (BusLogic_ReadHostAdapterConfiguration(HostAdapter) &&
          BusLogic_ReportHostAdapterConfiguration(HostAdapter) &&
          BusLogic_AcquireResources(HostAdapter) &&
-         BusLogic_TestInterrupts(HostAdapter) &&
-         BusLogic_CreateMailboxes(HostAdapter) &&
          BusLogic_CreateInitialCCBs(HostAdapter) &&
-         BusLogic_CreateTargetDeviceStatistics(HostAdapter) &&
          BusLogic_InitializeHostAdapter(HostAdapter) &&
          BusLogic_TargetDeviceInquiry(HostAdapter))
        {
@@ -2806,7 +2852,6 @@ int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *HostTemplate)
            Name of the Host Adapter will appear, and initialize the SCSI
            Host structure.
          */
-         MessageBuffer = NULL;
          release_region(HostAdapter->IO_Address,
                         HostAdapter->AddressCount);
          request_region(HostAdapter->IO_Address,
@@ -2818,24 +2863,22 @@ int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *HostTemplate)
       else
        {
          /*
-           An error occurred during Host Adapter Configuration Querying,
-           Host Adapter Configuration, Resource Acquisition, Interrupt
-           Testing, CCB Creation, Host Adapter Initialization, or Target
-           Device Inquiry, so remove Host Adapter from the list of
-           registered BusLogic Host Adapters, destroy the Target Device
-           Statistics, CCBs, and Mailboxes, Release the System Resources,
-           and Unregister the SCSI Host.
+           An error occurred during Host Adapter Configuration Querying, Host
+           Adapter Configuration, Resource Acquisition, CCB Creation, Host
+           Adapter Initialization, or Target Device Inquiry, so remove Host
+           Adapter from the list of registered BusLogic Host Adapters, destroy
+           the CCBs, Release the System Resources, and Unregister the SCSI
+           Host.
          */
-         BusLogic_DestroyTargetDeviceStatistics(HostAdapter);
          BusLogic_DestroyCCBs(HostAdapter);
-         BusLogic_DestroyMailboxes(HostAdapter);
          BusLogic_ReleaseResources(HostAdapter);
          BusLogic_UnregisterHostAdapter(HostAdapter);
          scsi_unregister(Host);
        }
     }
-  if (MessageBuffer != NULL)
-    scsi_init_free(MessageBuffer, BusLogic_MessageBufferSize);
+  kfree(PrototypeHostAdapter);
+  kfree(BusLogic_ProbeInfoList);
+  BusLogic_ProbeInfoList = NULL;
   return BusLogicHostAdapterCount;
 }
 
@@ -2851,21 +2894,16 @@ int BusLogic_ReleaseHostAdapter(SCSI_Host_T *Host)
   BusLogic_HostAdapter_T *HostAdapter =
     (BusLogic_HostAdapter_T *) Host->hostdata;
   /*
-    FlashPoint Host Adapters must also be released by the FlashPoint
+    FlashPoint Host Adapters must first be released by the FlashPoint
     SCCB Manager.
   */
   if (BusLogic_FlashPointHostAdapterP(HostAdapter))
-    {
-      FlashPoint_ReleaseHostAdapter(HostAdapter->CardHandle);
-      scsi_init_free((char *) HostAdapter->FlashPointInfo,
-                    sizeof(FlashPoint_Info_T));
-    }
+    FlashPoint_ReleaseHostAdapter(HostAdapter->CardHandle);
   /*
-    Destroy the CCBs and Mailboxes, and release any system resources acquired
-    to support Host Adapter.
+    Destroy the CCBs and release any system resources acquired to
+    support Host Adapter.
   */
   BusLogic_DestroyCCBs(HostAdapter);
-  BusLogic_DestroyMailboxes(HostAdapter);
   BusLogic_ReleaseResources(HostAdapter);
   /*
     Release usage of the I/O Address range.
@@ -2988,27 +3026,29 @@ static void BusLogic_ScanIncomingMailboxes(BusLogic_HostAdapter_T *HostAdapter)
       BusLogic_CCB_T *CCB = (BusLogic_CCB_T *)
        Bus_to_Virtual(NextIncomingMailbox->CCB);
       if (CompletionCode != BusLogic_AbortedCommandNotFound)
-       if (CCB->Status == BusLogic_CCB_Active ||
-           CCB->Status == BusLogic_CCB_Reset)
-         {
-           /*
-             Save the Completion Code for this CCB and queue the CCB
-             for completion processing.
-           */
-           CCB->CompletionCode = CompletionCode;
-           BusLogic_QueueCompletedCCB(CCB);
-         }
-       else
-         {
-           /*
-             If a CCB ever appears in an Incoming Mailbox and is not marked as
-             status Active or Reset, then there is most likely a bug in the
-             Host Adapter firmware.
-           */
-           BusLogic_Warning("Illegal CCB #%ld status %d in "
-                            "Incoming Mailbox\n", HostAdapter,
-                            CCB->SerialNumber, CCB->Status);
-         }
+       {
+         if (CCB->Status == BusLogic_CCB_Active ||
+             CCB->Status == BusLogic_CCB_Reset)
+           {
+             /*
+               Save the Completion Code for this CCB and queue the CCB
+               for completion processing.
+             */
+             CCB->CompletionCode = CompletionCode;
+             BusLogic_QueueCompletedCCB(CCB);
+           }
+         else
+           {
+             /*
+               If a CCB ever appears in an Incoming Mailbox and is not marked
+               as status Active or Reset, then there is most likely a bug in
+               the Host Adapter firmware.
+             */
+             BusLogic_Warning("Illegal CCB #%ld status %d in "
+                              "Incoming Mailbox\n", HostAdapter,
+                              CCB->SerialNumber, CCB->Status);
+           }
+       }
       NextIncomingMailbox->CompletionCode = BusLogic_IncomingMailboxFree;
       if (++NextIncomingMailbox > HostAdapter->LastIncomingMailbox)
        NextIncomingMailbox = HostAdapter->FirstIncomingMailbox;
@@ -3047,10 +3087,9 @@ static void BusLogic_ProcessCompletedCCBs(void)
                           "%d Completed\n", HostAdapter,
                           CCB->SerialNumber, TargetID);
          BusLogic_IncrementErrorCounter(
-           &HostAdapter->TargetDeviceStatistics[TargetID]
-                         .BusDeviceResetsCompleted);
+           &HostAdapter->TargetStatistics[TargetID].BusDeviceResetsCompleted);
+         HostAdapter->TargetFlags[TargetID].TaggedQueuingActive = false;
          HostAdapter->CommandsSinceReset[TargetID] = 0;
-         HostAdapter->TaggedQueuingActive[TargetID] = false;
          HostAdapter->LastResetCompleted[TargetID] = jiffies;
          /*
            Place CCB back on the Host Adapter's free list.
@@ -3101,16 +3140,17 @@ static void BusLogic_ProcessCompletedCCBs(void)
                               HostAdapter, CCB->SerialNumber, CCB->TargetID);
              break;
            case BusLogic_CommandCompletedWithoutError:
-             HostAdapter->TargetDeviceStatistics[CCB->TargetID]
+             HostAdapter->TargetStatistics[CCB->TargetID]
                           .CommandsCompleted++;
-             HostAdapter->CommandSuccessfulFlag[CCB->TargetID] = true;
+             HostAdapter->TargetFlags[CCB->TargetID]
+                          .CommandSuccessfulFlag = true;
              Command->result = DID_OK << 16;
              break;
            case BusLogic_CommandAbortedAtHostRequest:
              BusLogic_Warning("CCB #%ld to Target %d Aborted\n",
                               HostAdapter, CCB->SerialNumber, CCB->TargetID);
              BusLogic_IncrementErrorCounter(
-               &HostAdapter->TargetDeviceStatistics[CCB->TargetID]
+               &HostAdapter->TargetStatistics[CCB->TargetID]
                              .CommandAbortsCompleted);
              Command->result = DID_ABORT << 16;
              break;
@@ -3121,9 +3161,9 @@ static void BusLogic_ProcessCompletedCCBs(void)
                                           CCB->TargetDeviceStatus);
              if (CCB->HostAdapterStatus != BusLogic_SCSISelectionTimeout)
                {
-                 HostAdapter->TargetDeviceStatistics[CCB->TargetID]
+                 HostAdapter->TargetStatistics[CCB->TargetID]
                               .CommandsCompleted++;
-                 if (BusLogic_GlobalOptions.Bits.TraceErrors)
+                 if (BusLogic_GlobalOptions.TraceErrors)
                      {
                        int i;
                        BusLogic_Notice("CCB #%ld Target %d: Result %X Host "
@@ -3146,6 +3186,22 @@ static void BusLogic_ProcessCompletedCCBs(void)
                }
              break;
            }
+         /*
+           When an INQUIRY command completes normally, save the
+           CmdQue (Tagged Queuing Supported) and WBus16 (16 Bit
+           Wide Data Transfers Supported) bits.
+         */
+         if (CCB->CDB[0] == INQUIRY && CCB->CDB[1] == 0 &&
+             CCB->HostAdapterStatus == BusLogic_CommandCompletedNormally)
+           {
+             BusLogic_TargetFlags_T *TargetFlags =
+               &HostAdapter->TargetFlags[CCB->TargetID];
+             SCSI_Inquiry_T *InquiryResult =
+               (SCSI_Inquiry_T *) Command->request_buffer;
+             TargetFlags->TargetExists = true;
+             TargetFlags->TaggedQueuingSupported = InquiryResult->CmdQue;
+             TargetFlags->WideTransfersSupported = InquiryResult->WBus16;
+           }
          /*
            Place CCB back on the Host Adapter's free list.
          */
@@ -3171,7 +3227,7 @@ static void BusLogic_InterruptHandler(int IRQ_Channel,
 {
   BusLogic_HostAdapter_T *FirstHostAdapter =
     BusLogic_RegisteredHostAdapters[IRQ_Channel];
-  boolean HostAdapterResetRequested = false;
+  boolean HostAdapterResetRequired = false;
   BusLogic_HostAdapter_T *HostAdapter;
   BusLogic_Lock_T Lock;
   /*
@@ -3213,8 +3269,8 @@ static void BusLogic_InterruptHandler(int IRQ_Channel,
              */
              if (InterruptRegister.Bits.ExternalBusReset)
                {
-                 HostAdapter->HostAdapterResetRequested = true;
-                 HostAdapterResetRequested = true;
+                 HostAdapter->HostAdapterExternalReset = true;
+                 HostAdapterResetRequired = true;
                }
              else if (InterruptRegister.Bits.IncomingMailboxLoaded)
                BusLogic_ScanIncomingMailboxes(HostAdapter);
@@ -3228,11 +3284,20 @@ static void BusLogic_InterruptHandler(int IRQ_Channel,
            Check if there is a pending interrupt for this Host Adapter.
          */
          if (FlashPoint_InterruptPending(HostAdapter->CardHandle))
-           if (FlashPoint_HandleInterrupt(HostAdapter->CardHandle)
-               == FlashPoint_ExternalBusReset)
+           switch (FlashPoint_HandleInterrupt(HostAdapter->CardHandle))
              {
-               HostAdapter->HostAdapterResetRequested = true;
-               HostAdapterResetRequested = true;
+             case FlashPoint_NormalInterrupt:
+               break;
+             case FlashPoint_ExternalBusReset:
+               HostAdapter->HostAdapterExternalReset = true;
+               HostAdapterResetRequired = true;
+               break;
+             case FlashPoint_InternalError:
+               BusLogic_Warning("Internal FlashPoint Error detected"
+                                " - Resetting Host Adapter\n", HostAdapter);
+               HostAdapter->HostAdapterInternalError = true;
+               HostAdapterResetRequired = true;
+               break;
              }
        }
       /*
@@ -3249,14 +3314,16 @@ static void BusLogic_InterruptHandler(int IRQ_Channel,
     Iterate over the Host Adapters performing any requested
     Host Adapter Resets.
   */
-  if (HostAdapterResetRequested)
+  if (HostAdapterResetRequired)
     for (HostAdapter = FirstHostAdapter;
         HostAdapter != NULL;
         HostAdapter = HostAdapter->Next)
-      if (HostAdapter->HostAdapterResetRequested)
+      if (HostAdapter->HostAdapterExternalReset ||
+         HostAdapter->HostAdapterInternalError)
        {
          BusLogic_ResetHostAdapter(HostAdapter, NULL, 0);
-         HostAdapter->HostAdapterResetRequested = false;
+         HostAdapter->HostAdapterExternalReset = false;
+         HostAdapter->HostAdapterInternalError = false;
          scsi_mark_host_reset(HostAdapter->SCSI_Host);
        }
 }
@@ -3293,8 +3360,7 @@ static boolean BusLogic_WriteOutgoingMailbox(BusLogic_HostAdapter_T
        {
          HostAdapter->ActiveCommands[CCB->TargetID]++;
          if (CCB->Opcode != BusLogic_BusDeviceReset)
-           HostAdapter->TargetDeviceStatistics[CCB->TargetID]
-                        .CommandsAttempted++;
+           HostAdapter->TargetStatistics[CCB->TargetID].CommandsAttempted++;
        }
       return true;
     }
@@ -3312,8 +3378,10 @@ int BusLogic_QueueCommand(SCSI_Command_T *Command,
 {
   BusLogic_HostAdapter_T *HostAdapter =
     (BusLogic_HostAdapter_T *) Command->host->hostdata;
-  BusLogic_TargetDeviceStatistics_T *TargetDeviceStatistics =
-    HostAdapter->TargetDeviceStatistics;
+  BusLogic_TargetFlags_T *TargetFlags =
+    &HostAdapter->TargetFlags[Command->target];
+  BusLogic_TargetStatistics_T *TargetStatistics =
+    HostAdapter->TargetStatistics;
   unsigned char *CDB = Command->cmnd;
   int CDB_Length = Command->cmd_len;
   int TargetID = Command->target;
@@ -3371,13 +3439,9 @@ int BusLogic_QueueCommand(SCSI_Command_T *Command,
       int Segment;
       CCB->Opcode = BusLogic_InitiatorCCB_ScatterGather;
       CCB->DataLength = SegmentCount * sizeof(BusLogic_ScatterGatherSegment_T);
-#ifndef CONFIG_SCSI_OMIT_FLASHPOINT
       if (BusLogic_MultiMasterHostAdapterP(HostAdapter))
        CCB->DataPointer = Virtual_to_Bus(CCB->ScatterGatherList);
-      else CCB->DataPointer = (BusLogic_BusAddress_T) CCB->ScatterGatherList;
-#else
-      CCB->DataPointer = Virtual_to_Bus(CCB->ScatterGatherList);
-#endif
+      else CCB->DataPointer = Virtual_to_32Bit_Virtual(CCB->ScatterGatherList);
       for (Segment = 0; Segment < SegmentCount; Segment++)
        {
          CCB->ScatterGatherList[Segment].SegmentByteCount =
@@ -3391,22 +3455,20 @@ int BusLogic_QueueCommand(SCSI_Command_T *Command,
     case READ_6:
     case READ_10:
       CCB->DataDirection = BusLogic_DataInLengthChecked;
-      TargetDeviceStatistics[TargetID].ReadCommands++;
+      TargetStatistics[TargetID].ReadCommands++;
       BusLogic_IncrementByteCounter(
-       &TargetDeviceStatistics[TargetID].TotalBytesRead, BufferLength);
+       &TargetStatistics[TargetID].TotalBytesRead, BufferLength);
       BusLogic_IncrementSizeBucket(
-       TargetDeviceStatistics[TargetID].ReadCommandSizeBuckets,
-       BufferLength);
+       TargetStatistics[TargetID].ReadCommandSizeBuckets, BufferLength);
       break;
     case WRITE_6:
     case WRITE_10:
       CCB->DataDirection = BusLogic_DataOutLengthChecked;
-      TargetDeviceStatistics[TargetID].WriteCommands++;
+      TargetStatistics[TargetID].WriteCommands++;
       BusLogic_IncrementByteCounter(
-       &TargetDeviceStatistics[TargetID].TotalBytesWritten, BufferLength);
+       &TargetStatistics[TargetID].TotalBytesWritten, BufferLength);
       BusLogic_IncrementSizeBucket(
-       TargetDeviceStatistics[TargetID].WriteCommandSizeBuckets,
-       BufferLength);
+       TargetStatistics[TargetID].WriteCommandSizeBuckets, BufferLength);
       break;
     default:
       CCB->DataDirection = BusLogic_UncheckedDataTransfer;
@@ -3434,20 +3496,18 @@ int BusLogic_QueueCommand(SCSI_Command_T *Command,
     necessary to wait until there are no pending commands for a target device
     before queuing tagged commands.
   */
-  HostAdapter->TaggedQueuingSupported[TargetID] =
-    Command->device->tagged_supported;
   if (HostAdapter->CommandsSinceReset[TargetID]++ >=
        BusLogic_MaxTaggedQueueDepth &&
-      !HostAdapter->TaggedQueuingActive[TargetID] &&
+      !TargetFlags->TaggedQueuingActive &&
       HostAdapter->ActiveCommands[TargetID] == 0 &&
-      HostAdapter->TaggedQueuingSupported[TargetID] &&
+      TargetFlags->TaggedQueuingSupported &&
       (HostAdapter->TaggedQueuingPermitted & (1 << TargetID)))
     {
-      HostAdapter->TaggedQueuingActive[TargetID] = true;
+      TargetFlags->TaggedQueuingActive = true;
       BusLogic_Notice("Tagged Queuing now active for Target %d\n",
                      HostAdapter, TargetID);
     }
-  if (HostAdapter->TaggedQueuingActive[TargetID])
+  if (TargetFlags->TaggedQueuingActive)
     {
       BusLogic_QueueTag_T QueueTag = BusLogic_SimpleQueueTag;
       /*
@@ -3457,7 +3517,7 @@ int BusLogic_QueueCommand(SCSI_Command_T *Command,
        write nearer the head position continue to arrive without interruption.
        Therefore, for each Target Device this driver keeps track of the last
        time either the queue was empty or an Ordered Queue Tag was issued.  If
-       more than 3 seconds (one fifth of the 15 second disk timeout) have
+       more than 4 seconds (one fifth of the 20 second disk timeout) have
        elapsed since this last sequence point, this command will be issued
        with an Ordered Queue Tag rather than a Simple Queue Tag, which forces
        the Target Device to complete all previously queued commands before
@@ -3465,7 +3525,7 @@ int BusLogic_QueueCommand(SCSI_Command_T *Command,
       */
       if (HostAdapter->ActiveCommands[TargetID] == 0)
        HostAdapter->LastSequencePoint[TargetID] = jiffies;
-      else if (jiffies - HostAdapter->LastSequencePoint[TargetID] > 3*HZ)
+      else if (jiffies - HostAdapter->LastSequencePoint[TargetID] > 4*HZ)
        {
          HostAdapter->LastSequencePoint[TargetID] = jiffies;
          QueueTag = BusLogic_OrderedQueueTag;
@@ -3519,7 +3579,7 @@ int BusLogic_QueueCommand(SCSI_Command_T *Command,
       */
       CCB->Status = BusLogic_CCB_Active;
       HostAdapter->ActiveCommands[TargetID]++;
-      TargetDeviceStatistics[TargetID].CommandsAttempted++;
+      TargetStatistics[TargetID].CommandsAttempted++;
       FlashPoint_StartCCB(HostAdapter->CardHandle, CCB);
       /*
        The Command may have already completed and BusLogic_QueueCompletedCCB
@@ -3550,7 +3610,7 @@ int BusLogic_AbortCommand(SCSI_Command_T *Command)
   BusLogic_CCB_T *CCB;
   int Result;
   BusLogic_IncrementErrorCounter(
-    &HostAdapter->TargetDeviceStatistics[TargetID].CommandAbortsRequested);
+    &HostAdapter->TargetStatistics[TargetID].CommandAbortsRequested);
   /*
     Acquire exclusive access to Host Adapter.
   */
@@ -3604,7 +3664,7 @@ int BusLogic_AbortCommand(SCSI_Command_T *Command)
        Firmware version 5.xx does generate Abort Tag messages, so it is
        possible to abort commands when Tagged Queuing is active.
       */
-      if (HostAdapter->TaggedQueuingActive[TargetID] &&
+      if (HostAdapter->TargetFlags[TargetID].TaggedQueuingActive &&
          HostAdapter->FirmwareVersion[0] < '5')
        {
          BusLogic_Warning("Unable to Abort CCB #%ld to Target %d - "
@@ -3618,8 +3678,7 @@ int BusLogic_AbortCommand(SCSI_Command_T *Command)
          BusLogic_Warning("Aborting CCB #%ld to Target %d\n",
                           HostAdapter, CCB->SerialNumber, TargetID);
          BusLogic_IncrementErrorCounter(
-           &HostAdapter->TargetDeviceStatistics[TargetID]
-                         .CommandAbortsAttempted);
+           &HostAdapter->TargetStatistics[TargetID].CommandAbortsAttempted);
          Result = SCSI_ABORT_PENDING;
        }
       else
@@ -3638,7 +3697,7 @@ int BusLogic_AbortCommand(SCSI_Command_T *Command)
       BusLogic_Warning("Aborting CCB #%ld to Target %d\n",
                       HostAdapter, CCB->SerialNumber, TargetID);
       BusLogic_IncrementErrorCounter(
-       &HostAdapter->TargetDeviceStatistics[TargetID].CommandAbortsAttempted);
+       &HostAdapter->TargetStatistics[TargetID].CommandAbortsAttempted);
       FlashPoint_AbortCCB(HostAdapter->CardHandle, CCB);
       /*
        The Abort may have already been completed and
@@ -3673,11 +3732,24 @@ static int BusLogic_ResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter,
   BusLogic_Lock_T Lock;
   BusLogic_CCB_T *CCB;
   int TargetID, Result;
-  if (Command == NULL)
-    BusLogic_IncrementErrorCounter(&HostAdapter->ExternalHostAdapterResets);
-  else BusLogic_IncrementErrorCounter(
-        &HostAdapter->TargetDeviceStatistics[Command->target]
-                      .HostAdapterResetsRequested);
+  boolean HardReset;
+  if (HostAdapter->HostAdapterExternalReset)
+    {
+      BusLogic_IncrementErrorCounter(&HostAdapter->ExternalHostAdapterResets);
+      HardReset = false;
+    }
+  else if (HostAdapter->HostAdapterInternalError)
+    {
+      BusLogic_IncrementErrorCounter(&HostAdapter->HostAdapterInternalErrors);
+      HardReset = true;
+    }
+  else
+    {
+      BusLogic_IncrementErrorCounter(
+       &HostAdapter->TargetStatistics[Command->target]
+                     .HostAdapterResetsRequested);
+      HardReset = true;
+    }
   /*
     Acquire exclusive access to Host Adapter.
   */
@@ -3723,20 +3795,25 @@ static int BusLogic_ResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter,
        }
     }
   if (Command == NULL)
-    BusLogic_Warning("Resetting %s due to External SCSI Bus Reset\n",
-                    HostAdapter, HostAdapter->FullModelName);
+    {
+      if (HostAdapter->HostAdapterInternalError)
+       BusLogic_Warning("Resetting %s due to Host Adapter Internal Error\n",
+                        HostAdapter, HostAdapter->FullModelName);
+      else BusLogic_Warning("Resetting %s due to External SCSI Bus Reset\n",
+                           HostAdapter, HostAdapter->FullModelName);
+    }
   else
     {
       BusLogic_Warning("Resetting %s due to Target %d\n", HostAdapter,
                       HostAdapter->FullModelName, Command->target);
       BusLogic_IncrementErrorCounter(
-       &HostAdapter->TargetDeviceStatistics[Command->target]
+       &HostAdapter->TargetStatistics[Command->target]
                      .HostAdapterResetsAttempted);
     }
   /*
     Attempt to Reset and Reinitialize the Host Adapter.
   */
-  if (!(BusLogic_HardResetHostAdapter(HostAdapter) &&
+  if (!(BusLogic_HardwareResetHostAdapter(HostAdapter, HardReset) &&
        BusLogic_InitializeHostAdapter(HostAdapter)))
     {
       BusLogic_Error("Resetting %s Failed\n", HostAdapter,
@@ -3746,7 +3823,7 @@ static int BusLogic_ResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter,
     }
   if (Command != NULL)
     BusLogic_IncrementErrorCounter(
-      &HostAdapter->TargetDeviceStatistics[Command->target]
+      &HostAdapter->TargetStatistics[Command->target]
                    .HostAdapterResetsCompleted);
   /*
     Mark all currently executing CCBs as having been Reset.
@@ -3761,7 +3838,8 @@ static int BusLogic_ResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter,
     Note that a timer interrupt may occur here, but all active CCBs have
     already been marked Reset and so a reentrant call will return Pending.
   */
-  BusLogic_Delay(HostAdapter->BusSettleTime);
+  if (HardReset)
+    BusLogic_Delay(HostAdapter->BusSettleTime);
   /*
     If this is a Synchronous Reset, perform completion processing for
     the Command being Reset.
@@ -3817,7 +3895,7 @@ static int BusLogic_SendBusDeviceReset(BusLogic_HostAdapter_T *HostAdapter,
   BusLogic_Lock_T Lock;
   int Result = -1;
   BusLogic_IncrementErrorCounter(
-    &HostAdapter->TargetDeviceStatistics[TargetID].BusDeviceResetsRequested);
+    &HostAdapter->TargetStatistics[TargetID].BusDeviceResetsRequested);
   /*
     Acquire exclusive access to Host Adapter.
   */
@@ -3891,7 +3969,7 @@ static int BusLogic_SendBusDeviceReset(BusLogic_HostAdapter_T *HostAdapter,
        while there are tagged commands outstanding.  Therefore, in that case a
        full Host Adapter Hard Reset and SCSI Bus Reset must be done.
       */
-      if (HostAdapter->TaggedQueuingActive[TargetID] &&
+      if (HostAdapter->TargetFlags[TargetID].TaggedQueuingActive &&
          HostAdapter->ActiveCommands[TargetID] > 0 &&
          HostAdapter->FirmwareVersion[0] < '5')
        goto Done;
@@ -3958,7 +4036,7 @@ static int BusLogic_SendBusDeviceReset(BusLogic_HostAdapter_T *HostAdapter,
     processing performed.
   */
   BusLogic_IncrementErrorCounter(
-    &HostAdapter->TargetDeviceStatistics[TargetID].BusDeviceResetsAttempted);
+    &HostAdapter->TargetStatistics[TargetID].BusDeviceResetsAttempted);
   HostAdapter->BusDeviceResetPendingCCB[TargetID] = CCB;
   HostAdapter->LastResetAttempted[TargetID] = jiffies;
   for (XCCB = HostAdapter->All_CCBs; XCCB != NULL; XCCB = XCCB->NextAll)
@@ -4007,11 +4085,11 @@ int BusLogic_ResetCommand(SCSI_Command_T *Command, unsigned int ResetFlags)
     it has been less than 10 minutes since the last reset occurred, or since
     the system was initialized if no prior resets have occurred.
   */
-  if (HostAdapter->TaggedQueuingActive[TargetID] &&
+  if (HostAdapter->TargetFlags[TargetID].TaggedQueuingActive &&
       jiffies - HostAdapter->LastResetCompleted[TargetID] < 10*60*HZ)
     {
       HostAdapter->TaggedQueuingPermitted &= ~(1 << TargetID);
-      HostAdapter->TaggedQueuingActive[TargetID] = false;
+      HostAdapter->TargetFlags[TargetID].TaggedQueuingActive = false;
       BusLogic_Warning("Tagged Queuing now disabled for Target %d\n",
                       HostAdapter, TargetID);
     }
@@ -4032,10 +4110,10 @@ int BusLogic_ResetCommand(SCSI_Command_T *Command, unsigned int ResetFlags)
        forcing a Hard Reset before the Bus Device Reset has had a chance to
        clear the error condition.
       */
-      if (HostAdapter->CommandSuccessfulFlag[TargetID] ||
+      if (HostAdapter->TargetFlags[TargetID].CommandSuccessfulFlag ||
          jiffies - HostAdapter->LastResetAttempted[TargetID] < HZ/10)
        {
-         HostAdapter->CommandSuccessfulFlag[TargetID] = false;
+         HostAdapter->TargetFlags[TargetID].CommandSuccessfulFlag = false;
          return BusLogic_SendBusDeviceReset(HostAdapter, Command, ResetFlags);
        }
       /* Fall through to Hard Reset case. */
@@ -4076,16 +4154,18 @@ int BusLogic_BIOSDiskParameters(SCSI_Disk_T *Disk, KernelDevice_T Device,
   struct buffer_head *BufferHead;
   if (HostAdapter->ExtendedTranslationEnabled &&
       Disk->capacity >= 2*1024*1024 /* 1 GB in 512 byte sectors */)
-    if (Disk->capacity >= 4*1024*1024 /* 2 GB in 512 byte sectors */)
-      {
-       DiskParameters->Heads = 255;
-       DiskParameters->Sectors = 63;
-      }
-    else
-      {
-       DiskParameters->Heads = 128;
-       DiskParameters->Sectors = 32;
-      }
+    {
+      if (Disk->capacity >= 4*1024*1024 /* 2 GB in 512 byte sectors */)
+       {
+         DiskParameters->Heads = 255;
+         DiskParameters->Sectors = 63;
+       }
+      else
+       {
+         DiskParameters->Heads = 128;
+         DiskParameters->Sectors = 32;
+       }
+    }
   else
     {
       DiskParameters->Heads = 64;
@@ -4105,24 +4185,28 @@ int BusLogic_BIOSDiskParameters(SCSI_Disk_T *Disk, KernelDevice_T Device,
   */
   if (*(unsigned short *) (BufferHead->b_data + 0x1FE) == 0xAA55)
     {
-      struct partition *PartitionEntry =
-       (struct partition *) (BufferHead->b_data + 0x1BE);
+      PartitionTable_T *FirstPartitionEntry =
+       (PartitionTable_T *) (BufferHead->b_data + 0x1BE);
+      PartitionTable_T *PartitionEntry = FirstPartitionEntry;
       int SavedCylinders = DiskParameters->Cylinders, PartitionNumber;
+      unsigned char PartitionEntryEndHead, PartitionEntryEndSector;
       for (PartitionNumber = 0; PartitionNumber < 4; PartitionNumber++)
        {
-         if (PartitionEntry->end_head == 64-1)
+         PartitionEntryEndHead = PartitionEntry->end_head;
+         PartitionEntryEndSector = PartitionEntry->end_sector & 0x3F;
+         if (PartitionEntryEndHead == 64-1)
            {
              DiskParameters->Heads = 64;
              DiskParameters->Sectors = 32;
              break;
            }
-         else if (PartitionEntry->end_head == 128-1)
+         else if (PartitionEntryEndHead == 128-1)
            {
              DiskParameters->Heads = 128;
              DiskParameters->Sectors = 32;
              break;
            }
-         else if (PartitionEntry->end_head == 255-1)
+         else if (PartitionEntryEndHead == 255-1)
            {
              DiskParameters->Heads = 255;
              DiskParameters->Sectors = 63;
@@ -4130,14 +4214,29 @@ int BusLogic_BIOSDiskParameters(SCSI_Disk_T *Disk, KernelDevice_T Device,
            }
          PartitionEntry++;
        }
+      if (PartitionNumber == 4)
+       {
+         PartitionEntryEndHead = FirstPartitionEntry->end_head;
+         PartitionEntryEndSector = FirstPartitionEntry->end_sector & 0x3F;
+       }
       DiskParameters->Cylinders =
        Disk->capacity / (DiskParameters->Heads * DiskParameters->Sectors);
-      if (SavedCylinders != DiskParameters->Cylinders)
+      if (PartitionNumber < 4 &&
+         PartitionEntryEndSector == DiskParameters->Sectors)
+       {
+         if (DiskParameters->Cylinders != SavedCylinders)
+           BusLogic_Warning("Adopting Geometry %d/%d from Partition Table\n",
+                            HostAdapter,
+                            DiskParameters->Heads, DiskParameters->Sectors);
+       }
+      else if (PartitionEntryEndHead > 0 || PartitionEntryEndSector > 0)
        {
-         BusLogic_Warning("Warning: Extended Translation Setting "
-                          "(> 1GB Switch) does not match\n", HostAdapter);
-         BusLogic_Warning("Partition Table - Adopting %d/%d Geometry "
-                          "from Partition Table\n", HostAdapter,
+         BusLogic_Warning("Warning: Partition Table appears to "
+                          "have Geometry %d/%d which is\n", HostAdapter,
+                          PartitionEntryEndHead + 1,
+                          PartitionEntryEndSector);
+         BusLogic_Warning("not compatible with current BusLogic "
+                          "Host Adapter Geometry %d/%d\n", HostAdapter,
                           DiskParameters->Heads, DiskParameters->Sectors);
        }
     }
@@ -4155,22 +4254,21 @@ int BusLogic_ProcDirectoryInfo(char *ProcBuffer, char **StartPointer,
                               int HostNumber, int WriteFlag)
 {
   BusLogic_HostAdapter_T *HostAdapter;
-  BusLogic_TargetDeviceStatistics_T *TargetDeviceStatistics;
-  int IRQ_Channel, TargetID, Length;
+  BusLogic_TargetStatistics_T *TargetStatistics;
+  int TargetID, Length;
   char *Buffer;
   if (WriteFlag) return 0;
-  for (IRQ_Channel = 0; IRQ_Channel < NR_IRQS; IRQ_Channel++)
+  for (HostAdapter = BusLogic_FirstRegisteredHostAdapter;
+       HostAdapter != NULL;
+       HostAdapter = HostAdapter->NextAll)
+    if (HostAdapter->HostNumber == HostNumber) break;
+  if (HostAdapter == NULL)
     {
-      HostAdapter = BusLogic_RegisteredHostAdapters[IRQ_Channel];
-      while (HostAdapter != NULL)
-       {
-         if (HostAdapter->HostNumber == HostNumber) break;
-         HostAdapter = HostAdapter->Next;
-       }
-      if (HostAdapter != NULL) break;
+      BusLogic_Error("Cannot find Host Adapter for SCSI Host %d\n",
+                    NULL, HostNumber);
+      return 0;
     }
-  if (HostAdapter == NULL) return -1;
-  TargetDeviceStatistics = HostAdapter->TargetDeviceStatistics;
+  TargetStatistics = HostAdapter->TargetStatistics;
   Buffer = HostAdapter->MessageBuffer;
   Length = HostAdapter->MessageBufferLength;
   Length += sprintf(&Buffer[Length], "\n\
@@ -4181,100 +4279,105 @@ Currently Allocated CCBs:     %d\n",
   Length += sprintf(&Buffer[Length], "\n\n\
                           DATA TRANSFER STATISTICS\n\
 \n\
-Target Tagged Queuing  Queue Depth  Commands Attempted  Commands Completed\n\
-====== ==============  ===========  ==================  ==================\n");
+Target Tagged Queuing  Queue Depth  Active  Attempted  Completed\n\
+====== ==============  ===========  ======  =========  =========\n");
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-    if (TargetDeviceStatistics[TargetID].CommandsCompleted > 0)
-      {
-       Length +=
-         sprintf(&Buffer[Length], "  %2d       %s", TargetID,
-                 (HostAdapter->TaggedQueuingSupported[TargetID]
-                  ? (HostAdapter->TaggedQueuingActive[TargetID]
-                     ? "    Active"
-                     : (HostAdapter->TaggedQueuingPermitted & (1 << TargetID)
-                        ? "  Permitted" : "   Disabled"))
-                  : "Not Supported"));
-       Length += sprintf(&Buffer[Length],
-                         "         %3d          %9u         %9u\n",
-                         HostAdapter->QueueDepth[TargetID],
-                         TargetDeviceStatistics[TargetID].CommandsAttempted,
-                         TargetDeviceStatistics[TargetID].CommandsCompleted);
-      }
+    {
+      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
+      if (!TargetFlags->TargetExists) continue;
+      Length +=
+       sprintf(&Buffer[Length], "  %2d %s", TargetID,
+               (TargetFlags->TaggedQueuingSupported
+                ? (TargetFlags->TaggedQueuingActive
+                   ? "    Active"
+                   : (HostAdapter->TaggedQueuingPermitted & (1 << TargetID)
+                      ? "  Permitted" : "   Disabled"))
+                : "Not Supported"));
+      Length += sprintf(&Buffer[Length],
+                       "           %3d       %3u    %9u        %9u\n",
+                       HostAdapter->QueueDepth[TargetID],
+                       HostAdapter->ActiveCommands[TargetID],
+                       TargetStatistics[TargetID].CommandsAttempted,
+                       TargetStatistics[TargetID].CommandsCompleted);
+    }
   Length += sprintf(&Buffer[Length], "\n\
 Target  Read Commands  Write Commands   Total Bytes Read    Total Bytes Written\n\
 ======  =============  ==============  ===================  ===================\n");
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-    if (TargetDeviceStatistics[TargetID].CommandsCompleted > 0)
-      {
+    {
+      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
+      if (!TargetFlags->TargetExists) continue;
+      Length +=
+       sprintf(&Buffer[Length], "  %2d   %9u    %9u", TargetID,
+               TargetStatistics[TargetID].ReadCommands,
+               TargetStatistics[TargetID].WriteCommands);
+      if (TargetStatistics[TargetID].TotalBytesRead.Billions > 0)
        Length +=
-         sprintf(&Buffer[Length], "  %2d         %9u    %9u", TargetID,
-                 TargetDeviceStatistics[TargetID].ReadCommands,
-                 TargetDeviceStatistics[TargetID].WriteCommands);
-       if (TargetDeviceStatistics[TargetID].TotalBytesRead.Billions > 0)
-         Length +=
-           sprintf(&Buffer[Length], "     %9u%09u",
-                   TargetDeviceStatistics[TargetID].TotalBytesRead.Billions,
-                   TargetDeviceStatistics[TargetID].TotalBytesRead.Units);
-       else
-         Length +=
-           sprintf(&Buffer[Length], "          %9u",
-                   TargetDeviceStatistics[TargetID].TotalBytesRead.Units);
-       if (TargetDeviceStatistics[TargetID].TotalBytesWritten.Billions > 0)
-         Length +=
-           sprintf(&Buffer[Length], "   %9u%09u\n",
-                   TargetDeviceStatistics[TargetID].TotalBytesWritten.Billions,
-                   TargetDeviceStatistics[TargetID].TotalBytesWritten.Units);
-       else
-         Length +=
-           sprintf(&Buffer[Length], "       %9u\n",
-                   TargetDeviceStatistics[TargetID].TotalBytesWritten.Units);
-      }
+         sprintf(&Buffer[Length], "     %9u%09u",
+                 TargetStatistics[TargetID].TotalBytesRead.Billions,
+                 TargetStatistics[TargetID].TotalBytesRead.Units);
+      else
+       Length +=
+         sprintf(&Buffer[Length], "            %9u",
+                 TargetStatistics[TargetID].TotalBytesRead.Units);
+      if (TargetStatistics[TargetID].TotalBytesWritten.Billions > 0)
+       Length +=
+         sprintf(&Buffer[Length], "   %9u%09u\n",
+                 TargetStatistics[TargetID].TotalBytesWritten.Billions,
+                 TargetStatistics[TargetID].TotalBytesWritten.Units);
+      else
+       Length +=
+         sprintf(&Buffer[Length], "         %9u\n",
+                 TargetStatistics[TargetID].TotalBytesWritten.Units);
+    }
   Length += sprintf(&Buffer[Length], "\n\
 Target  Command    0-1KB      1-2KB      2-4KB      4-8KB     8-16KB\n\
 ======  =======  =========  =========  =========  =========  =========\n");
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-    if (TargetDeviceStatistics[TargetID].CommandsCompleted > 0)
-      {
-       Length +=
-         sprintf(&Buffer[Length],
-                 "  %2d         Read    %9u  %9u  %9u  %9u  %9u\n", TargetID,
-                 TargetDeviceStatistics[TargetID].ReadCommandSizeBuckets[0],
-                 TargetDeviceStatistics[TargetID].ReadCommandSizeBuckets[1],
-                 TargetDeviceStatistics[TargetID].ReadCommandSizeBuckets[2],
-                 TargetDeviceStatistics[TargetID].ReadCommandSizeBuckets[3],
-                 TargetDeviceStatistics[TargetID].ReadCommandSizeBuckets[4]);
-       Length +=
-         sprintf(&Buffer[Length],
-                 "  %2d         Write   %9u  %9u  %9u  %9u  %9u\n", TargetID,
-                 TargetDeviceStatistics[TargetID].WriteCommandSizeBuckets[0],
-                 TargetDeviceStatistics[TargetID].WriteCommandSizeBuckets[1],
-                 TargetDeviceStatistics[TargetID].WriteCommandSizeBuckets[2],
-                 TargetDeviceStatistics[TargetID].WriteCommandSizeBuckets[3],
-                 TargetDeviceStatistics[TargetID].WriteCommandSizeBuckets[4]);
-      }
+    {
+      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
+      if (!TargetFlags->TargetExists) continue;
+      Length +=
+       sprintf(&Buffer[Length],
+               "  %2d   Read    %9u  %9u  %9u  %9u  %9u\n", TargetID,
+               TargetStatistics[TargetID].ReadCommandSizeBuckets[0],
+               TargetStatistics[TargetID].ReadCommandSizeBuckets[1],
+               TargetStatistics[TargetID].ReadCommandSizeBuckets[2],
+               TargetStatistics[TargetID].ReadCommandSizeBuckets[3],
+               TargetStatistics[TargetID].ReadCommandSizeBuckets[4]);
+      Length +=
+       sprintf(&Buffer[Length],
+               "  %2d   Write   %9u  %9u  %9u  %9u  %9u\n", TargetID,
+               TargetStatistics[TargetID].WriteCommandSizeBuckets[0],
+               TargetStatistics[TargetID].WriteCommandSizeBuckets[1],
+               TargetStatistics[TargetID].WriteCommandSizeBuckets[2],
+               TargetStatistics[TargetID].WriteCommandSizeBuckets[3],
+               TargetStatistics[TargetID].WriteCommandSizeBuckets[4]);
+    }
   Length += sprintf(&Buffer[Length], "\n\
 Target  Command   16-32KB    32-64KB   64-128KB   128-256KB   256KB+\n\
 ======  =======  =========  =========  =========  =========  =========\n");
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-    if (TargetDeviceStatistics[TargetID].CommandsCompleted > 0)
-      {
-       Length +=
-         sprintf(&Buffer[Length],
-                 "  %2d         Read    %9u  %9u  %9u  %9u  %9u\n", TargetID,
-                 TargetDeviceStatistics[TargetID].ReadCommandSizeBuckets[5],
-                 TargetDeviceStatistics[TargetID].ReadCommandSizeBuckets[6],
-                 TargetDeviceStatistics[TargetID].ReadCommandSizeBuckets[7],
-                 TargetDeviceStatistics[TargetID].ReadCommandSizeBuckets[8],
-                 TargetDeviceStatistics[TargetID].ReadCommandSizeBuckets[9]);
-       Length +=
-         sprintf(&Buffer[Length],
-                 "  %2d         Write   %9u  %9u  %9u  %9u  %9u\n", TargetID,
-                 TargetDeviceStatistics[TargetID].WriteCommandSizeBuckets[5],
-                 TargetDeviceStatistics[TargetID].WriteCommandSizeBuckets[6],
-                 TargetDeviceStatistics[TargetID].WriteCommandSizeBuckets[7],
-                 TargetDeviceStatistics[TargetID].WriteCommandSizeBuckets[8],
-                 TargetDeviceStatistics[TargetID].WriteCommandSizeBuckets[9]);
-      }
+    {
+      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
+      if (!TargetFlags->TargetExists) continue;
+      Length +=
+       sprintf(&Buffer[Length],
+               "  %2d   Read    %9u  %9u  %9u  %9u  %9u\n", TargetID,
+               TargetStatistics[TargetID].ReadCommandSizeBuckets[5],
+               TargetStatistics[TargetID].ReadCommandSizeBuckets[6],
+               TargetStatistics[TargetID].ReadCommandSizeBuckets[7],
+               TargetStatistics[TargetID].ReadCommandSizeBuckets[8],
+               TargetStatistics[TargetID].ReadCommandSizeBuckets[9]);
+      Length +=
+       sprintf(&Buffer[Length],
+               "  %2d   Write   %9u  %9u  %9u  %9u  %9u\n", TargetID,
+               TargetStatistics[TargetID].WriteCommandSizeBuckets[5],
+               TargetStatistics[TargetID].WriteCommandSizeBuckets[6],
+               TargetStatistics[TargetID].WriteCommandSizeBuckets[7],
+               TargetStatistics[TargetID].WriteCommandSizeBuckets[8],
+               TargetStatistics[TargetID].WriteCommandSizeBuckets[9]);
+    }
   Length += sprintf(&Buffer[Length], "\n\n\
                           ERROR RECOVERY STATISTICS\n\
 \n\
@@ -4283,21 +4386,26 @@ Target  Requested Completed  Requested Completed  Requested Completed\n\
   ID   \\\\\\\\ Attempted ////  \\\\\\\\ Attempted ////  \\\\\\\\ Attempted ////\n\
 ======  ===== ===== =====    ===== ===== =====    ===== ===== =====\n");
   for (TargetID = 0; TargetID < HostAdapter->MaxTargetDevices; TargetID++)
-    if (TargetDeviceStatistics[TargetID].CommandsCompleted > 0)
+    {
+      BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[TargetID];
+      if (!TargetFlags->TargetExists) continue;
       Length +=
        sprintf(&Buffer[Length], "\
   %2d   %5d %5d %5d    %5d %5d %5d        %5d %5d %5d\n", TargetID,
-               TargetDeviceStatistics[TargetID].CommandAbortsRequested,
-               TargetDeviceStatistics[TargetID].CommandAbortsAttempted,
-               TargetDeviceStatistics[TargetID].CommandAbortsCompleted,
-               TargetDeviceStatistics[TargetID].BusDeviceResetsRequested,
-               TargetDeviceStatistics[TargetID].BusDeviceResetsAttempted,
-               TargetDeviceStatistics[TargetID].BusDeviceResetsCompleted,
-               TargetDeviceStatistics[TargetID].HostAdapterResetsRequested,
-               TargetDeviceStatistics[TargetID].HostAdapterResetsAttempted,
-               TargetDeviceStatistics[TargetID].HostAdapterResetsCompleted);
+               TargetStatistics[TargetID].CommandAbortsRequested,
+               TargetStatistics[TargetID].CommandAbortsAttempted,
+               TargetStatistics[TargetID].CommandAbortsCompleted,
+               TargetStatistics[TargetID].BusDeviceResetsRequested,
+               TargetStatistics[TargetID].BusDeviceResetsAttempted,
+               TargetStatistics[TargetID].BusDeviceResetsCompleted,
+               TargetStatistics[TargetID].HostAdapterResetsRequested,
+               TargetStatistics[TargetID].HostAdapterResetsAttempted,
+               TargetStatistics[TargetID].HostAdapterResetsCompleted);
+    }
   Length += sprintf(&Buffer[Length], "\nExternal Host Adapter Resets: %d\n",
                    HostAdapter->ExternalHostAdapterResets);
+  Length += sprintf(&Buffer[Length], "Host Adapter Internal Errors: %d\n",
+                   HostAdapter->HostAdapterInternalErrors);
   if (Length >= BusLogic_MessageBufferSize)
     BusLogic_Error("Message Buffer length %d exceeds size %d\n",
                   HostAdapter, Length, BusLogic_MessageBufferSize);
@@ -4339,17 +4447,22 @@ static void BusLogic_Message(BusLogic_MessageLevel_T MessageLevel,
             Buffer);
       HostAdapter->MessageBufferLength += Length;
       if (BeginningOfLine)
-       printk("%sscsi%d: %s", BusLogic_MessageLevelMap[MessageLevel],
-              HostAdapter->HostNumber, Buffer);
+       {
+         if (Buffer[0] != '\n' || Length > 1)
+           printk("%sscsi%d: %s", BusLogic_MessageLevelMap[MessageLevel],
+                  HostAdapter->HostNumber, Buffer);
+       }
       else printk("%s", Buffer);
     }
   else
     {
       if (BeginningOfLine)
-       if (HostAdapter != NULL && HostAdapter->HostAdapterInitialized)
-         printk("%sscsi%d: %s", BusLogic_MessageLevelMap[MessageLevel],
-                HostAdapter->HostNumber, Buffer);
-       else printk("%s%s", BusLogic_MessageLevelMap[MessageLevel], Buffer);
+       {
+         if (HostAdapter != NULL && HostAdapter->HostAdapterInitialized)
+           printk("%sscsi%d: %s", BusLogic_MessageLevelMap[MessageLevel],
+                  HostAdapter->HostNumber, Buffer);
+         else printk("%s%s", BusLogic_MessageLevelMap[MessageLevel], Buffer);
+       }
       else printk("%s", Buffer);
     }
   BeginningOfLine = (Buffer[Length-1] == '\n');
@@ -4357,364 +4470,548 @@ static void BusLogic_Message(BusLogic_MessageLevel_T MessageLevel,
 
 
 /*
-  BusLogic_Setup handles processing of Kernel Command Line Arguments.
+  BusLogic_ParseKeyword parses an individual option keyword.  It returns true
+  and updates the pointer if the keyword is recognized and false otherwise.
+*/
 
-  For the BusLogic driver, a Kernel Command Line Entry comprises the driver
-  identifier "BusLogic=" optionally followed by a comma-separated sequence of
-  integers and then optionally followed by a comma-separated sequence of
-  strings.  Each command line entry applies to one BusLogic Host Adapter.
-  Multiple command line entries may be used in systems which contain multiple
-  BusLogic Host Adapters.
+static boolean BusLogic_ParseKeyword(char **StringPointer, char *Keyword)
+{
+  char *Pointer = *StringPointer;
+  while (*Keyword != '\0')
+    {
+      char StringChar = *Pointer++;
+      char KeywordChar = *Keyword++;
+      if (StringChar >= 'A' && StringChar <= 'Z')
+       StringChar += 'a' - 'Z';
+      if (KeywordChar >= 'A' && KeywordChar <= 'Z')
+       KeywordChar += 'a' - 'Z';
+      if (StringChar != KeywordChar) return false;
+    }
+  *StringPointer = Pointer;
+  return true;
+}
 
-  The first integer specified is the I/O Address at which the Host Adapter is
-  located.  If unspecified, it defaults to 0 which means to apply this entry to
-  the first BusLogic Host Adapter found during the default probe sequence.  If
-  any I/O Address parameters are provided on the command line, then the default
-  probe sequence is omitted.
-
-  The second integer specified is the Tagged Queue Depth to use for Target
-  Devices that support Tagged Queuing.  The Queue Depth is the number of SCSI
-  commands that are allowed to be concurrently presented for execution.  If
-  unspecified, it defaults to 0 which means to use a value determined
-  automatically based on the Host Adapter's Total Queue Depth and the number,
-  type, speed, and capabilities of the detected Target Devices.  For Host
-  Adapters that require ISA Bounce Buffers, the Tagged Queue Depth is
-  automatically set to BusLogic_TaggedQueueDepthBounceBuffers to avoid
-  excessive preallocation of DMA Bounce Buffer memory.  Target Devices that do
-  not support Tagged Queuing use a Queue Depth of BusLogic_UntaggedQueueDepth.
-
-  The third integer specified is the Bus Settle Time in seconds.  This is
-  the amount of time to wait between a Host Adapter Hard Reset which initiates
-  a SCSI Bus Reset and issuing any SCSI Commands.  If unspecified, it defaults
-  to 0 which means to use the value of BusLogic_DefaultBusSettleTime.
-
-  The fourth integer specified is the Local Options.  If unspecified, it
-  defaults to 0.  Note that Local Options are only applied to a specific Host
-  Adapter.
-
-  The fifth integer specified is the Global Options.  If unspecified, it
-  defaults to 0.  Note that Global Options are applied across all Host
-  Adapters.
 
-  The string options are used to provide control over Tagged Queuing, Error
-  Recovery, and Host Adapter Probing.
-
-  The Tagged Queuing specification begins with "TQ:" and allows for explicitly
-  specifying whether Tagged Queuing is permitted on Target Devices that support
-  it.  The following specification options are available:
-
-  TQ:Default           Tagged Queuing will be permitted based on the firmware
-                       version of the BusLogic Host Adapter and based on
-                       whether the Tagged Queue Depth value allows queuing
-                       multiple commands.
-
-  TQ:Enable            Tagged Queuing will be enabled for all Target Devices
-                       on this Host Adapter overriding any limitation that
-                       would otherwise be imposed based on the Host Adapter
-                       firmware version.
-
-  TQ:Disable           Tagged Queuing will be disabled for all Target Devices
-                       on this Host Adapter.
-
-  TQ:<Per-Target-Spec> Tagged Queuing will be controlled individually for each
-                       Target Device.  <Per-Target-Spec> is a sequence of "Y",
-                       "N", and "X" characters.  "Y" enabled Tagged Queuing,
-                       "N" disables Tagged Queuing, and "X" accepts the
-                       default based on the firmware version.  The first
-                       character refers to Target Device 0, the second to
-                       Target Device 1, and so on; if the sequence of "Y",
-                       "N", and "X" characters does not cover all the Target
-                       Devices, unspecified characters are assumed to be "X".
-
-  Note that explicitly requesting Tagged Queuing may lead to problems; this
-  facility is provided primarily to allow disabling Tagged Queuing on Target
-  Devices that do not implement it correctly.
-
-  The Error Recovery Strategy specification begins with "ER:" and allows for
-  explicitly specifying the Error Recovery action to be performed when
-  ResetCommand is called due to a SCSI Command failing to complete
-  successfully.  The following specification options are available:
-
-  ER:Default           Error Recovery will select between the Hard Reset and
-                       Bus Device Reset options based on the recommendation
-                       of the SCSI Subsystem.
-
-  ER:HardReset         Error Recovery will initiate a Host Adapter Hard Reset
-                       which also causes a SCSI Bus Reset.
-
-  ER:BusDeviceReset    Error Recovery will send a Bus Device Reset message to
-                       the individual Target Device causing the error.  If
-                       Error Recovery is again initiated for this Target
-                       Device and no SCSI Command to this Target Device has
-                       completed successfully since the Bus Device Reset
-                       message was sent, then a Hard Reset will be attempted.
-
-  ER:None              Error Recovery will be suppressed.  This option should
-                       only be selected if a SCSI Bus Reset or Bus Device
-                       Reset will cause the Target Device to fail completely
-                       and unrecoverably.
-
-  ER:<Per-Target-Spec> Error Recovery will be controlled individually for each
-                       Target Device.  <Per-Target-Spec> is a sequence of "D",
-                       "H", "B", and "N" characters.  "D" selects Default, "H"
-                       selects Hard Reset, "B" selects Bus Device Reset, and
-                       "N" selects None.  The first character refers to Target
-                       Device 0, the second to Target Device 1, and so on; if
-                       the sequence of "D", "H", "B", and "N" characters does
-                       not cover all the possible Target Devices, unspecified
-                       characters are assumed to be "D".
-
-  The Host Adapter Probing specification comprises the following strings:
-
-  NoProbe              No probing of any kind is to be performed, and hence
-                       no BusLogic Host Adapters will be detected.
-
-  NoProbeISA           No probing of the standard ISA I/O Addresses will
-                       be done, and hence only PCI MultiMaster and FlashPoint
-                       Host Adapters will be detected.
-
-  NoProbePCI           No interrogation of PCI Configuration Space will be
-                       made, and hence only ISA Multimaster Host Adapters
-                       will be detected, as well as PCI Multimaster Host
-                       Adapters that have their ISA Compatible I/O Port
-                       set to "Primary" or "Alternate".
-
-  NoSortPCI            PCI MultiMaster Host Adapters will be enumerated in
-                       the order provided by the PCI BIOS, ignoring any
-                       setting of the AutoSCSI "Use Bus And Device # For PCI
-                       Scanning Seq." option.
-
-  MultiMasterFirst     By default, if both FlashPoint and PCI MultiMaster
-                       Host Adapters are present, this driver will probe for
-                       FlashPoint Host Adapters first unless the BIOS primary
-                       disk is controlled by the first PCI MultiMaster Host
-                       Adapter, in which case MultiMaster Host Adapters will
-                       be probed first.  This option forces MultiMaster Host
-                       Adapters to be probed first.
-
-  FlashPointFirst      By default, if both FlashPoint and PCI MultiMaster
-                       Host Adapters are present, this driver will probe for
-                       FlashPoint Host Adapters first unless the BIOS primary
-                       disk is controlled by the first PCI MultiMaster Host
-                       Adapter, in which case MultiMaster Host Adapters will
-                       be probed first.  This option forces FlashPoint Host
-                       Adapters to be probed first.
-
-  Debug                        Sets all the tracing bits in BusLogic_GlobalOptions.
+/*
+  BusLogic_ParseDriverOptions handles processing of BusLogic Driver Options
+  specifications.
+
+  BusLogic Driver Options may be specified either via the Linux Kernel Command
+  Line or via the Loadable Kernel Module Installation Facility.  Driver Options
+  for multiple host adapters may be specified either by separating the option
+  strings by a semicolon, or by specifying multiple "BusLogic=" strings on the
+  command line.  Individual option specifications for a single host adapter are
+  separated by commas.  The Probing and Debugging Options apply to all host
+  adapters whereas the remaining options apply individually only to the
+  selected host adapter.
+
+  The BusLogic Driver Probing Options comprise the following:
+
+  IO:<integer>
+
+    The "IO:" option specifies an ISA I/O Address to be probed for a non-PCI
+    MultiMaster Host Adapter.  If neither "IO:" nor "NoProbeISA" options are
+    specified, then the standard list of BusLogic MultiMaster ISA I/O Addresses
+    will be probed (0x330, 0x334, 0x230, 0x234, 0x130, and 0x134).  Multiple
+    "IO:" options may be specified to precisely determine the I/O Addresses to
+    be probed, but the probe order will always follow the standard list.
+
+  NoProbe
+
+    The "NoProbe" option disables all probing and therefore no BusLogic Host
+    Adapters will be detected.
+
+  NoProbeISA
+
+    The "NoProbeISA" option disables probing of the standard BusLogic ISA I/O
+    Addresses and therefore only PCI MultiMaster and FlashPoint Host Adapters
+    will be detected.
+
+  NoProbePCI
+
+    The "NoProbePCI" options disables the interrogation of PCI Configuration
+    Space and therefore only ISA Multimaster Host Adapters will be detected, as
+    well as PCI Multimaster Host Adapters that have their ISA Compatible I/O
+    Port set to "Primary" or "Alternate".
+
+  NoSortPCI
+
+    The "NoSortPCI" option forces PCI MultiMaster Host Adapters to be
+    enumerated in the order provided by the PCI BIOS, ignoring any setting of
+    the AutoSCSI "Use Bus And Device # For PCI Scanning Seq." option.
+
+  MultiMasterFirst
+
+    The "MultiMasterFirst" option forces MultiMaster Host Adapters to be probed
+    before FlashPoint Host Adapters.  By default, if both FlashPoint and PCI
+    MultiMaster Host Adapters are present, this driver will probe for
+    FlashPoint Host Adapters first unless the BIOS primary disk is controlled
+    by the first PCI MultiMaster Host Adapter, in which case MultiMaster Host
+    Adapters will be probed first.
+
+  FlashPointFirst
+
+    The "FlashPointFirst" option forces FlashPoint Host Adapters to be probed
+    before MultiMaster Host Adapters.
+
+  The BusLogic Driver Tagged Queuing Options allow for explicitly specifying
+  the Queue Depth and whether Tagged Queuing is permitted for each Target
+  Device (assuming that the Target Device supports Tagged Queuing).  The Queue
+  Depth is the number of SCSI Commands that are allowed to be concurrently
+  presented for execution (either to the Host Adapter or Target Device).  Note
+  that explicitly enabling Tagged Queuing may lead to problems; the option to
+  enable or disable Tagged Queuing is provided primarily to allow disabling
+  Tagged Queuing on Target Devices that do not implement it correctly.  The
+  following options are available:
+
+  QueueDepth:<integer>
+
+    The "QueueDepth:" or QD:" option specifies the Queue Depth to use for all
+    Target Devices that support Tagged Queuing.  If no Queue Depth option is
+    provided, the Queue Depth will be determined automatically based on the
+    Host Adapter's Total Queue Depth and the number, type, speed, and
+    capabilities of the detected Target Devices.  For Host Adapters that
+    require ISA Bounce Buffers, the Queue Depth is automatically set by default
+    to BusLogic_QueueDepthBounceBuffers to avoid excessive preallocation of DMA
+    Bounce Buffer memory.  Target Devices that do not support Tagged Queuing
+    always use a Queue Depth of BusLogic_UntaggedQueueDepth.
+
+  QueueDepth:[<integer>,<integer>...]
+
+    The "QueueDepth:[...]" or "QD:[...]" option specifies the Queue Depth
+    individually for each Target Device.  If an <integer> is omitted, the
+    associated Target Device will have its Queue Depth selected automatically.
+
+  TaggedQueuing:Default
+
+    The "TaggedQueuing:Default" or "TQ:Default" option permits Tagged Queuing
+    based on the firmware version of the BusLogic Host Adapter and based on
+    whether the Queue Depth allows queuing multiple commands.
+
+  TaggedQueuing:Enable
+
+    The "TaggedQueuing:Enable" or "TQ:Enable" option enables Tagged Queuing for
+    all Target Devices on this Host Adapter, overriding any limitation that
+    would otherwise be imposed based on the Host Adapter firmware version.
+
+  TaggedQueuing:Disable
+
+    The "TaggedQueuing:Disable" or "TQ:Disable" option disables Tagged Queuing
+    for all Target Devices on this Host Adapter.
+
+  TaggedQueuing:<Target-Spec>
+
+    The "TaggedQueuing:<Target-Spec>" or "TQ:<Target-Spec>" option controls
+    Tagged Queuing individually for each Target Device.  <Target-Spec> is a
+    sequence of "Y", "N", and "X" characters.  "Y" enables Tagged Queuing, "N"
+    disables Tagged Queuing, and "X" accepts the default based on the firmware
+    version.  The first character refers to Target Device 0, the second to
+    Target Device 1, and so on; if the sequence of "Y", "N", and "X" characters
+    does not cover all the Target Devices, unspecified characters are assumed
+    to be "X".
+
+  The BusLogic Driver Error Recovery Option allows for explicitly specifying
+  the Error Recovery action to be performed when BusLogic_ResetCommand is
+  called due to a SCSI Command failing to complete successfully.  The following
+  options are available:
+
+  ErrorRecovery:Default
+
+    The "ErrorRecovery:Default" or "ER:Default" option selects between the Hard
+    Reset and Bus Device Reset options based on the recommendation of the SCSI
+    Subsystem.
+
+  ErrorRecovery:HardReset
+
+    The "ErrorRecovery:HardReset" or "ER:HardReset" option will initiate a Host
+    Adapter Hard Reset which also causes a SCSI Bus Reset.
+
+  ErrorRecovery:BusDeviceReset
+
+    The "ErrorRecovery:BusDeviceReset" or "ER:BusDeviceReset" option will send
+    a Bus Device Reset message to the individual Target Device causing the
+    error.  If Error Recovery is again initiated for this Target Device and no
+    SCSI Command to this Target Device has completed successfully since the Bus
+    Device Reset message was sent, then a Hard Reset will be attempted.
+
+  ErrorRecovery:None
+
+    The "ErrorRecovery:None" or "ER:None" option suppresses Error Recovery.
+    This option should only be selected if a SCSI Bus Reset or Bus Device Reset
+    will cause the Target Device or a critical operation to suffer a complete
+    and unrecoverable failure.
+
+  ErrorRecovery:<Target-Spec>
+
+    The "ErrorRecovery:<Target-Spec>" or "ER:<Target-Spec>" option controls
+    Error Recovery individually for each Target Device.  <Target-Spec> is a
+    sequence of "D", "H", "B", and "N" characters.  "D" selects Default, "H"
+    selects Hard Reset, "B" selects Bus Device Reset, and "N" selects None.
+    The first character refers to Target Device 0, the second to Target Device
+    1, and so on; if the sequence of "D", "H", "B", and "N" characters does not
+    cover all the possible Target Devices, unspecified characters are assumed
+    to be "D".
+
+  The BusLogic Driver Miscellaneous Options comprise the following:
+
+  BusSettleTime:<seconds>
+
+    The "BusSettleTime:" or "BST:" option specifies the Bus Settle Time in
+    seconds.  The Bus Settle Time is the amount of time to wait between a Host
+    Adapter Hard Reset which initiates a SCSI Bus Reset and issuing any SCSI
+    Commands.  If unspecified, it defaults to BusLogic_DefaultBusSettleTime.
+
+  InhibitTargetInquiry
+
+    The "InhibitTargetInquiry" option inhibits the execution of an Inquire
+    Target Devices or Inquire Installed Devices command on MultiMaster Host
+    Adapters.  This may be necessary with some older Target Devices that do not
+    respond correctly when Logical Units above 0 are addressed.
+
+  The BusLogic Driver Debugging Options comprise the following:
+
+  TraceProbe
+
+    The "TraceProbe" option enables tracing of Host Adapter Probing.
+
+  TraceHardwareReset
+
+    The "TraceHardwareReset" option enables tracing of Host Adapter Hardware
+    Reset.
+
+  TraceConfiguration
+
+    The "TraceConfiguration" option enables tracing of Host Adapter
+    Configuration.
+
+  TraceErrors
+
+    The "TraceErrors" option enables tracing of SCSI Commands that return an
+    error from the Target Device.  The CDB and Sense Data will be printed for
+    each SCSI Command that fails.
+
+  Debug
+
+    The "Debug" option enables all debugging options.
+
+  The following examples demonstrate setting the Queue Depth for Target Devices
+  1 and 2 on the first host adapter to 7 and 15, the Queue Depth for all Target
+  Devices on the second host adapter to 31, and the Bus Settle Time on the
+  second host adapter to 30 seconds.
+
+  Linux Kernel Command Line:
+
+    linux BusLogic=QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30
+
+  LILO Linux Boot Loader (in /etc/lilo.conf):
+
+    append = "BusLogic=QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30"
+
+  INSMOD Loadable Kernel Module Installation Facility:
+
+    insmod BusLogic.o \
+       'BusLogic_Options="QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30"'
+
+  NOTE: Module Utilities 2.1.71 or later is required for correct parsing
+       of driver options containing commas.
 
 */
 
-void BusLogic_Setup(char *Strings, int *Integers)
+static void BusLogic_ParseDriverOptions(char *OptionsString)
 {
-  BusLogic_CommandLineEntry_T *CommandLineEntry =
-    &BusLogic_CommandLineEntries[BusLogic_CommandLineEntryCount++];
-  int IntegerCount = Integers[0];
-  int TargetID, i;
-  CommandLineEntry->IO_Address = 0;
-  CommandLineEntry->TaggedQueueDepth = 0;
-  CommandLineEntry->BusSettleTime = 0;
-  CommandLineEntry->TaggedQueuingPermitted = 0;
-  CommandLineEntry->TaggedQueuingPermittedMask = 0;
-  CommandLineEntry->LocalOptions.All = 0;
-  memset(CommandLineEntry->ErrorRecoveryStrategy,
-        BusLogic_ErrorRecovery_Default,
-        sizeof(CommandLineEntry->ErrorRecoveryStrategy));
-  if (IntegerCount > 5)
-    BusLogic_Error("BusLogic: Unexpected Command Line Integers "
-                  "ignored\n", NULL);
-  if (IntegerCount >= 1)
+  while (true)
     {
-      BusLogic_IO_Address_T IO_Address = Integers[1];
-      if (IO_Address > 0)
+      BusLogic_DriverOptions_T *DriverOptions =
+       &BusLogic_DriverOptions[BusLogic_DriverOptionsCount++];
+      int TargetID;
+      memset(DriverOptions, 0, sizeof(BusLogic_DriverOptions_T));
+      for (TargetID = 0; TargetID < BusLogic_MaxTargetDevices; TargetID++)
+       DriverOptions->ErrorRecoveryStrategy[TargetID] =
+         BusLogic_ErrorRecovery_Default;
+      while (*OptionsString != '\0' && *OptionsString != ';')
        {
-         BusLogic_ProbeInfo_T *ProbeInfo;
-         for (i = 0; ; i++)
-           if (BusLogic_ISA_StandardAddresses[i] == 0)
-             {
-               BusLogic_Error("BusLogic: Invalid Command Line Entry "
-                              "(illegal I/O Address 0x%X)\n",
-                              NULL, IO_Address);
-               return;
-             }
-           else if (i < BusLogic_ProbeInfoCount &&
-                    IO_Address == BusLogic_ProbeInfoList[i].IO_Address)
-             {
-               BusLogic_Error("BusLogic: Invalid Command Line Entry "
-                              "(duplicate I/O Address 0x%X)\n",
-                              NULL, IO_Address);
-               return;
-             }
-           else if (IO_Address >= 0x400 ||
-                    IO_Address == BusLogic_ISA_StandardAddresses[i]) break;
-         ProbeInfo = &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount++];
-         ProbeInfo->HostAdapterType = BusLogic_MultiMaster;
-         ProbeInfo->HostAdapterBusType = BusLogic_ISA_Bus;
+         /* Probing Options. */
+         if (BusLogic_ParseKeyword(&OptionsString, "IO:"))
+           {
+             BusLogic_IO_Address_T IO_Address =
+               simple_strtoul(OptionsString, &OptionsString, 0);
+             BusLogic_ProbeOptions.LimitedProbeISA = true;
+             switch (IO_Address)
+               {
+               case 0x330:
+                 BusLogic_ProbeOptions.Probe330 = true;
+                 break;
+               case 0x334:
+                 BusLogic_ProbeOptions.Probe334 = true;
+                 break;
+               case 0x230:
+                 BusLogic_ProbeOptions.Probe230 = true;
+                 break;
+               case 0x234:
+                 BusLogic_ProbeOptions.Probe234 = true;
+                 break;
+               case 0x130:
+                 BusLogic_ProbeOptions.Probe130 = true;
+                 break;
+               case 0x134:
+                 BusLogic_ProbeOptions.Probe134 = true;
+                 break;
+               default:
+                 BusLogic_Error("BusLogic: Invalid Driver Options "
+                                "(illegal I/O Address 0x%X)\n",
+                                NULL, IO_Address);
+                 return;
+               }
+           }
+         else if (BusLogic_ParseKeyword(&OptionsString, "NoProbeISA"))
+           BusLogic_ProbeOptions.NoProbeISA = true;
+         else if (BusLogic_ParseKeyword(&OptionsString, "NoProbePCI"))
+           BusLogic_ProbeOptions.NoProbePCI = true;
+         else if (BusLogic_ParseKeyword(&OptionsString, "NoProbe"))
+           BusLogic_ProbeOptions.NoProbe = true;
+         else if (BusLogic_ParseKeyword(&OptionsString, "NoSortPCI"))
+           BusLogic_ProbeOptions.NoSortPCI = true;
+         else if (BusLogic_ParseKeyword(&OptionsString, "MultiMasterFirst"))
+           BusLogic_ProbeOptions.MultiMasterFirst = true;
+         else if (BusLogic_ParseKeyword(&OptionsString, "FlashPointFirst"))
+           BusLogic_ProbeOptions.FlashPointFirst = true;
+         /* Tagged Queuing Options. */
+         else if (BusLogic_ParseKeyword(&OptionsString, "QueueDepth:[") ||
+                  BusLogic_ParseKeyword(&OptionsString, "QD:["))
+           {
+             for (TargetID = 0;
+                  TargetID < BusLogic_MaxTargetDevices;
+                  TargetID++)
+               {
+                 unsigned short QueueDepth =
+                   simple_strtoul(OptionsString, &OptionsString, 0);
+                 if (QueueDepth > BusLogic_MaxTaggedQueueDepth)
+                   {
+                     BusLogic_Error("BusLogic: Invalid Driver Options "
+                                    "(illegal Queue Depth %d)\n",
+                                    NULL, QueueDepth);
+                     return;
+                   }
+                 DriverOptions->QueueDepth[TargetID] = QueueDepth;
+                 if (*OptionsString == ',')
+                   OptionsString++;
+                 else if (*OptionsString == ']')
+                   break;
+                 else
+                   {
+                     BusLogic_Error("BusLogic: Invalid Driver Options "
+                                    "(',' or ']' expected at '%s')\n",
+                                    NULL, OptionsString);
+                     return;
+                   }
+               }
+             if (*OptionsString != ']')
+               {
+                 BusLogic_Error("BusLogic: Invalid Driver Options "
+                                "(']' expected at '%s')\n",
+                                NULL, OptionsString);
+                 return;
+               }
+             else OptionsString++;
+           }
+         else if (BusLogic_ParseKeyword(&OptionsString, "QueueDepth:") ||
+                  BusLogic_ParseKeyword(&OptionsString, "QD:"))
+           {
+             unsigned short QueueDepth =
+               simple_strtoul(OptionsString, &OptionsString, 0);
+             if (QueueDepth == 0 || QueueDepth > BusLogic_MaxTaggedQueueDepth)
+               {
+                 BusLogic_Error("BusLogic: Invalid Driver Options "
+                                "(illegal Queue Depth %d)\n",
+                                NULL, QueueDepth);
+                 return;
+               }
+             for (TargetID = 0;
+                  TargetID < BusLogic_MaxTargetDevices;
+                  TargetID++)
+               DriverOptions->QueueDepth[TargetID] = QueueDepth;
+           }
+         else if (BusLogic_ParseKeyword(&OptionsString, "TaggedQueuing:") ||
+                  BusLogic_ParseKeyword(&OptionsString, "TQ:"))
+           {
+             if (BusLogic_ParseKeyword(&OptionsString, "Default"))
+               {
+                 DriverOptions->TaggedQueuingPermitted = 0x0000;
+                 DriverOptions->TaggedQueuingPermittedMask = 0x0000;
+               }
+             else if (BusLogic_ParseKeyword(&OptionsString, "Enable"))
+               {
+                 DriverOptions->TaggedQueuingPermitted = 0xFFFF;
+                 DriverOptions->TaggedQueuingPermittedMask = 0xFFFF;
+               }
+             else if (BusLogic_ParseKeyword(&OptionsString, "Disable"))
+               {
+                 DriverOptions->TaggedQueuingPermitted = 0x0000;
+                 DriverOptions->TaggedQueuingPermittedMask = 0xFFFF;
+               }
+             else
+               {
+                 unsigned short TargetBit;
+                 for (TargetID = 0, TargetBit = 1;
+                      TargetID < BusLogic_MaxTargetDevices;
+                      TargetID++, TargetBit <<= 1)
+                   switch (*OptionsString++)
+                     {
+                     case 'Y':
+                       DriverOptions->TaggedQueuingPermitted |= TargetBit;
+                       DriverOptions->TaggedQueuingPermittedMask |= TargetBit;
+                       break;
+                     case 'N':
+                       DriverOptions->TaggedQueuingPermitted &= ~TargetBit;
+                       DriverOptions->TaggedQueuingPermittedMask |= TargetBit;
+                       break;
+                     case 'X':
+                       break;
+                     default:
+                       OptionsString--;
+                       TargetID = BusLogic_MaxTargetDevices;
+                       break;
+                     }
+               }
+           }
+         /* Error Recovery Option. */
+         else if (BusLogic_ParseKeyword(&OptionsString, "ErrorRecovery:") ||
+                  BusLogic_ParseKeyword(&OptionsString, "ER:"))
+           {
+             if (BusLogic_ParseKeyword(&OptionsString, "Default"))
+               for (TargetID = 0;
+                    TargetID < BusLogic_MaxTargetDevices;
+                    TargetID++)
+                 DriverOptions->ErrorRecoveryStrategy[TargetID] =
+                   BusLogic_ErrorRecovery_Default;
+             else if (BusLogic_ParseKeyword(&OptionsString, "HardReset"))
+               for (TargetID = 0;
+                    TargetID < BusLogic_MaxTargetDevices;
+                    TargetID++)
+                 DriverOptions->ErrorRecoveryStrategy[TargetID] =
+                   BusLogic_ErrorRecovery_HardReset;
+             else if (BusLogic_ParseKeyword(&OptionsString, "BusDeviceReset"))
+               for (TargetID = 0;
+                    TargetID < BusLogic_MaxTargetDevices;
+                    TargetID++)
+                 DriverOptions->ErrorRecoveryStrategy[TargetID] =
+                   BusLogic_ErrorRecovery_BusDeviceReset;
+             else if (BusLogic_ParseKeyword(&OptionsString, "None"))
+               for (TargetID = 0;
+                    TargetID < BusLogic_MaxTargetDevices;
+                    TargetID++)
+                 DriverOptions->ErrorRecoveryStrategy[TargetID] =
+                   BusLogic_ErrorRecovery_None;
+             else
+               for (TargetID = 0;
+                    TargetID < BusLogic_MaxTargetDevices;
+                    TargetID++)
+                 switch (*OptionsString++)
+                   {
+                   case 'D':
+                     DriverOptions->ErrorRecoveryStrategy[TargetID] =
+                       BusLogic_ErrorRecovery_Default;
+                     break;
+                   case 'H':
+                     DriverOptions->ErrorRecoveryStrategy[TargetID] =
+                       BusLogic_ErrorRecovery_HardReset;
+                     break;
+                   case 'B':
+                     DriverOptions->ErrorRecoveryStrategy[TargetID] =
+                       BusLogic_ErrorRecovery_BusDeviceReset;
+                     break;
+                   case 'N':
+                     DriverOptions->ErrorRecoveryStrategy[TargetID] =
+                       BusLogic_ErrorRecovery_None;
+                     break;
+                   default:
+                     OptionsString--;
+                     TargetID = BusLogic_MaxTargetDevices;
+                     break;
+                   }
+           }
+         /* Miscellaneous Options. */
+         else if (BusLogic_ParseKeyword(&OptionsString, "BusSettleTime:") ||
+                  BusLogic_ParseKeyword(&OptionsString, "BST:"))
+           {
+             unsigned short BusSettleTime =
+               simple_strtoul(OptionsString, &OptionsString, 0);
+             if (BusSettleTime > 5 * 60)
+               {
+                 BusLogic_Error("BusLogic: Invalid Driver Options "
+                                "(illegal Bus Settle Time %d)\n",
+                                NULL, BusSettleTime);
+                 return;
+               }
+             DriverOptions->BusSettleTime = BusSettleTime;
+           }
+         else if (BusLogic_ParseKeyword(&OptionsString,
+                                        "InhibitTargetInquiry"))
+           DriverOptions->LocalOptions.InhibitTargetInquiry = true;
+         /* Debugging Options. */
+         else if (BusLogic_ParseKeyword(&OptionsString, "TraceProbe"))
+             BusLogic_GlobalOptions.TraceProbe = true;
+         else if (BusLogic_ParseKeyword(&OptionsString, "TraceHardwareReset"))
+             BusLogic_GlobalOptions.TraceHardwareReset = true;
+         else if (BusLogic_ParseKeyword(&OptionsString, "TraceConfiguration"))
+             BusLogic_GlobalOptions.TraceConfiguration = true;
+         else if (BusLogic_ParseKeyword(&OptionsString, "TraceErrors"))
+             BusLogic_GlobalOptions.TraceErrors = true;
+         else if (BusLogic_ParseKeyword(&OptionsString, "Debug"))
+           {
+             BusLogic_GlobalOptions.TraceProbe = true;
+             BusLogic_GlobalOptions.TraceHardwareReset = true;
+             BusLogic_GlobalOptions.TraceConfiguration = true;
+             BusLogic_GlobalOptions.TraceErrors = true;
+           }
+         if (*OptionsString == ',')
+           OptionsString++;
+         else if (*OptionsString != ';' && *OptionsString != '\0')
+           {
+             BusLogic_Error("BusLogic: Unexpected Driver Option '%s' "
+                            "ignored\n", NULL, OptionsString);
+             *OptionsString = '\0';
+           }
        }
-      CommandLineEntry->IO_Address = IO_Address;
-    }
-  if (IntegerCount >= 2)
-    {
-      unsigned short TaggedQueueDepth = Integers[2];
-      if (TaggedQueueDepth > BusLogic_MaxTaggedQueueDepth)
+      if (!(BusLogic_DriverOptionsCount == 0 ||
+           BusLogic_ProbeInfoCount == 0 ||
+           BusLogic_DriverOptionsCount == BusLogic_ProbeInfoCount))
        {
-         BusLogic_Error("BusLogic: Invalid Command Line Entry "
-                        "(illegal Tagged Queue Depth %d)\n",
-                        NULL, TaggedQueueDepth);
+         BusLogic_Error("BusLogic: Invalid Driver Options "
+                        "(all or no I/O Addresses must be specified)\n", NULL);
          return;
        }
-      CommandLineEntry->TaggedQueueDepth = TaggedQueueDepth;
+      /*
+       Tagged Queuing is disabled when the Queue Depth is 1 since queuing
+       multiple commands is not possible.
+      */
+      for (TargetID = 0; TargetID < BusLogic_MaxTargetDevices; TargetID++)
+       if (DriverOptions->QueueDepth[TargetID] == 1)
+         {
+           unsigned short TargetBit = 1 << TargetID;
+           DriverOptions->TaggedQueuingPermitted &= ~TargetBit;
+           DriverOptions->TaggedQueuingPermittedMask |= TargetBit;
+         }
+      if (*OptionsString == ';') OptionsString++;
+      if (*OptionsString == '\0') return;
     }
-  if (IntegerCount >= 3)
-    CommandLineEntry->BusSettleTime = Integers[3];
-  if (IntegerCount >= 4)
-    CommandLineEntry->LocalOptions.All = Integers[4];
-  if (IntegerCount >= 5)
-    BusLogic_GlobalOptions.All |= Integers[5];
-  if (!(BusLogic_CommandLineEntryCount == 0 ||
-       BusLogic_ProbeInfoCount == 0 ||
-       BusLogic_CommandLineEntryCount == BusLogic_ProbeInfoCount))
+}
+
+
+/*
+  BusLogic_Setup handles processing of Kernel Command Line Arguments.
+*/
+
+void BusLogic_Setup(char *CommandLineString, int *CommandLineIntegers)
+{
+  if (CommandLineIntegers[0] != 0)
     {
-      BusLogic_Error("BusLogic: Invalid Command Line Entry "
-                    "(all or no I/O Addresses must be specified)\n", NULL);
+      BusLogic_Error("BusLogic: Obsolete Command Line Entry "
+                    "Format Ignored\n", NULL);
       return;
     }
-  if (Strings == NULL) return;
-  while (*Strings != '\0')
-    if (strncmp(Strings, "TQ:", 3) == 0)
-      {
-       Strings += 3;
-       if (strncmp(Strings, "Default", 7) == 0)
-         Strings += 7;
-       else if (strncmp(Strings, "Enable", 6) == 0)
-         {
-           Strings += 6;
-           CommandLineEntry->TaggedQueuingPermitted = 0xFFFF;
-           CommandLineEntry->TaggedQueuingPermittedMask = 0xFFFF;
-         }
-       else if (strncmp(Strings, "Disable", 7) == 0)
-         {
-           Strings += 7;
-           CommandLineEntry->TaggedQueuingPermitted = 0x0000;
-           CommandLineEntry->TaggedQueuingPermittedMask = 0xFFFF;
-         }
-       else
-         for (TargetID = 0; TargetID < BusLogic_MaxTargetDevices; TargetID++)
-           switch (*Strings++)
-             {
-             case 'Y':
-               CommandLineEntry->TaggedQueuingPermitted |= 1 << TargetID;
-               CommandLineEntry->TaggedQueuingPermittedMask |= 1 << TargetID;
-               break;
-             case 'N':
-               CommandLineEntry->TaggedQueuingPermittedMask |= 1 << TargetID;
-               break;
-             case 'X':
-               break;
-             default:
-               Strings--;
-               TargetID = BusLogic_MaxTargetDevices;
-               break;
-             }
-      }
-    else if (strncmp(Strings, "ER:", 3) == 0)
-      {
-       Strings += 3;
-       if (strncmp(Strings, "Default", 7) == 0)
-         Strings += 7;
-       else if (strncmp(Strings, "HardReset", 9) == 0)
-         {
-           Strings += 9;
-           memset(CommandLineEntry->ErrorRecoveryStrategy,
-                  BusLogic_ErrorRecovery_HardReset,
-                  sizeof(CommandLineEntry->ErrorRecoveryStrategy));
-         }
-       else if (strncmp(Strings, "BusDeviceReset", 14) == 0)
-         {
-           Strings += 14;
-           memset(CommandLineEntry->ErrorRecoveryStrategy,
-                  BusLogic_ErrorRecovery_BusDeviceReset,
-                  sizeof(CommandLineEntry->ErrorRecoveryStrategy));
-         }
-       else if (strncmp(Strings, "None", 4) == 0)
-         {
-           Strings += 4;
-           memset(CommandLineEntry->ErrorRecoveryStrategy,
-                  BusLogic_ErrorRecovery_None,
-                  sizeof(CommandLineEntry->ErrorRecoveryStrategy));
-         }
-       else
-         for (TargetID = 0; TargetID < BusLogic_MaxTargetDevices; TargetID++)
-           switch (*Strings++)
-             {
-             case 'D':
-               CommandLineEntry->ErrorRecoveryStrategy[TargetID] =
-                 BusLogic_ErrorRecovery_Default;
-               break;
-             case 'H':
-               CommandLineEntry->ErrorRecoveryStrategy[TargetID] =
-                 BusLogic_ErrorRecovery_HardReset;
-               break;
-             case 'B':
-               CommandLineEntry->ErrorRecoveryStrategy[TargetID] =
-                 BusLogic_ErrorRecovery_BusDeviceReset;
-               break;
-             case 'N':
-               CommandLineEntry->ErrorRecoveryStrategy[TargetID] =
-                 BusLogic_ErrorRecovery_None;
-               break;
-             default:
-               Strings--;
-               TargetID = BusLogic_MaxTargetDevices;
-               break;
-             }
-      }
-    else if (strcmp(Strings, "NoProbe") == 0 ||
-            strcmp(Strings, "noprobe") == 0)
-      {
-       Strings += 7;
-       BusLogic_ProbeOptions.Bits.NoProbe = true;
-      }
-    else if (strncmp(Strings, "NoProbeISA", 10) == 0)
-      {
-       Strings += 10;
-       BusLogic_ProbeOptions.Bits.NoProbeISA = true;
-      }
-    else if (strncmp(Strings, "NoProbePCI", 10) == 0)
-      {
-       Strings += 10;
-       BusLogic_ProbeOptions.Bits.NoProbePCI = true;
-      }
-    else if (strncmp(Strings, "NoSortPCI", 9) == 0)
-      {
-       Strings += 9;
-       BusLogic_ProbeOptions.Bits.NoSortPCI = true;
-      }
-    else if (strncmp(Strings, "MultiMasterFirst", 16) == 0)
-      {
-       Strings += 16;
-       BusLogic_ProbeOptions.Bits.ProbeMultiMasterFirst = true;
-      }
-    else if (strncmp(Strings, "FlashPointFirst", 15) == 0)
-      {
-       Strings += 15;
-       BusLogic_ProbeOptions.Bits.ProbeFlashPointFirst = true;
-      }
-    else if (strncmp(Strings, "Debug", 5) == 0)
-      {
-       Strings += 5;
-       BusLogic_GlobalOptions.Bits.TraceProbe = true;
-       BusLogic_GlobalOptions.Bits.TraceHardReset = true;
-       BusLogic_GlobalOptions.Bits.TraceConfiguration = true;
-       BusLogic_GlobalOptions.Bits.TraceErrors = true;
-      }
-    else if (*Strings == ',')
-      Strings++;
-    else
-      {
-       BusLogic_Error("BusLogic: Unexpected Command Line String '%s' "
-                      "ignored\n", NULL, Strings);
-       break;
-      }
+  if (CommandLineString == NULL || *CommandLineString == '\0') return;
+  BusLogic_ParseDriverOptions(CommandLineString);
 }
 
 
@@ -4724,6 +5021,8 @@ void BusLogic_Setup(char *Strings, int *Integers)
 
 #ifdef MODULE
 
+MODULE_PARM(BusLogic_Options, "s");
+
 SCSI_Host_Template_T driver_template = BUSLOGIC;
 
 #include "scsi_module.c"
index 515e84b64d6e5b5c9822f89cd2de2dfa6f11be94..ef7a8dcca1c16177ee2ae359b1868f92fc671ec4 100644 (file)
@@ -6,8 +6,7 @@
 
   This program is free software; you may redistribute and/or modify it under
   the terms of the GNU General Public License Version 2 as published by the
-  Free Software Foundation, provided that none of the source code or runtime
-  copyright notices are removed or modified.
+  Free Software Foundation.
 
   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
@@ -38,6 +37,7 @@
 typedef kdev_t KernelDevice_T;
 typedef struct proc_dir_entry PROC_DirectoryEntry_T;
 typedef struct pt_regs Registers_T;
+typedef struct partition PartitionTable_T;
 typedef Scsi_Host_Template SCSI_Host_Template_T;
 typedef struct Scsi_Host SCSI_Host_T;
 typedef struct scsi_device SCSI_Device_T;
@@ -66,28 +66,19 @@ extern int BusLogic_ProcDirectoryInfo(char *, char **, off_t, int, int, int);
   Define the BusLogic SCSI Host Template structure.
 */
 
-#define BUSLOGIC                                                        \
-  { NULL,                              /* Next                      */  \
-    NULL,                              /* Usage Count Pointer       */  \
-    &BusLogic_ProcDirectoryEntry,      /* /proc Directory Entry     */  \
-    BusLogic_ProcDirectoryInfo,                /* /proc Info Function       */  \
-    "BusLogic",                                /* Driver Name               */  \
-    BusLogic_DetectHostAdapter,                /* Detect Host Adapter       */  \
-    BusLogic_ReleaseHostAdapter,       /* Release Host Adapter      */  \
-    BusLogic_DriverInfo,               /* Driver Info Function      */  \
-    NULL,                              /* Command Function          */  \
-    BusLogic_QueueCommand,             /* Queue Command Function    */  \
-    BusLogic_AbortCommand,             /* Abort Command Function    */  \
-    BusLogic_ResetCommand,             /* Reset Command Function    */  \
-    NULL,                              /* Slave Attach Function     */  \
-    BusLogic_BIOSDiskParameters,       /* BIOS Disk Parameters      */  \
-    0,                                 /* Can Queue                 */  \
-    0,                                 /* This ID                   */  \
-    0,                                 /* Scatter/Gather Table Size */  \
-    0,                                 /* SCSI Commands per LUN     */  \
-    0,                                 /* Present                   */  \
-    1,                                 /* Default Unchecked ISA DMA */  \
-    ENABLE_CLUSTERING }                        /* Enable Clustering         */
+#define BUSLOGIC                                                              \
+  { proc_dir:       &BusLogic_ProcDirectoryEntry, /* ProcFS Directory Entry */ \
+    proc_info:      BusLogic_ProcDirectoryInfo,          /* ProcFS Info Function   */ \
+    name:           "BusLogic",                          /* Driver Name            */ \
+    detect:         BusLogic_DetectHostAdapter,          /* Detect Host Adapter    */ \
+    release:        BusLogic_ReleaseHostAdapter,  /* Release Host Adapter   */ \
+    info:           BusLogic_DriverInfo,         /* Driver Info Function   */ \
+    queuecommand:   BusLogic_QueueCommand,       /* Queue Command Function */ \
+    abort:          BusLogic_AbortCommand,       /* Abort Command Function */ \
+    reset:          BusLogic_ResetCommand,       /* Reset Command Function */ \
+    bios_param:     BusLogic_BIOSDiskParameters,  /* BIOS Disk Parameters   */ \
+    unchecked_isa_dma: 1,                        /* Default Initial Value  */ \
+    use_clustering: ENABLE_CLUSTERING }                  /* Enable Clustering      */
 
 
 /*
@@ -97,6 +88,24 @@ extern int BusLogic_ProcDirectoryInfo(char *, char **, off_t, int, int, int);
 #ifdef BusLogic_DriverVersion
 
 
+/*
+  FlashPoint support is only available for the Intel x86 Architecture with
+  CONFIG_PCI set.
+*/
+
+#ifndef __i386__
+#undef CONFIG_SCSI_OMIT_FLASHPOINT
+#define CONFIG_SCSI_OMIT_FLASHPOINT
+#endif
+
+#ifndef CONFIG_PCI
+#undef CONFIG_SCSI_OMIT_FLASHPOINT
+#define CONFIG_SCSI_OMIT_FLASHPOINT
+#define BusLogic_InitializeProbeInfoListISA \
+  BusLogic_InitializeProbeInfoList
+#endif
+
+
 /*
   Define the maximum number of BusLogic Host Adapters supported by this driver.
 */
@@ -121,16 +130,17 @@ extern int BusLogic_ProcDirectoryInfo(char *, char **, off_t, int, int, int);
 
 
 /*
-  Define the maximum, preferred, and default Queue Depth to allow for Target
-  Devices depending on whether or not they support Tagged Queuing and whether
-  or not ISA Bounce Buffers are required.
+  Define the maximum, maximum automatic, minimum automatic, and default Queue
+  Depth to allow for Target Devices depending on whether or not they support
+  Tagged Queuing and whether or not ISA Bounce Buffers are required.
 */
 
-#define BusLogic_MaxTaggedQueueDepth           63
-#define BusLogic_PreferredTaggedQueueDepth     28
-#define BusLogic_TaggedQueueDepthBounceBuffers 2
-#define BusLogic_TaggedQueueDepthAutomatic     0
+#define BusLogic_MaxTaggedQueueDepth           64
+#define BusLogic_MaxAutomaticTaggedQueueDepth  28
+#define BusLogic_MinAutomaticTaggedQueueDepth  7
+#define BusLogic_TaggedQueueDepthBB            3
 #define BusLogic_UntaggedQueueDepth            3
+#define BusLogic_UntaggedQueueDepthBB          2
 
 
 /*
@@ -143,12 +153,30 @@ extern int BusLogic_ProcDirectoryInfo(char *, char **, off_t, int, int, int);
 #define BusLogic_DefaultBusSettleTime          2
 
 
+/*
+  Define the maximum number of Mailboxes that should be used for MultiMaster
+  Host Adapters.  This number is chosen to be larger than the maximum Host
+  Adapter Queue Depth and small enough so that the Host Adapter structure
+  does not cross an allocation block size boundary.
+*/
+
+#define BusLogic_MaxMailboxes                  211
+
+
+/*
+  Define the number of CCBs that should be allocated as a group to optimize
+  Kernel memory allocation.
+*/
+
+#define BusLogic_CCB_AllocationGroupSize       7
+
+
 /*
   Define the Host Adapter Line and Message Buffer Sizes.
 */
 
 #define BusLogic_LineBufferSize                        100
-#define BusLogic_MessageBufferSize             9900
+#define BusLogic_MessageBufferSize             9700
 
 
 /*
@@ -167,7 +195,27 @@ BusLogic_MessageLevel_T;
 
 static char
   *BusLogic_MessageLevelMap[] =
-    { KERN_INFO, KERN_INFO, KERN_NOTICE, KERN_WARNING, KERN_ERR };
+    { KERN_NOTICE, KERN_NOTICE, KERN_NOTICE, KERN_WARNING, KERN_ERR };
+
+
+/*
+  Define Driver Message macros.
+*/
+
+#define BusLogic_Announce(Format, Arguments...) \
+  BusLogic_Message(BusLogic_AnnounceLevel, Format, ##Arguments)
+
+#define BusLogic_Info(Format, Arguments...) \
+  BusLogic_Message(BusLogic_InfoLevel, Format, ##Arguments)
+
+#define BusLogic_Notice(Format, Arguments...) \
+  BusLogic_Message(BusLogic_NoticeLevel, Format, ##Arguments)
+
+#define BusLogic_Warning(Format, Arguments...) \
+  BusLogic_Message(BusLogic_WarningLevel, Format, ##Arguments)
+
+#define BusLogic_Error(Format, Arguments...) \
+  BusLogic_Message(BusLogic_ErrorLevel, Format, ##Arguments)
 
 
 /*
@@ -187,10 +235,33 @@ BusLogic_HostAdapterType_T;
 #define BusLogic_FlashPointAddressCount                256
 
 static int
-  BusLogic_HostAdapter_AddressCount[3] =
+  BusLogic_HostAdapterAddressCount[3] =
     { 0, BusLogic_MultiMasterAddressCount, BusLogic_FlashPointAddressCount };
 
 
+/*
+  Define macros for testing the Host Adapter Type.
+*/
+
+#ifndef CONFIG_SCSI_OMIT_FLASHPOINT
+
+#define BusLogic_MultiMasterHostAdapterP(HostAdapter) \
+  (HostAdapter->HostAdapterType == BusLogic_MultiMaster)
+
+#define BusLogic_FlashPointHostAdapterP(HostAdapter) \
+  (HostAdapter->HostAdapterType == BusLogic_FlashPoint)
+
+#else
+
+#define BusLogic_MultiMasterHostAdapterP(HostAdapter) \
+  (true)
+
+#define BusLogic_FlashPointHostAdapterP(HostAdapter) \
+  (false)
+
+#endif
+
+
 /*
   Define the possible Host Adapter Bus Types.
 */
@@ -204,6 +275,7 @@ typedef enum
   BusLogic_VESA_Bus =                          4,
   BusLogic_MCA_Bus =                           5
 }
+__attribute__ ((packed))
 BusLogic_HostAdapterBusType_T;
 
 static char
@@ -256,6 +328,13 @@ typedef unsigned int BusLogic_IO_Address_T;
 typedef unsigned int BusLogic_PCI_Address_T;
 
 
+/*
+  Define a 32 bit Base Address data type.
+*/
+
+typedef unsigned int BusLogic_Base_Address_T;
+
+
 /*
   Define a 32 bit Bus Address data type.
 */
@@ -288,11 +367,10 @@ BusLogic_ByteCounter_T;
 
 typedef struct BusLogic_ProbeInfo
 {
+  BusLogic_HostAdapterType_T HostAdapterType;
+  BusLogic_HostAdapterBusType_T HostAdapterBusType;
   BusLogic_IO_Address_T IO_Address;
   BusLogic_PCI_Address_T PCI_Address;
-  BusLogic_HostAdapterType_T HostAdapterType:2;
-  BusLogic_HostAdapterBusType_T HostAdapterBusType:3;
-  unsigned char :3;
   unsigned char Bus;
   unsigned char Device;
   unsigned char IRQ_Channel;
@@ -300,36 +378,25 @@ typedef struct BusLogic_ProbeInfo
 BusLogic_ProbeInfo_T;
 
 
-/*
-  BusLogic_ISA_StandardAddresses is the list of standard ISA I/O Addresses at
-  which BusLogic MultiMaster Host Adapters may potentially be found.  The first
-  I/O Address 0x330 is known as the "Primary" I/O Address.  A Host Adapter
-  configured to use the Primary I/O Address will always be the preferred boot
-  device.
-*/
-
-#define BusLogic_ISA_StandardAddressesCount    6
-
-static BusLogic_IO_Address_T
-  BusLogic_ISA_StandardAddresses[BusLogic_ISA_StandardAddressesCount] =
-    { 0x330, 0x334, 0x230, 0x234, 0x130, 0x134 };
-
-
 /*
   Define the Probe Options.
 */
 
-typedef union BusLogic_ProbeOptions
+typedef struct BusLogic_ProbeOptions
 {
-  unsigned short All;
-  struct {
-    boolean NoProbe:1;                                 /* Bit 0 */
-    boolean NoProbeISA:1;                              /* Bit 1 */
-    boolean NoProbePCI:1;                              /* Bit 2 */
-    boolean NoSortPCI:1;                               /* Bit 3 */
-    boolean ProbeMultiMasterFirst:1;                   /* Bit 4 */
-    boolean ProbeFlashPointFirst:1;                    /* Bit 5 */
-  } Bits;
+  boolean NoProbe:1;                                   /* Bit 0 */
+  boolean NoProbeISA:1;                                        /* Bit 1 */
+  boolean NoProbePCI:1;                                        /* Bit 2 */
+  boolean NoSortPCI:1;                                 /* Bit 3 */
+  boolean MultiMasterFirst:1;                          /* Bit 4 */
+  boolean FlashPointFirst:1;                           /* Bit 5 */
+  boolean LimitedProbeISA:1;                           /* Bit 6 */
+  boolean Probe330:1;                                  /* Bit 7 */
+  boolean Probe334:1;                                  /* Bit 8 */
+  boolean Probe230:1;                                  /* Bit 9 */
+  boolean Probe234:1;                                  /* Bit 10 */
+  boolean Probe130:1;                                  /* Bit 11 */
+  boolean Probe134:1;                                  /* Bit 12 */
 }
 BusLogic_ProbeOptions_T;
 
@@ -338,15 +405,12 @@ BusLogic_ProbeOptions_T;
   Define the Global Options.
 */
 
-typedef union BusLogic_GlobalOptions
+typedef struct BusLogic_GlobalOptions
 {
-  unsigned short All;
-  struct {
-    boolean TraceProbe:1;                              /* Bit 0 */
-    boolean TraceHardReset:1;                          /* Bit 1 */
-    boolean TraceConfiguration:1;                      /* Bit 2 */
-    boolean TraceErrors:1;                             /* Bit 3 */
-  } Bits;
+  boolean TraceProbe:1;                                        /* Bit 0 */
+  boolean TraceHardwareReset:1;                                /* Bit 1 */
+  boolean TraceConfiguration:1;                                /* Bit 2 */
+  boolean TraceErrors:1;                               /* Bit 3 */
 }
 BusLogic_GlobalOptions_T;
 
@@ -355,13 +419,9 @@ BusLogic_GlobalOptions_T;
   Define the Local Options.
 */
 
-typedef union BusLogic_LocalOptions
+typedef struct BusLogic_LocalOptions
 {
-  unsigned short All;
-  struct {
-    boolean InhibitTargetInquiry:1;                    /* Bit 0 */
-    boolean InhibitInterruptTest:1;                    /* Bit 1 */
-  } Bits;
+  boolean InhibitTargetInquiry:1;                      /* Bit 0 */
 }
 BusLogic_LocalOptions_T;
 
@@ -619,10 +679,13 @@ typedef struct BusLogic_SetupInformation
   unsigned char Signature;                             /* Byte 17 */
   unsigned char CharacterD;                            /* Byte 18 */
   unsigned char HostBusType;                           /* Byte 19 */
-  unsigned char :8;                                    /* Byte 20 */
-  unsigned char :8;                                    /* Byte 21 */
+  unsigned char WideTransfersPermittedID0to7;          /* Byte 20 */
+  unsigned char WideTransfersActiveID0to7;             /* Byte 21 */
   BusLogic_SynchronousValues8_T SynchronousValuesID8to15; /* Bytes 22-29 */
   unsigned char DisconnectPermittedID8to15;            /* Byte 30 */
+  unsigned char :8;                                    /* Byte 31 */
+  unsigned char WideTransfersPermittedID8to15;         /* Byte 32 */
+  unsigned char WideTransfersActiveID8to15;            /* Byte 33 */
 }
 BusLogic_SetupInformation_T;
 
@@ -1063,6 +1126,21 @@ typedef struct BusLogic_ScatterGatherSegment
 BusLogic_ScatterGatherSegment_T;
 
 
+/*
+  Define the Driver CCB Status Codes.
+*/
+
+typedef enum
+{
+  BusLogic_CCB_Free =                          0,
+  BusLogic_CCB_Active =                                1,
+  BusLogic_CCB_Completed =                     2,
+  BusLogic_CCB_Reset =                         3
+}
+__attribute__ ((packed))
+BusLogic_CCB_Status_T;
+
+
 /*
   Define the 32 Bit Mode Command Control Block (CCB) structure.  The first 40
   bytes are defined by and common to both the MultiMaster Firmware and the
@@ -1113,27 +1191,26 @@ typedef struct BusLogic_CCB
     FlashPoint SCCB Manager Defined Portion.
   */
   void (*CallbackFunction)(struct BusLogic_CCB *);     /* Bytes 40-43 */
-  BusLogic_IO_Address_T BaseAddress;                   /* Bytes 44-47 */
+  BusLogic_Base_Address_T BaseAddress;                 /* Bytes 44-47 */
   BusLogic_CompletionCode_T CompletionCode;            /* Byte 48 */
+#ifndef CONFIG_SCSI_OMIT_FLASHPOINT
   unsigned char :8;                                    /* Byte 49 */
   unsigned short OS_Flags;                             /* Bytes 50-51 */
   unsigned char Private[48];                           /* Bytes 52-99 */
+#endif
   /*
     BusLogic Linux Driver Defined Portion.
   */
-  struct BusLogic_HostAdapter *HostAdapter;
-  SCSI_Command_T *Command;
-  enum { BusLogic_CCB_Free =       0,
-        BusLogic_CCB_Active =      1,
-        BusLogic_CCB_Completed =   2,
-        BusLogic_CCB_Reset =       3 } Status;
+  boolean AllocationGroupHead;
+  BusLogic_CCB_Status_T Status;
   unsigned long SerialNumber;
+  SCSI_Command_T *Command;
+  struct BusLogic_HostAdapter *HostAdapter;
   struct BusLogic_CCB *Next;
   struct BusLogic_CCB *NextAll;
   BusLogic_ScatterGatherSegment_T
     ScatterGatherList[BusLogic_ScatterGatherLimit];
 }
-__attribute__ ((packed))
 BusLogic_CCB_T;
 
 
@@ -1166,32 +1243,48 @@ BusLogic_IncomingMailbox_T;
 
 
 /*
-  Define the Linux BusLogic Driver Command Line Entry structure.
+  Define the BusLogic Driver Options structure.
 */
 
-typedef struct BusLogic_CommandLineEntry
+typedef struct BusLogic_DriverOptions
 {
-  BusLogic_IO_Address_T IO_Address;
-  unsigned short TaggedQueueDepth;
-  unsigned short BusSettleTime;
   unsigned short TaggedQueuingPermitted;
   unsigned short TaggedQueuingPermittedMask;
+  unsigned short BusSettleTime;
   BusLogic_LocalOptions_T LocalOptions;
+  unsigned char QueueDepth[BusLogic_MaxTargetDevices];
   BusLogic_ErrorRecoveryStrategy_T
     ErrorRecoveryStrategy[BusLogic_MaxTargetDevices];
 }
-BusLogic_CommandLineEntry_T;
+BusLogic_DriverOptions_T;
 
 
 /*
-  Define the Host Adapter Target Device Statistics structure.
+  Define the Host Adapter Target Flags structure.
+*/
+
+typedef struct BusLogic_TargetFlags
+{
+  boolean TargetExists:1;
+  boolean TaggedQueuingSupported:1;
+  boolean WideTransfersSupported:1;
+  boolean TaggedQueuingActive:1;
+  boolean WideTransfersActive:1;
+  boolean CommandSuccessfulFlag:1;
+  boolean TargetInfoReported:1;
+}
+BusLogic_TargetFlags_T;
+
+
+/*
+  Define the Host Adapter Target Statistics structure.
 */
 
 #define BusLogic_SizeBuckets                   10
 
 typedef unsigned int BusLogic_CommandSizeBuckets_T[BusLogic_SizeBuckets];
 
-typedef struct BusLogic_TargetDeviceStatistics
+typedef struct BusLogic_TargetStatistics
 {
   unsigned int CommandsAttempted;
   unsigned int CommandsCompleted;
@@ -1211,7 +1304,7 @@ typedef struct BusLogic_TargetDeviceStatistics
   unsigned short HostAdapterResetsAttempted;
   unsigned short HostAdapterResetsCompleted;
 }
-BusLogic_TargetDeviceStatistics_T;
+BusLogic_TargetStatistics_T;
 
 
 /*
@@ -1230,7 +1323,7 @@ typedef unsigned int FlashPoint_CardHandle_T;
 
 typedef struct FlashPoint_Info
 {
-  BusLogic_IO_Address_T BaseAddress;                   /* Bytes 0-3 */
+  BusLogic_Base_Address_T BaseAddress;                 /* Bytes 0-3 */
   boolean Present;                                     /* Byte 4 */
   unsigned char IRQ_Channel;                           /* Byte 5 */
   unsigned char SCSI_ID;                               /* Byte 6 */
@@ -1265,12 +1358,14 @@ FlashPoint_Info_T;
 
 
 /*
-  Define the Linux BusLogic Driver Host Adapter structure.
+  Define the BusLogic Driver Host Adapter structure.
 */
 
 typedef struct BusLogic_HostAdapter
 {
   SCSI_Host_T *SCSI_Host;
+  BusLogic_HostAdapterType_T HostAdapterType;
+  BusLogic_HostAdapterBusType_T HostAdapterBusType;
   BusLogic_IO_Address_T IO_Address;
   BusLogic_PCI_Address_T PCI_Address;
   unsigned short AddressCount;
@@ -1279,18 +1374,16 @@ typedef struct BusLogic_HostAdapter
   unsigned char FirmwareVersion[6];
   unsigned char FullModelName[18];
   unsigned char InterruptLabel[68];
+  unsigned char Bus;
+  unsigned char Device;
   unsigned char IRQ_Channel;
   unsigned char DMA_Channel;
   unsigned char SCSI_ID;
-  unsigned char Bus;
-  unsigned char Device;
-  BusLogic_HostAdapterType_T HostAdapterType;
-  BusLogic_HostAdapterBusType_T HostAdapterBusType:3;
   boolean IRQ_ChannelAcquired:1;
   boolean DMA_ChannelAcquired:1;
   boolean ExtendedTranslationEnabled:1;
   boolean ParityCheckingEnabled:1;
-  boolean BusResetEnabled;
+  boolean BusResetEnabled:1;
   boolean LevelSensitiveInterrupt:1;
   boolean HostWideSCSI:1;
   boolean HostDifferentialSCSI:1;
@@ -1304,8 +1397,9 @@ typedef struct BusLogic_HostAdapter
   boolean StrictRoundRobinModeSupport:1;
   boolean SCAM_Enabled:1;
   boolean SCAM_Level2:1;
-  boolean HostAdapterInitialized;
-  boolean HostAdapterResetRequested:1;
+  boolean HostAdapterInitialized:1;
+  boolean HostAdapterExternalReset:1;
+  boolean HostAdapterInternalError:1;
   volatile boolean HostAdapterCommandCompleted:1;
   unsigned short HostAdapterScatterGatherLimit;
   unsigned short DriverScatterGatherLimit;
@@ -1317,7 +1411,6 @@ typedef struct BusLogic_HostAdapter
   unsigned short AllocatedCCBs;
   unsigned short DriverQueueDepth;
   unsigned short HostAdapterQueueDepth;
-  unsigned short TaggedQueueDepth;
   unsigned short UntaggedQueueDepth;
   unsigned short BusSettleTime;
   unsigned short SynchronousPermitted;
@@ -1327,26 +1420,24 @@ typedef struct BusLogic_HostAdapter
   unsigned short DisconnectPermitted;
   unsigned short TaggedQueuingPermitted;
   unsigned short ExternalHostAdapterResets;
-  BusLogic_LocalOptions_T LocalOptions;
+  unsigned short HostAdapterInternalErrors;
+  unsigned short TargetDeviceCount;
+  unsigned short MessageBufferLength;
   BusLogic_BusAddress_T BIOS_Address;
-  BusLogic_InstalledDevices_T InstalledDevices;
-  BusLogic_SynchronousValues_T SynchronousValues;
-  BusLogic_SynchronousPeriod_T SynchronousPeriod;
-  BusLogic_CommandLineEntry_T *CommandLineEntry;
-  FlashPoint_Info_T *FlashPointInfo;
+  BusLogic_DriverOptions_T *DriverOptions;
+  FlashPoint_Info_T FlashPointInfo;
   FlashPoint_CardHandle_T CardHandle;
   struct BusLogic_HostAdapter *Next;
-  char *MessageBuffer;
-  int MessageBufferLength;
+  struct BusLogic_HostAdapter *NextAll;
   BusLogic_CCB_T *All_CCBs;
   BusLogic_CCB_T *Free_CCBs;
   BusLogic_CCB_T *BusDeviceResetPendingCCB[BusLogic_MaxTargetDevices];
   BusLogic_ErrorRecoveryStrategy_T
     ErrorRecoveryStrategy[BusLogic_MaxTargetDevices];
-  boolean TaggedQueuingSupported[BusLogic_MaxTargetDevices];
-  boolean TaggedQueuingActive[BusLogic_MaxTargetDevices];
-  boolean CommandSuccessfulFlag[BusLogic_MaxTargetDevices];
+  BusLogic_TargetFlags_T TargetFlags[BusLogic_MaxTargetDevices];
   unsigned char QueueDepth[BusLogic_MaxTargetDevices];
+  unsigned char SynchronousPeriod[BusLogic_MaxTargetDevices];
+  unsigned char SynchronousOffset[BusLogic_MaxTargetDevices];
   unsigned char ActiveCommands[BusLogic_MaxTargetDevices];
   unsigned int CommandsSinceReset[BusLogic_MaxTargetDevices];
   unsigned long LastSequencePoint[BusLogic_MaxTargetDevices];
@@ -1358,7 +1449,11 @@ typedef struct BusLogic_HostAdapter
   BusLogic_IncomingMailbox_T *FirstIncomingMailbox;
   BusLogic_IncomingMailbox_T *LastIncomingMailbox;
   BusLogic_IncomingMailbox_T *NextIncomingMailbox;
-  BusLogic_TargetDeviceStatistics_T *TargetDeviceStatistics;
+  BusLogic_TargetStatistics_T TargetStatistics[BusLogic_MaxTargetDevices];
+  unsigned char MailboxSpace[BusLogic_MaxMailboxes
+                            * (sizeof(BusLogic_OutgoingMailbox_T)
+                               + sizeof(BusLogic_IncomingMailbox_T))];
+  char MessageBuffer[BusLogic_MessageBufferSize];
 }
 BusLogic_HostAdapter_T;
 
@@ -1376,6 +1471,41 @@ typedef struct BIOS_DiskParameters
 BIOS_DiskParameters_T;
 
 
+/*
+  Define a structure for the SCSI Inquiry command results.
+*/
+
+typedef struct SCSI_Inquiry
+{
+  unsigned char PeripheralDeviceType:5;                        /* Byte 0 Bits 0-4 */
+  unsigned char PeripheralQualifier:3;                 /* Byte 0 Bits 5-7 */
+  unsigned char DeviceTypeModifier:7;                  /* Byte 1 Bits 0-6 */
+  boolean RMB:1;                                       /* Byte 1 Bit 7 */
+  unsigned char ANSI_ApprovedVersion:3;                        /* Byte 2 Bits 0-2 */
+  unsigned char ECMA_Version:3;                                /* Byte 2 Bits 3-5 */
+  unsigned char ISO_Version:2;                         /* Byte 2 Bits 6-7 */
+  unsigned char ResponseDataFormat:4;                  /* Byte 3 Bits 0-3 */
+  unsigned char :2;                                    /* Byte 3 Bits 4-5 */
+  boolean TrmIOP:1;                                    /* Byte 3 Bit 6 */
+  boolean AENC:1;                                      /* Byte 3 Bit 7 */
+  unsigned char AdditionalLength;                      /* Byte 4 */
+  unsigned char :8;                                    /* Byte 5 */
+  unsigned char :8;                                    /* Byte 6 */
+  boolean SftRe:1;                                     /* Byte 7 Bit 0 */
+  boolean CmdQue:1;                                    /* Byte 7 Bit 1 */
+  boolean :1;                                          /* Byte 7 Bit 2 */
+  boolean Linked:1;                                    /* Byte 7 Bit 3 */
+  boolean Sync:1;                                      /* Byte 7 Bit 4 */
+  boolean WBus16:1;                                    /* Byte 7 Bit 5 */
+  boolean WBus32:1;                                    /* Byte 7 Bit 6 */
+  boolean RelAdr:1;                                    /* Byte 7 Bit 7 */
+  unsigned char VendorIdentification[8];               /* Bytes 8-15 */
+  unsigned char ProductIdentification[16];             /* Bytes 16-31 */
+  unsigned char ProductRevisionLevel[4];               /* Bytes 32-35 */
+}
+SCSI_Inquiry_T;
+
+
 /*
   BusLogic_AcquireHostAdapterLock acquires exclusive access to Host Adapter.
 */
@@ -1526,10 +1656,11 @@ void BusLogic_StartMailboxCommand(BusLogic_HostAdapter_T *HostAdapter)
 
 static inline void BusLogic_Delay(int Seconds)
 {
+  int Milliseconds = 1000 * Seconds;
   unsigned long ProcessorFlags;
   save_flags(ProcessorFlags);
   sti();
-  while (--Seconds >= 0) udelay(1000000);
+  while (--Milliseconds >= 0) udelay(1000);
   restore_flags(ProcessorFlags);
 }
 
@@ -1550,6 +1681,19 @@ static inline void *Bus_to_Virtual(BusLogic_BusAddress_T BusAddress)
 }
 
 
+/*
+  Virtual_to_32Bit_Virtual maps between Kernel Virtual Addresses and
+  32 Bit Kernel Virtual Addresses.  This avoids compilation warnings
+  on 64 Bit architectures.
+*/
+
+static inline
+BusLogic_BusAddress_T Virtual_to_32Bit_Virtual(void *VirtualAddress)
+{
+  return (BusLogic_BusAddress_T) (unsigned long) VirtualAddress;
+}
+
+
 /*
   BusLogic_IncrementErrorCounter increments Error Counter by 1, stopping at
   65535 rather than wrapping around to 0.
@@ -1588,93 +1732,38 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T
 {
   int Index = 0;
   if (Amount < 8*1024)
-    if (Amount < 2*1024)
-      Index = (Amount < 1*1024 ? 0 : 1);
-    else Index = (Amount < 4*1024 ? 2 : 3);
+    {
+      if (Amount < 2*1024)
+       Index = (Amount < 1*1024 ? 0 : 1);
+      else Index = (Amount < 4*1024 ? 2 : 3);
+    }
   else if (Amount < 128*1024)
-    if (Amount < 32*1024)
-      Index = (Amount < 16*1024 ? 4 : 5);
-    else Index = (Amount < 64*1024 ? 6 : 7);
+    {
+      if (Amount < 32*1024)
+       Index = (Amount < 16*1024 ? 4 : 5);
+      else Index = (Amount < 64*1024 ? 6 : 7);
+    }
   else Index = (Amount < 256*1024 ? 8 : 9);
   CommandSizeBuckets[Index]++;
 }
 
 
 /*
-  If CONFIG_PCI is not set, force CONFIG_SCSI_OMIT_FLASHPOINT, and use the
-  ISA only probe function as the general one.
+  Define compatibility macros between Linux 2.0 and Linux 2.1.
 */
 
-#ifndef CONFIG_PCI
-
-#undef CONFIG_SCSI_OMIT_FLASHPOINT
-#define CONFIG_SCSI_OMIT_FLASHPOINT
+#if LINUX_VERSION_CODE < 0x20100
 
-#define BusLogic_InitializeProbeInfoListISA BusLogic_InitializeProbeInfoList
+#define MODULE_PARM(Variable, Type)
 
 #endif
 
 
-/*
-  FlashPoint support is only available for the Intel x86 Architecture.
-*/
-
-#ifndef __i386__
-
-#undef CONFIG_SCSI_OMIT_FLASHPOINT
-#define CONFIG_SCSI_OMIT_FLASHPOINT
-
-#endif
-
-
-/*
-  Define macros for testing the Host Adapter Type.
-*/
-
-#ifndef CONFIG_SCSI_OMIT_FLASHPOINT
-
-#define BusLogic_MultiMasterHostAdapterP(HostAdapter) \
-  (HostAdapter->HostAdapterType == BusLogic_MultiMaster)
-
-#define BusLogic_FlashPointHostAdapterP(HostAdapter) \
-  (HostAdapter->HostAdapterType == BusLogic_FlashPoint)
-
-#else
-
-#define BusLogic_MultiMasterHostAdapterP(HostAdapter) \
-  (true)
-
-#define BusLogic_FlashPointHostAdapterP(HostAdapter) \
-  (false)
-
-#endif
-
-
-/*
-  Define Driver Message Macros.
-*/
-
-#define BusLogic_Announce(Format, Arguments...) \
-  BusLogic_Message(BusLogic_AnnounceLevel, Format, ##Arguments)
-
-#define BusLogic_Info(Format, Arguments...) \
-  BusLogic_Message(BusLogic_InfoLevel, Format, ##Arguments)
-
-#define BusLogic_Notice(Format, Arguments...) \
-  BusLogic_Message(BusLogic_NoticeLevel, Format, ##Arguments)
-
-#define BusLogic_Warning(Format, Arguments...) \
-  BusLogic_Message(BusLogic_WarningLevel, Format, ##Arguments)
-
-#define BusLogic_Error(Format, Arguments...) \
-  BusLogic_Message(BusLogic_ErrorLevel, Format, ##Arguments)
-
-
 /*
   Define the version number of the FlashPoint Firmware (SCCB Manager).
 */
 
-#define FlashPoint_FirmwareVersion             "5.01"
+#define FlashPoint_FirmwareVersion             "5.02"
 
 
 /*
@@ -1682,35 +1771,22 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T
 */
 
 #define FlashPoint_NormalInterrupt             0x00
+#define FlashPoint_InternalError               0xFE
 #define FlashPoint_ExternalBusReset            0xFF
 
 
-/*
-  Define prototypes for the FlashPoint SCCB Manager Functions.
-*/
-
-extern unsigned char FlashPoint_ProbeHostAdapter(FlashPoint_Info_T *);
-extern FlashPoint_CardHandle_T
-       FlashPoint_HardResetHostAdapter(FlashPoint_Info_T *);
-extern void FlashPoint_StartCCB(FlashPoint_CardHandle_T, BusLogic_CCB_T *);
-extern int FlashPoint_AbortCCB(FlashPoint_CardHandle_T, BusLogic_CCB_T *);
-extern boolean FlashPoint_InterruptPending(FlashPoint_CardHandle_T);
-extern int FlashPoint_HandleInterrupt(FlashPoint_CardHandle_T);
-extern void FlashPoint_ReleaseHostAdapter(FlashPoint_CardHandle_T);
-
-
 /*
   Define prototypes for the forward referenced BusLogic Driver
   Internal Functions.
 */
 
-static void BusLogic_QueueCompletedCCB(BusLogic_CCB_T *CCB);
+static void BusLogic_QueueCompletedCCB(BusLogic_CCB_T *);
 static void BusLogic_InterruptHandler(int, void *, Registers_T *);
 static int BusLogic_ResetHostAdapter(BusLogic_HostAdapter_T *,
-                                    SCSI_Command_T *,
-                                    unsigned int);
-static void BusLogic_Message(BusLogic_MessageLevel_T, char *Format,
+                                    SCSI_Command_T *, unsigned int);
+static void BusLogic_Message(BusLogic_MessageLevel_T, char *,
                             BusLogic_HostAdapter_T *, ...);
+static void BusLogic_ParseDriverOptions(char *);
 
 
 #endif /* BusLogic_DriverVersion */
index c4655ec25ab2bb0aa97e90a332d03bce90585c6a..831a0e1421b598ba5e9ffdf999185587f8930273 100644 (file)
 
 
 #include <linux/config.h>
-
-
-/*
-  If CONFIG_PCI is not set, force CONFIG_SCSI_OMIT_FLASHPOINT.
-*/
-
-#ifndef CONFIG_PCI
-
-#undef CONFIG_SCSI_OMIT_FLASHPOINT
-#define CONFIG_SCSI_OMIT_FLASHPOINT
-
-#endif
-
-
-/*
-  FlashPoint support is only available for the Intel x86 Architecture.
-*/
-
-#ifndef __i386__
-
-#undef CONFIG_SCSI_OMIT_FLASHPOINT
-#define CONFIG_SCSI_OMIT_FLASHPOINT
-
-#endif
+#include <asm/io.h>
 
 
 #ifndef CONFIG_SCSI_OMIT_FLASHPOINT
 #define UNIX
 #define FW_TYPE                _SCCB_MGR_
 #define MAX_CARDS      8
+#undef BUSTYPE_PCI
 
 
-#include <asm/io.h>
-
 #define OS_InPortByte(port)            inb(port)
 #define OS_InPortWord(port)            inw(port)
 #define OS_InPortLong(port)            inl(port)
@@ -68,7 +44,7 @@
 */
 
 #define SccbMgr_sense_adapter          FlashPoint_ProbeHostAdapter
-#define SccbMgr_config_adapter         FlashPoint_HardResetHostAdapter
+#define SccbMgr_config_adapter         FlashPoint_HardwareResetHostAdapter
 #define SccbMgr_unload_card            FlashPoint_ReleaseHostAdapter
 #define SccbMgr_start_sccb             FlashPoint_StartCCB
 #define SccbMgr_abort_sccb             FlashPoint_AbortCCB
 #define stwidn                         FPT_stwidn
 #define sxfrp                          FPT_sxfrp
 #define utilEERead                     FPT_utilEERead
+#define utilEEReadOrg                  FPT_utilEEReadOrg
 #define utilEESendCmdAddr              FPT_utilEESendCmdAddr
 #define utilEEWrite                    FPT_utilEEWrite
 #define utilEEWriteOnOff               FPT_utilEEWriteOnOff
@@ -1317,9 +1294,9 @@ typedef struct SCCBscam_info {
  *
  *   Description:  Register definitions for HARPOON ASIC.
  *
- *   $Date: 1997/01/31 02:14:28 $
+ *   $Date: 1997/07/09 21:44:36 $
  *
- *   $Revision: 1.6 $
+ *   $Revision: 1.9 $
  *
  *----------------------------------------------------------------------*/
 
@@ -2070,9 +2047,14 @@ void  schkdd(USHORT port, UCHAR p_card);
 UCHAR RdStack(USHORT port, UCHAR index);
 void  WrStack(USHORT portBase, UCHAR index, UCHAR data);
 UCHAR ChkIfChipInitialized(USHORT ioPort);
+
+#if defined(V302)
 UCHAR GetTarLun(USHORT port, UCHAR p_card, UCHAR our_target, PSCCBcard pCurrCard, PUCHAR tag, PUCHAR lun);
+#endif
+
 void SendMsg(USHORT port, UCHAR message);
 void  queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, UCHAR error_code);
+UCHAR scsellDOS(USHORT p_port, UCHAR targ_id);
 #else
 UCHAR sfm(ULONG port, PSCCB pcurrSCCB);
 void  scsiStartAuto(ULONG port);
@@ -2090,7 +2072,11 @@ void  schkdd(ULONG port, UCHAR p_card);
 UCHAR RdStack(ULONG port, UCHAR index);
 void  WrStack(ULONG portBase, UCHAR index, UCHAR data);
 UCHAR ChkIfChipInitialized(ULONG ioPort);
+
+#if defined(V302)
 UCHAR GetTarLun(ULONG port, UCHAR p_card, UCHAR our_target, PSCCBcard pCurrCard, PUCHAR tar, PUCHAR lun);
+#endif
+
 void SendMsg(ULONG port, UCHAR message);
 void  queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, UCHAR error_code);
 #endif
@@ -2130,6 +2116,7 @@ void  Wait(USHORT p_port, UCHAR p_delay);
 void  utilEEWriteOnOff(USHORT p_port,UCHAR p_mode);
 void  utilEEWrite(USHORT p_port, USHORT ee_data, USHORT ee_addr);
 USHORT utilEERead(USHORT p_port, USHORT ee_addr);
+USHORT utilEEReadOrg(USHORT p_port, USHORT ee_addr);
 void  utilEESendCmdAddr(USHORT p_port, UCHAR ee_cmd, USHORT ee_addr);
 #else
 void  Wait1Second(ULONG p_port);
@@ -2137,6 +2124,7 @@ void  Wait(ULONG p_port, UCHAR p_delay);
 void  utilEEWriteOnOff(ULONG p_port,UCHAR p_mode);
 void  utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr);
 USHORT utilEERead(ULONG p_port, USHORT ee_addr);
+USHORT utilEEReadOrg(ULONG p_port, USHORT ee_addr);
 void  utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr);
 #endif
 
@@ -2339,7 +2327,7 @@ void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
 extern unsigned int SccbGlobalFlags;
 
 
-#ident "$Id: sccb.c 1.17 1997/02/11 21:06:41 mohan Exp $"
+#ident "$Id: sccb.c 1.18 1997/06/10 16:47:04 mohan Exp $"
 /*----------------------------------------------------------------------
  *
  *
@@ -2353,9 +2341,9 @@ extern unsigned int SccbGlobalFlags;
  *   Description:  Functions relating to handling of the SCCB interface
  *                 between the device driver and the HARPOON.
  *
- *   $Date: 1997/02/11 21:06:41 $
+ *   $Date: 1997/06/10 16:47:04 $
  *
- *   $Revision: 1.17 $
+ *   $Revision: 1.18 $
  *
  *----------------------------------------------------------------------*/
 
@@ -2477,6 +2465,7 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo)
                if(ChkIfChipInitialized(ioport) == FALSE)
                {
                        pCurrNvRam = NULL;
+                  WR_HARPOON(ioport+hp_semaphore, 0x00);
                        XbowInit(ioport, 0);             /*Must Init the SCSI before attempting */
                        DiagEEPROM(ioport);
                }
@@ -3036,6 +3025,7 @@ STATIC s32bits probe_adapter(PADAPTER_INFO pAdapterInfo)
                if(ChkIfChipInitialized(ioport) == FALSE)
                {
                        pCurrNvRam = NULL;
+                  WR_HARPOON(ioport+hp_semaphore, 0x00);
                        XbowInit(ioport, 0);                /*Must Init the SCSI before attempting */
                        DiagEEPROM(ioport);
                }
@@ -4802,7 +4792,23 @@ int SccbMgr_isr(ULONG pCurrCard)
                may not show up if another device reselects us in 1.5us or
                less.  SRR Wednesday, 3/8/1995.
              */
-          while (!(RDW_HARPOON((ioport+hp_intstat)) & (BUS_FREE | RSEL))) ;
+          while (!(RDW_HARPOON((ioport+hp_intstat)) & (BUS_FREE | RSEL)) &&
+                 !((RDW_HARPOON((ioport+hp_intstat)) & PHASE) &&
+                   RD_HARPOON((ioport+hp_scsisig)) ==
+                   (SCSI_BSY | SCSI_REQ | SCSI_CD | SCSI_MSG | SCSI_IOBIT))) ;
+
+          /*
+            The additional loop exit condition above detects a timing problem
+            with the revision D/E harpoon chips.  The caller should reset the
+            host adapter to recover when 0xFE is returned.
+          */
+          if (!(RDW_HARPOON((ioport+hp_intstat)) & (BUS_FREE | RSEL)))
+            {
+              mOS_Lock((PSCCBcard)pCurrCard);
+              MENABLE_INT(ioport);
+              mOS_UnLock((PSCCBcard)pCurrCard);
+              return 0xFE;
+            }
 
          WRW_HARPOON((ioport+hp_intstat), (BUS_FREE | ITAR_DISC));
 
@@ -5347,7 +5353,7 @@ void Debug_Load(UCHAR p_card, UCHAR p_bug_data)
 }
 
 #endif
-#ident "$Id: sccb_dat.c 1.9 1997/01/31 02:12:58 mohan Exp $"
+#ident "$Id: sccb_dat.c 1.10 1997/02/22 03:16:02 awin Exp $"
 /*----------------------------------------------------------------------
  *
  *
@@ -5361,9 +5367,9 @@ void Debug_Load(UCHAR p_card, UCHAR p_bug_data)
  *   Description:  Functions relating to handling of the SCCB interface 
  *                 between the device driver and the HARPOON.
  *
- *   $Date: 1997/01/31 02:12:58 $
+ *   $Date: 1997/02/22 03:16:02 $
  *
- *   $Revision: 1.9 $
+ *   $Revision: 1.10 $
  *
  *----------------------------------------------------------------------*/
 
@@ -5378,18 +5384,19 @@ void Debug_Load(UCHAR p_card, UCHAR p_bug_data)
 /*#include <target.h>*/
 /*#include <harpoon.h>*/
 
+/*
+**  IMPORTANT NOTE!!!
+**
+**  You MUST preassign all data to a valid value or zero.  This is
+**  required due to the MS compiler bug under OS/2 and Solaris Real-Mode
+**  driver environment.
+*/
 
-#if defined(OS2) || defined (SOLARIS_REAL_MODE)
-SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] = { 0 };
-SCCBCARD BL_Card[MAX_CARDS] = { 0 };
-SCCBSCAM_INFO scamInfo[MAX_SCSI_TAR] = { 0 };
-NVRAMINFO nvRamInfo[MAX_MB_CARDS] = { 0 };
-#else
-SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
-SCCBCARD BL_Card[MAX_CARDS];
-SCCBSCAM_INFO scamInfo[MAX_SCSI_TAR];
-NVRAMINFO nvRamInfo[MAX_MB_CARDS];
-#endif
+
+SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] = { { { 0 } } };
+SCCBCARD BL_Card[MAX_CARDS] = { { 0 } };
+SCCBSCAM_INFO scamInfo[MAX_SCSI_TAR] = { { { 0 } } };
+NVRAMINFO nvRamInfo[MAX_MB_CARDS] = { { 0 } };
 
 
 #if defined(OS2)
@@ -5402,23 +5409,23 @@ void (*s_PhaseTbl[8]) ();
 #endif
 
 #if defined(DOS)
-UCHAR first_time;
+UCHAR first_time = 0;
 #endif
 
-UCHAR mbCards;
+UCHAR mbCards = 0;
 UCHAR scamHAString[] = {0x63, 0x07, 'B', 'U', 'S', 'L', 'O', 'G', 'I', 'C', \
                                                                ' ', 'B', 'T', '-', '9', '3', '0', \
                                                                0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, \
                                                                0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20};
 
-USHORT default_intena;
+USHORT default_intena = 0;
 
 #if defined(BUGBUG)
-UCHAR    debug_int[MAX_CARDS][debug_size];
-UCHAR    debug_index[MAX_CARDS];
-UCHAR    reserved_1[3];
+UCHAR    debug_int[MAX_CARDS][debug_size] = { 0 };
+UCHAR    debug_index[MAX_CARDS] = { 0 };
+UCHAR    reserved_1[3] = { 0 };
 #endif
-#ident "$Id: scsi.c 1.19 1997/01/31 02:08:14 mohan Exp $"
+#ident "$Id: scsi.c 1.23 1997/07/09 21:42:54 mohan Exp $"
 /*----------------------------------------------------------------------
  *
  *
@@ -5433,9 +5440,9 @@ UCHAR    reserved_1[3];
  *                 selection/reselection, sync negotiation, message-in
  *                 decoding.
  *
- *   $Date: 1997/01/31 02:08:14 $
+ *   $Date: 1997/07/09 21:42:54 $
  *
- *   $Revision: 1.19 $
+ *   $Revision: 1.23 $
  *
  *----------------------------------------------------------------------*/
 
@@ -5483,11 +5490,13 @@ UCHAR sfm(ULONG port, PSCCB pCurrSCCB)
        while( (!(RD_HARPOON(port+hp_scsisig) & SCSI_REQ)) &&
                        (TimeOutLoop++ < 20000) ){}
 
+
        WR_HARPOON(port+hp_portctrl_0, SCSI_PORT);
 
        message = RD_HARPOON(port+hp_scsidata_0);
 
-       WR_HARPOON(port+hp_scsisig, (SCSI_ACK + S_ILL_PH));
+       WR_HARPOON(port+hp_scsisig, SCSI_ACK + S_MSGI_PH);
+
 
        if (TimeOutLoop > 20000)
                message = 0x00;   /* force message byte = 0 if Time Out on Req */
@@ -5495,6 +5504,10 @@ UCHAR sfm(ULONG port, PSCCB pCurrSCCB)
        if ((RDW_HARPOON((port+hp_intstat)) & PARITY) &&
                (RD_HARPOON(port+hp_addstat) & SCSI_PAR_ERR))
        {
+               WR_HARPOON(port+hp_scsisig, (SCSI_ACK + S_ILL_PH));
+               WR_HARPOON(port+hp_xferstat, 0);
+               WR_HARPOON(port+hp_fiforead, 0);
+               WR_HARPOON(port+hp_fifowrite, 0);
                if (pCurrSCCB != NULL)
                {
                        pCurrSCCB->Sccb_scsimsg = SMPARITY;
@@ -5503,6 +5516,7 @@ UCHAR sfm(ULONG port, PSCCB pCurrSCCB)
                do
                {
                        ACCEPT_MSG_ATN(port);
+                       TimeOutLoop = 0;
                        while( (!(RD_HARPOON(port+hp_scsisig) & SCSI_REQ)) &&
                                (TimeOutLoop++ < 20000) ){}
                        if (TimeOutLoop > 20000)
@@ -5524,6 +5538,10 @@ UCHAR sfm(ULONG port, PSCCB pCurrSCCB)
                }while(1);
 
        }
+       WR_HARPOON(port+hp_scsisig, (SCSI_ACK + S_ILL_PH));
+       WR_HARPOON(port+hp_xferstat, 0);
+       WR_HARPOON(port+hp_fiforead, 0);
+       WR_HARPOON(port+hp_fifowrite, 0);
        return(message);
 }
 
@@ -5894,12 +5912,20 @@ void sres(USHORT port, UCHAR p_card, PSCCBcard pCurrCard)
 void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
 #endif
 {
+
+#if defined(V302)
 #ifdef DOS
    UCHAR our_target,message, msgRetryCount;
    extern UCHAR lun, tag;
 #else
    UCHAR our_target,message,lun,tag, msgRetryCount;
 #endif
+
+#else  /* V302 */
+   UCHAR our_target, message, lun = 0, tag, msgRetryCount;
+#endif /* V302 */
+
+
    PSCCBMgr_tar_info currTar_Info;
        PSCCB currSCCB;
 
@@ -5972,7 +5998,103 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
        msgRetryCount = 0;
        do
        {
+
+#if defined(V302)
+
                message = GetTarLun(port, p_card, our_target, pCurrCard, &tag, &lun);
+
+#else /* V302 */
+
+               currTar_Info = &sccbMgrTbl[p_card][our_target];
+               tag = 0;
+
+
+               while(!(RD_HARPOON(port+hp_scsisig) & SCSI_REQ))
+               {
+                       if (! (RD_HARPOON(port+hp_scsisig) & SCSI_BSY))
+                       {
+
+                               WRW_HARPOON((port+hp_intstat), PHASE);
+                               return;
+                       }
+               }
+
+               WRW_HARPOON((port+hp_intstat), PHASE);
+               if ((RD_HARPOON(port+hp_scsisig) & S_SCSI_PHZ) == S_MSGI_PH)
+               {
+
+                       message = sfm(port,pCurrCard->currentSCCB);
+                       if (message)
+                       {
+
+                               if (message <= (0x80 | LUN_MASK))
+                               {
+                                       lun = message & (UCHAR)LUN_MASK;
+
+#if !defined(DOS)
+                                       if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_TRYING)
+                                       {
+                                               if (currTar_Info->TarTagQ_Cnt != 0)
+                                               {
+
+                                                       if (!(currTar_Info->TarLUN_CA))
+                                                       {
+                                                               ACCEPT_MSG(port);    /*Release the ACK for ID msg. */
+
+
+                                                               message = sfm(port,pCurrCard->currentSCCB);
+                                                               if (message)
+                                                               {
+                                                                       ACCEPT_MSG(port);
+                                                               }
+
+                                                               else
+                                                               message = FALSE;
+
+                                                               if(message != FALSE)
+                                                               {
+                                                                       tag = sfm(port,pCurrCard->currentSCCB);
+
+                                                                       if (!(tag)) 
+                                                                               message = FALSE;
+                                                               }
+
+                                                       } /*C.A. exists! */
+
+                                               } /*End Q cnt != 0 */
+
+                                       } /*End Tag cmds supported! */
+#endif /* !DOS */
+
+                               } /*End valid ID message.  */
+
+                               else
+                               {
+
+                                       ACCEPT_MSG_ATN(port);
+                               }
+
+                       } /* End good id message. */
+
+                       else
+                       {
+
+                               message = FALSE;
+                       }
+               }
+               else
+               {
+                       ACCEPT_MSG_ATN(port);
+
+                  while (!(RDW_HARPOON((port+hp_intstat)) & (PHASE | RESET)) &&
+                         !(RD_HARPOON(port+hp_scsisig) & SCSI_REQ) &&
+                         (RD_HARPOON(port+hp_scsisig) & SCSI_BSY)) ;
+
+                       return;
+               }
+       
+#endif /* V302 */
+
                if(message == FALSE)
                {
                        msgRetryCount++;
@@ -6071,6 +6193,8 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
          (RD_HARPOON(port+hp_scsisig) & SCSI_BSY)) ;
 }
 
+#if defined(V302)
+
 #if defined(DOS)
 UCHAR GetTarLun(USHORT port, UCHAR p_card, UCHAR our_target, PSCCBcard pCurrCard, PUCHAR tag, PUCHAR lun)
 #else
@@ -6162,6 +6286,7 @@ UCHAR GetTarLun(ULONG port, UCHAR p_card, UCHAR our_target, PSCCBcard pCurrCard,
        return(TRUE);
 }
 
+#endif /* V302 */
 
 #if defined(DOS)
 void SendMsg(USHORT port, UCHAR message)
@@ -6469,6 +6594,10 @@ void shandem(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
                                ACCEPT_MSG(port);
                        WR_HARPOON(port+hp_autostart_1, (AUTO_IMMED+DISCONNECT_START));
                }
+       }else
+       {
+                       if(pCurrSCCB->Sccb_scsimsg == SMPARITY)
+                               WR_HARPOON(port+hp_autostart_1, (AUTO_IMMED+DISCONNECT_START));
        }
 }
 
@@ -7386,6 +7515,7 @@ void sinits(PSCCB p_sccb, UCHAR p_card)
    p_sccb->Sccb_scsistat      = BUS_FREE_ST;
    p_sccb->SccbStatus         = SCCB_IN_PROCESS;
    p_sccb->Sccb_scsimsg       = SMNO_OP;
+
 }
 
 
@@ -9222,7 +9352,7 @@ void hostDataXferRestart(PSCCB currSCCB)
       currSCCB->Sccb_XferCnt = currSCCB->DataLength - currSCCB->Sccb_ATC;
       }
 }
-#ident "$Id: scam.c 1.16 1997/01/31 02:11:12 mohan Exp $"
+#ident "$Id: scam.c 1.17 1997/03/20 23:49:37 mohan Exp $"
 /*----------------------------------------------------------------------
  *
  *
@@ -9237,9 +9367,9 @@ void hostDataXferRestart(PSCCB currSCCB)
  *                 and the determination of the SCSI IDs to be assigned
  *                 to all perspective SCSI targets.
  *
- *   $Date: 1997/01/31 02:11:12 $
+ *   $Date: 1997/03/20 23:49:37 $
  *
- *   $Revision: 1.16 $
+ *   $Revision: 1.17 $
  *
  *----------------------------------------------------------------------*/
 
@@ -9468,7 +9598,7 @@ void scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up)
        if (((ScamFlg & SCAM_ENABLED) && (scamInfo[i].state == LEGACY))
                        || (i != p_our_id))
                {
-         scsell(p_port,i);
+         scsellDOS(p_port,i);
              }
        }
 #endif
@@ -9885,6 +10015,7 @@ UCHAR sciso(ULONG p_port, UCHAR p_id_string[])
             }
 
          if ((ret_data & 0x1F) == 0)
+          {
 /*
                                if(bit_cnt != 0 || bit_cnt != 8)
                                {
@@ -9899,6 +10030,7 @@ UCHAR sciso(ULONG p_port, UCHAR p_id_string[])
                return(0x00);
             else
                return(0xFF);
+          }
 
          } /*bit loop */
 
@@ -10090,6 +10222,90 @@ UCHAR scsell(ULONG p_port, UCHAR targ_id)
       }
 }
 
+#if defined(DOS)
+/*---------------------------------------------------------------------
+ *
+ * Function: scsell for DOS
+ *
+ * Description: Select the specified device ID using a selection timeout
+ *              less than 2ms.  This was specially required to solve
+ *              the problem with Plextor 12X CD-ROM drive. This drive
+ *                                      was responding the Selection at the end of 4ms and 
+ *                                      hanging the system.
+ *
+ *---------------------------------------------------------------------*/
+
+UCHAR scsellDOS(USHORT p_port, UCHAR targ_id)
+{
+   USHORT i;
+
+   WR_HARPOON(p_port+hp_page_ctrl,
+      (RD_HARPOON(p_port+hp_page_ctrl) | G_INT_DISABLE));
+
+   ARAM_ACCESS(p_port);
+
+   WR_HARPOON(p_port+hp_addstat,(RD_HARPOON(p_port+hp_addstat) | SCAM_TIMER));
+   WR_HARPOON(p_port+hp_seltimeout,TO_2ms);
+
+
+   for (i = p_port+CMD_STRT; i < p_port+CMD_STRT+12; i+=2) {
+      WRW_HARPOON(i, (MPM_OP+ACOMMAND));
+      }
+   WRW_HARPOON(i, (BRH_OP+ALWAYS+    NP));
+
+   WRW_HARPOON((p_port+hp_intstat),
+              (RESET | TIMEOUT | SEL | BUS_FREE | AUTO_INT));
+
+   WR_HARPOON(p_port+hp_select_id, targ_id);
+
+   WR_HARPOON(p_port+hp_portctrl_0, SCSI_PORT);
+   WR_HARPOON(p_port+hp_autostart_3, (SELECT | CMD_ONLY_STRT));
+   WR_HARPOON(p_port+hp_scsictrl_0, (SEL_TAR | ENA_RESEL));
+
+
+   while (!(RDW_HARPOON((p_port+hp_intstat)) &
+           (RESET | PROG_HLT | TIMEOUT | AUTO_INT))) {}
+
+   if (RDW_HARPOON((p_port+hp_intstat)) & RESET)
+         Wait(p_port, TO_250ms);
+
+   DISABLE_AUTO(p_port);
+
+   WR_HARPOON(p_port+hp_addstat,(RD_HARPOON(p_port+hp_addstat) & ~SCAM_TIMER));
+   WR_HARPOON(p_port+hp_seltimeout,TO_290ms);
+
+   SGRAM_ACCESS(p_port);
+
+   if (RDW_HARPOON((p_port+hp_intstat)) & (RESET | TIMEOUT) ) {
+
+      WRW_HARPOON((p_port+hp_intstat),
+                 (RESET | TIMEOUT | SEL | BUS_FREE | PHASE));
+
+      WR_HARPOON(p_port+hp_page_ctrl,
+         (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE));
+
+      return(FALSE);  /*No legacy device */
+      }
+
+   else {
+
+      while(!(RDW_HARPOON((p_port+hp_intstat)) & BUS_FREE)) {
+                               if (RD_HARPOON(p_port+hp_scsisig) & SCSI_REQ)
+                                       {
+                                       WR_HARPOON(p_port+hp_scsisig, (SCSI_ACK + S_ILL_PH));
+                       ACCEPT_MSG(p_port);
+                                       }
+               }
+
+      WRW_HARPOON((p_port+hp_intstat), CLR_ALL_INT_1);
+
+      WR_HARPOON(p_port+hp_page_ctrl,
+         (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE));
+
+      return(TRUE);  /*Found one of them oldies! */
+      }
+}
+#endif  /* DOS */
 
 /*---------------------------------------------------------------------
  *
@@ -10252,10 +10468,12 @@ UCHAR scmachid(UCHAR p_card, UCHAR p_id_string[])
       match--;
 
       if (match == 0xFF)
+       {
          if (p_id_string[0] & BIT(5))
             match = 7;
          else
             match = MAX_SCSI_TAR-1;
+       }
       }
 
 
@@ -10300,10 +10518,12 @@ UCHAR scmachid(UCHAR p_card, UCHAR p_id_string[])
       match--;
 
       if (match == 0xFF)
+       {
          if (p_id_string[0] & BIT(5))
             match = 7;
          else
             match = MAX_SCSI_TAR-1;
+       }
       }
 
    return(NO_ID_AVAIL);
@@ -10362,7 +10582,7 @@ void scsavdi(UCHAR p_card, ULONG p_port)
    utilEEWrite(p_port, sum_data, EEPROM_CHECK_SUM/2);
    utilEEWriteOnOff(p_port,0);   /* Turn off write access */
 }
-#ident "$Id: diagnose.c 1.9 1997/01/31 02:09:48 mohan Exp $"
+#ident "$Id: diagnose.c 1.10 1997/06/10 16:51:47 mohan Exp $"
 /*----------------------------------------------------------------------
  *
  *
@@ -10376,9 +10596,9 @@ void scsavdi(UCHAR p_card, ULONG p_port)
  *   Description:  Diagnostic funtions for testing the integrity of
  *                 the HARPOON.
  *
- *   $Date: 1997/01/31 02:09:48 $
+ *   $Date: 1997/06/10 16:51:47 $
  *
- *   $Revision: 1.9 $
+ *   $Revision: 1.10 $
  *
  *----------------------------------------------------------------------*/
 
@@ -10419,7 +10639,7 @@ UCHAR i;
    WR_HARPOON(port+hp_scsireset,(DMA_RESET | HPSCSI_RESET | PROG_RESET | \
                                 FIFO_CLR));
 
-   WR_HARPOON(port+hp_scsireset,0x00);
+   WR_HARPOON(port+hp_scsireset,SCSI_INI);
 
    WR_HARPOON(port+hp_clkctrl_0,CLKCTRL_DEFAULT);
 
@@ -10703,8 +10923,8 @@ void DiagEEPROM(ULONG p_port)
    temp += 0x70D3;
    utilEEWrite(p_port, 0x0010, BIOS_CONFIG/2);
    temp += 0x0010;
-   utilEEWrite(p_port, 0x0007, SCAM_CONFIG/2);
-   temp += 0x0007;
+   utilEEWrite(p_port, 0x0003, SCAM_CONFIG/2);
+   temp += 0x0003;
    utilEEWrite(p_port, 0x0007, ADAPTER_SCSI_ID/2);
    temp += 0x0007;
 
@@ -10807,7 +11027,7 @@ void DiagEEPROM(ULONG p_port)
 
 }
 
-#ident "$Id: utility.c 1.22 1997/01/31 02:12:23 mohan Exp $"
+#ident "$Id: utility.c 1.23 1997/06/10 16:55:06 mohan Exp $"
 /*----------------------------------------------------------------------
  *
  *
@@ -10821,9 +11041,9 @@ void DiagEEPROM(ULONG p_port)
  *   Description:  Utility functions relating to queueing and EEPROM
  *                 manipulation and any other garbage functions.
  *
- *   $Date: 1997/01/31 02:12:23 $
+ *   $Date: 1997/06/10 16:55:06 $
  *
- *   $Revision: 1.22 $
+ *   $Revision: 1.23 $
  *
  *----------------------------------------------------------------------*/
 /*#include <globals.h>*/
@@ -11616,11 +11836,14 @@ void utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr)
          else
         ee_value &= ~SEE_DO;
 
+         WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          ee_value |= SEE_CLK;          /* Clock  data! */
          WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
+         WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          ee_value &= ~SEE_CLK;
          WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
+         WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          }
    ee_value &= (EXT_ARB_ACK | SCSI_TERM_ENA_H);
    WR_HARPOON(p_port+hp_ee_ctrl, (ee_value | SEE_MS));
@@ -11632,7 +11855,6 @@ void utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr)
    WR_HARPOON(p_port+hp_ee_ctrl, ee_value);       /* Turn off Master Select */
 }
 
-
 /*---------------------------------------------------------------------
  *
  * Function: Read EEPROM
@@ -11647,6 +11869,40 @@ USHORT utilEERead(USHORT p_port, USHORT ee_addr)
 #else
 USHORT utilEERead(ULONG p_port, USHORT ee_addr)
 #endif
+{
+   USHORT i, ee_data1, ee_data2;
+
+       i = 0;
+       ee_data1 = utilEEReadOrg(p_port, ee_addr);
+       do
+       {
+               ee_data2 = utilEEReadOrg(p_port, ee_addr);
+
+               if(ee_data1 == ee_data2)
+                       return(ee_data1);
+
+               ee_data1 = ee_data2;
+               i++;
+
+       }while(i < 4);
+
+       return(ee_data1);
+}
+
+/*---------------------------------------------------------------------
+ *
+ * Function: Read EEPROM Original 
+ *
+ * Description: Read a word from the EEPROM at the desired
+ *              address.
+ *
+ *---------------------------------------------------------------------*/
+
+#if defined(DOS)
+USHORT utilEEReadOrg(USHORT p_port, USHORT ee_addr)
+#else
+USHORT utilEEReadOrg(ULONG p_port, USHORT ee_addr)
+#endif
 {
 
    UCHAR ee_value;
@@ -11666,8 +11922,10 @@ USHORT utilEERead(ULONG p_port, USHORT ee_addr)
 
          ee_value |= SEE_CLK;          /* Clock  data! */
          WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
+         WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          ee_value &= ~SEE_CLK;
          WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
+         WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
 
          ee_data <<= 1;
 
@@ -11721,11 +11979,14 @@ void utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr)
          else
                 ee_value &= ~SEE_DO;
 
+         WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          ee_value |= SEE_CLK;                         /* Clock  data! */
          WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
+         WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          ee_value &= ~SEE_CLK;
          WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
+         WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          }
 
 
@@ -11743,11 +12004,14 @@ void utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr)
          else
                 ee_value &= ~SEE_DO;
 
+         WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          ee_value |= SEE_CLK;                         /* Clock  data! */
          WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
+         WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
          ee_value &= ~SEE_CLK;
          WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
+         WR_HARPOON(p_port+hp_ee_ctrl, ee_value);
 
          i >>= 1;
          }
@@ -11785,4 +12049,112 @@ UCHAR CalcLrc(UCHAR buffer[])
 
 
 
+/*
+  The following inline definitions avoid type conflicts.
+*/
+
+static inline unsigned char
+FlashPoint__ProbeHostAdapter(FlashPoint_Info_T *FlashPointInfo)
+{
+  return FlashPoint_ProbeHostAdapter((PSCCBMGR_INFO) FlashPointInfo);
+}
+
+
+static inline FlashPoint_CardHandle_T
+FlashPoint__HardwareResetHostAdapter(FlashPoint_Info_T *FlashPointInfo)
+{
+  return FlashPoint_HardwareResetHostAdapter((PSCCBMGR_INFO) FlashPointInfo);
+}
+
+static inline void
+FlashPoint__ReleaseHostAdapter(FlashPoint_CardHandle_T CardHandle)
+{
+  FlashPoint_ReleaseHostAdapter(CardHandle);
+}
+
+
+static inline void
+FlashPoint__StartCCB(FlashPoint_CardHandle_T CardHandle, BusLogic_CCB_T *CCB)
+{
+  FlashPoint_StartCCB(CardHandle, (PSCCB) CCB);
+}
+
+
+static inline void
+FlashPoint__AbortCCB(FlashPoint_CardHandle_T CardHandle, BusLogic_CCB_T *CCB)
+{
+  FlashPoint_AbortCCB(CardHandle, (PSCCB) CCB);
+}
+
+
+static inline boolean
+FlashPoint__InterruptPending(FlashPoint_CardHandle_T CardHandle)
+{
+  return FlashPoint_InterruptPending(CardHandle);
+}
+
+
+static inline int
+FlashPoint__HandleInterrupt(FlashPoint_CardHandle_T CardHandle)
+{
+  return FlashPoint_HandleInterrupt(CardHandle);
+}
+
+
+#define FlashPoint_ProbeHostAdapter        FlashPoint__ProbeHostAdapter
+#define FlashPoint_HardwareResetHostAdapter FlashPoint__HardwareResetHostAdapter
+#define FlashPoint_ReleaseHostAdapter      FlashPoint__ReleaseHostAdapter
+#define FlashPoint_StartCCB                FlashPoint__StartCCB
+#define FlashPoint_AbortCCB                FlashPoint__AbortCCB
+#define FlashPoint_InterruptPending        FlashPoint__InterruptPending
+#define FlashPoint_HandleInterrupt         FlashPoint__HandleInterrupt
+
+
+/*
+  FlashPoint_InquireTargetInfo returns the Synchronous Period, Synchronous
+  Offset, and Wide Transfers Active information for TargetID on CardHandle.
+*/
+
+void FlashPoint_InquireTargetInfo(FlashPoint_CardHandle_T CardHandle,
+                                 int TargetID,
+                                 unsigned char *SynchronousPeriod,
+                                 unsigned char *SynchronousOffset,
+                                 unsigned char *WideTransfersActive)
+{
+  SCCBMGR_TAR_INFO *TargetInfo =
+    &sccbMgrTbl[((SCCBCARD *)CardHandle)->cardIndex][TargetID];
+  if ((TargetInfo->TarSyncCtrl & SYNC_OFFSET) > 0)
+    {
+      *SynchronousPeriod = 5 * ((TargetInfo->TarSyncCtrl >> 5) + 1);
+      *SynchronousOffset = TargetInfo->TarSyncCtrl & SYNC_OFFSET;
+    }
+  else
+    {
+      *SynchronousPeriod = 0;
+      *SynchronousOffset = 0;
+    }
+  *WideTransfersActive = (TargetInfo->TarSyncCtrl & NARROW_SCSI ? 0 : 1);
+}
+
+
+#else  /* CONFIG_SCSI_OMIT_FLASHPOINT */
+
+
+/*
+  Define prototypes for the FlashPoint SCCB Manager Functions.
+*/
+
+extern unsigned char FlashPoint_ProbeHostAdapter(FlashPoint_Info_T *);
+extern FlashPoint_CardHandle_T
+       FlashPoint_HardwareResetHostAdapter(FlashPoint_Info_T *);
+extern void FlashPoint_StartCCB(FlashPoint_CardHandle_T, BusLogic_CCB_T *);
+extern int FlashPoint_AbortCCB(FlashPoint_CardHandle_T, BusLogic_CCB_T *);
+extern boolean FlashPoint_InterruptPending(FlashPoint_CardHandle_T);
+extern int FlashPoint_HandleInterrupt(FlashPoint_CardHandle_T);
+extern void FlashPoint_ReleaseHostAdapter(FlashPoint_CardHandle_T);
+extern void FlashPoint_InquireTargetInfo(FlashPoint_CardHandle_T,
+                                        int, unsigned char *,
+                                        unsigned char *, unsigned char *);
+
+
 #endif /* CONFIG_SCSI_OMIT_FLASHPOINT */
index 0b1559d3c1e2bdf18fe9342018659cd2a26edb0c..53d618a91ec65275b22c2e8b777f3e27220f813c 100644 (file)
@@ -370,11 +370,8 @@ endif
 
 include $(TOPDIR)/Rules.make
 
-BusLogic.o: BusLogic.c FlashPoint.c
-       $(CC) $(CFLAGS) -c BusLogic.c -o BusLogic.O
-       $(CC) $(CFLAGS) -c FlashPoint.c -o FlashPoint.O
-       $(LD) -r -o BusLogic.o BusLogic.O FlashPoint.O
-       rm -f BusLogic.O FlashPoint.O
+BusLogic.o: BusLogic.c
+       $(CC) $(CFLAGS) -c BusLogic.c -o BusLogic.o
 
 aha152x.o: aha152x.c
        $(CC) $(CFLAGS) $(AHA152X) -c aha152x.c 
index a9962dbbc030116375cea00a592cb58349a9ad59..60fa4011c00e44eea33137259a7277467734080f 100644 (file)
@@ -1,10 +1,10 @@
           BusLogic MultiMaster and FlashPoint SCSI Driver for Linux
 
-                        Version 2.0.10 for Linux 2.0
+                        Version 2.0.11 for Linux 2.0
 
                              PRODUCTION RELEASE
 
-                               11 August 1997
+                               31 January 1998
 
                               Leonard N. Zubkoff
                               Dandelion Digital
 
                                 INTRODUCTION
 
-BusLogic, Inc. designs and manufactures a variety of high performance SCSI host
-adapters which share a common programming interface across a diverse collection
-of bus architectures by virtue of their MultiMaster ASIC technology.  This
-driver supports all present BusLogic MultiMaster Host Adapters, and should
+BusLogic, Inc. designed and manufactured a variety of high performance SCSI
+host adapters which share a common programming interface across a diverse
+collection of bus architectures by virtue of their MultiMaster ASIC technology.
+BusLogic was acquired by Mylex Corporation in February 1996, but the products
+supported by this driver originated under the BusLogic name and so that name is
+retained in the source code and documentation.
+
+This driver supports all present BusLogic MultiMaster Host Adapters, and should
 support any future MultiMaster designs with little or no modification.  More
-recently, BusLogic has introduced the FlashPoint Host Adapters, which are less
+recently, BusLogic introduced the FlashPoint Host Adapters, which are less
 costly and rely on the host CPU, rather than including an onboard processor.
-Mylex/BusLogic has recently provided me with the FlashPoint Driver Developer's
-Kit, which comprises documentation and freely redistributable source code for
-the FlashPoint SCCB Manager.  The SCCB Manager is the library of code that runs
-on the host CPU and performs functions analogous to the firmware on the
-MultiMaster Host Adapters.  Thanks to their having provided the SCCB Manager,
-this driver now supports the FlashPoint Host Adapters as well.
+Despite not having an onboard CPU, the FlashPoint Host Adapters perform very
+well and have very low command latency.  BusLogic has recently provided me with
+the FlashPoint Driver Developer's Kit, which comprises documentation and freely
+redistributable source code for the FlashPoint SCCB Manager.  The SCCB Manager
+is the library of code that runs on the host CPU and performs functions
+analogous to the firmware on the MultiMaster Host Adapters.  Thanks to their
+having provided the SCCB Manager, this driver now supports the FlashPoint Host
+Adapters as well.
 
 My primary goals in writing this completely new BusLogic driver for Linux are
 to achieve the full performance that BusLogic SCSI Host Adapters and modern
 SCSI peripherals are capable of, and to provide a highly robust driver that can
 be depended upon for high performance mission critical applications.  All of
 the major performance and error recovery features can be configured from the
-Linux kernel command line, allowing individual installations to tune driver
-performance and error recovery to their particular needs.
+Linux kernel command line or at module initialization time, allowing individual
+installations to tune driver performance and error recovery to their particular
+needs.
 
 The latest information on Linux support for BusLogic SCSI Host Adapters, as
 well as the most recent release of this driver and the latest firmware for the
@@ -48,33 +55,35 @@ driver and SCSI subsystem at startup, along with any subsequent system messages
 relevant to SCSI operations, and a detailed description of your system's
 hardware configuration.
 
-BusLogic has been an excellent company to work with and I highly recommend
-their products to the Linux community.  In November 1995, I was offered the
+Mylex has been an excellent company to work with and I highly recommend their
+products to the Linux community.  In November 1995, I was offered the
 opportunity to become a beta test site for their latest MultiMaster product,
 the BT-948 PCI Ultra SCSI Host Adapter, and then again for the BT-958 PCI Wide
 Ultra SCSI Host Adapter in January 1996.  This was mutually beneficial since
-BusLogic received a degree and kind of testing that their own testing group
-cannot readily achieve, and the Linux community has available high performance
-host adapters that have been well tested with Linux even before being brought
-to market.  This relationship has also given me the opportunity to interact
+Mylex received a degree and kind of testing that their own testing group cannot
+readily achieve, and the Linux community has available high performance host
+adapters that have been well tested with Linux even before being brought to
+market.  This relationship has also given me the opportunity to interact
 directly with their technical staff, to understand more about the internal
 workings of their products, and in turn to educate them about the needs and
-potential of the Linux community.  Their interest and support is greatly
-appreciated.
+potential of the Linux community.
+
+More recently, Mylex has reaffirmed the company's interest in supporting the
+Linux community, and I am now working on a Linux driver for the DAC960 PCI RAID
+Controllers.  Mylex's interest and support is greatly appreciated.
 
-Unlike some other vendors, if you contact BusLogic Technical Support with a
+Unlike some other vendors, if you contact Mylex Technical Support with a
 problem and are running Linux, they will not tell you that your use of their
 products is unsupported.  Their latest product marketing literature even states
-"BusLogic SCSI host adapters are compatible with all major operating systems
+"Mylex SCSI host adapters are compatible with all major operating systems
 including: ... Linux ...".
 
-BusLogic, Inc. is located at 4151 Burton Drive, Santa Clara, California, 95054,
-USA and can be reached by Voice at 408/492-9090 or by FAX at 408/492-1542.
-BusLogic maintains a World Wide Web site at http://www.buslogic.com, an
-anonymous FTP site at ftp.buslogic.com, and a BBS at 408/492-1984.  BusLogic
-Technical Support can be reached by electronic mail at techsup@buslogic.com, by
-Voice at 408/654-0760, or by FAX at 408/492-1542.  Contact information for
-offices in Europe and Japan is available on the Web site.
+Mylex Corporation is located at 34551 Ardenwood Blvd., Fremont, California
+94555, USA and can be reached at 510/796-6100 or on the World Wide Web at
+http://www.mylex.com.  Mylex Technical Support can be reached by electronic
+mail at techsup@mylex.com, by Voice at 510/608-2400, or by FAX at 510/745-7715.
+Contact information for offices in Europe and Japan is available on the Web
+site.
 
 
                                DRIVER FEATURES
@@ -83,15 +92,46 @@ o Configuration Reporting and Testing
 
   During system initialization, the driver reports extensively on the host
   adapter hardware configuration, including the synchronous transfer parameters
-  negotiated with each target device.  In addition, the driver tests the
-  hardware interrupt configuration to verify that interrupts are actually
-  delivered correctly to the interrupt handler.  This should catch a high
-  percentage of PCI motherboard configuration errors early, because when the
-  host adapter is probed successfully, most of the remaining problems appear to
-  be related to interrupts.  Most often, any remaining hardware problems are
-  related to the specific configuration of devices on the SCSI bus, and the
-  quality of cabling and termination used.  Finally, this BusLogic driver
-  should never incorrectly attempt to support an Adaptec 154x Host Adapter.
+  requested and negotiated with each target device.  AutoSCSI settings for
+  Synchronous Negotiation, Wide Negotiation, and Disconnect/Reconnect are
+  reported for each target device, as well as the status of Tagged Queuing and
+  Error Recovery.  If the same setting is in effect for all target devices,
+  then a single word or phrase is used; otherwise, a letter is provided for
+  each target device to indicate the individual status.  The following examples
+  should clarify this reporting format:
+
+    Synchronous Negotiation: Ultra
+
+      Synchronous negotiation is enabled for all target devices and the host
+      adapter will attempt to negotiate for 20.0 mega-transfers/second.
+
+    Synchronous Negotiation: Fast
+
+      Synchronous negotiation is enabled for all target devices and the host
+      adapter will attempt to negotiate for 10.0 mega-transfers/second.
+
+    Synchronous Negotiation: Slow
+
+      Synchronous negotiation is enabled for all target devices and the host
+      adapter will attempt to negotiate for 5.0 mega-transfers/second.
+
+    Synchronous Negotiation: Disabled
+
+      Synchronous negotiation is disabled and all target devices are limited to
+      asynchronous operation.
+
+    Synchronous Negotiation: UFSNUUU#UUUUUUUU
+
+      Synchronous negotiation to Ultra speed is enabled for target devices 0
+      and 4 through 15, to Fast speed for target device 1, to Slow speed for
+      target device 2, and is not permitted to target device 3.  The host
+      adapter's SCSI ID is represented by the "#".
+
+    The status of Wide Negotiation, Disconnect/Reconnect, and Tagged Queuing
+    are reported as "Enabled", Disabled", or a sequence of "Y" and "N" letters.
+
+    The Error Recovery option is reported as "Default", "Hard Reset",
+    "Bus Device Reset", "None" or a sequence of "D", "H", "B", and "N" letters.
 
 o Performance Features
 
@@ -103,16 +143,15 @@ o Performance Features
   addition, BusLogic's Strict Round Robin Mode is used to optimize host adapter
   performance, and scatter/gather I/O can support as many segments as can be
   effectively utilized by the Linux I/O subsystem.  Control over the use of
-  tagged queuing for each target device as well as selection of the tagged
-  queue depth is available from the kernel command line.  By default, the queue
-  depth is automatically determined based on the number, type, speed, and
-  capabilities of the target devices found.  In addition, tagged queuing is
-  automatically disabled whenever the host adapter firmware version is known
-  not to implement it correctly, or whenever a tagged queue depth of 1 is
-  selected.  Tagged queuing is also disabled for individual target devices if
-  disconnect/reconnect is disabled for that device.  In performance testing,
-  sustained disk writes of 7.3MB per second have been observed to a /dev/sd
-  device.
+  tagged queuing for each target device as well as individual selection of the
+  tagged queue depth is available through driver options provided on the kernel
+  command line or at module initialization time.  By default, the queue depth
+  is determined automatically based on the host adapter's total queue depth and
+  the number, type, speed, and capabilities of the target devices found.  In
+  addition, tagged queuing is automatically disabled whenever the host adapter
+  firmware version is known not to implement it correctly, or whenever a tagged
+  queue depth of 1 is selected.  Tagged queuing is also disabled for individual
+  target devices if disconnect/reconnect is disabled for that device.
 
 o Robustness Features
 
@@ -121,15 +160,15 @@ o Robustness Features
   a selection is made between a full host adapter hard reset and SCSI bus reset
   versus sending a bus device reset message to the individual target device
   based on the recommendation of the SCSI subsystem.  Error recovery strategies
-  are selectable from the kernel command line individually for each target
-  device, and also include sending a bus device reset to the specific target
-  device associated with the command being reset, as well as suppressing error
+  are selectable through driver options individually for each target device,
+  and also include sending a bus device reset to the specific target device
+  associated with the command being reset, as well as suppressing error
   recovery entirely to avoid perturbing an improperly functioning device.  If
   the bus device reset error recovery strategy is selected and sending a bus
   device reset does not restore correct operation, the next command that is
   reset will force a full host adapter hard reset and SCSI bus reset.  SCSI bus
   resets caused by other devices and detected by the host adapter are also
-  handled by issuing a hard reset to the host adapter and re-initialization.
+  handled by issuing a soft reset to the host adapter and re-initialization.
   Finally, if tagged queuing is active and more than one command reset occurs
   in a 10 minute interval, or if a command reset occurs within the first 10
   minutes of operation, then tagged queuing will be disabled for that target
@@ -138,15 +177,6 @@ o Robustness Features
   lock up or crash, and thereby allowing a clean shutdown and restart after the
   offending component is removed.
 
-o Extensive Testing
-
-  This driver has undergone extensive testing and improvement over a period of
-  several months, and is routinely being used on heavily loaded systems.  Over
-  300 people retrieved the driver during the beta test period.  In addition to
-  testing in normal system operation, error recovery tests have been performed
-  to verify proper system recovery in the case of simulated dropped interrupts,
-  external SCSI bus resets, and SCSI command errors due to bad CD-ROM media.
-
 o PCI Configuration Support
 
   On PCI systems running kernels compiled with PCI BIOS support enabled, this
@@ -159,8 +189,8 @@ o PCI Configuration Support
 
 o /proc File System Support
 
-  Copies of the host adapter configuration information together with data
-  transfer and error recovery statistics are now available through the
+  Copies of the host adapter configuration information together with updated
+  data transfer and error recovery statistics are available through the
   /proc/scsi/BusLogic/<N> interface.
 
 o Shared Interrupts Support
@@ -168,16 +198,6 @@ o Shared Interrupts Support
   On systems that support shared interrupts, any number of BusLogic Host
   Adapters may share the same interrupt request channel.
 
-o Wide SCSI Support
-
-  All BusLogic MultiMaster SCSI Host Adapters share a common programming
-  interface, except for the inevitable improvements and extensions as new
-  models are released, so support for Wide SCSI data transfer has automatically
-  been available without explicit driver support.  When used with Linux 2.0.x,
-  this driver adds explicit support for up to 15 target devices and 64 logical
-  units per target device, to fully exploit the capabilities of the newest
-  BusLogic Wide SCSI Host Adapters.
-
 
                            SUPPORTED HOST ADAPTERS
 
@@ -188,16 +208,21 @@ that it is or will be supported.
 
 FlashPoint Series PCI Host Adapters:
 
-FlashPoint LT (BT-930) Ultra SCSI-2
-FlashPoint DL (BT-932) Dual Channel Ultra SCSI-2
-FlashPoint LW (BT-950) Wide Ultra SCSI-2
-FlashPoint DW (BT-952) Dual Channel Wide Ultra SCSI-2
+FlashPoint LT (BT-930) Ultra SCSI-3
+FlashPoint LT (BT-930R)        Ultra SCSI-3 with RAIDPlus
+FlashPoint LT (BT-920) Ultra SCSI-3 (BT-930 without BIOS)
+FlashPoint DL (BT-932) Dual Channel Ultra SCSI-3
+FlashPoint DL (BT-932R)        Dual Channel Ultra SCSI-3 with RAIDPlus
+FlashPoint LW (BT-950) Wide Ultra SCSI-3
+FlashPoint LW (BT-950R)        Wide Ultra SCSI-3 with RAIDPlus
+FlashPoint DW (BT-952) Dual Channel Wide Ultra SCSI-3
+FlashPoint DW (BT-952R)        Dual Channel Wide Ultra SCSI-3 with RAIDPlus
 
 MultiMaster "W" Series Host Adapters:
 
-BT-948     PCI         Ultra SCSI-2
-BT-958     PCI         Wide Ultra SCSI-2
-BT-958D            PCI         Wide Differential Ultra SCSI-2
+BT-948     PCI         Ultra SCSI-3
+BT-958     PCI         Wide Ultra SCSI-3
+BT-958D            PCI         Wide Differential Ultra SCSI-3
 
 MultiMaster "C" Series Host Adapters:
 
@@ -231,6 +256,39 @@ BT-542B        ISA         SCSI-2 (542B revisions A - G)
 AMI FastDisk Host Adapters that are true BusLogic MultiMaster clones are also
 supported by this driver.
 
+BusLogic SCSI Host Adapters are available packaged both as bare boards and as
+retail kits.  The BT- model numbers above refer to the bare board packaging.
+The retail kit model numbers are found by replacing BT- with KT- in the above
+list.  The retail kit includes the bare board and manual as well as cabling and
+driver media and documentation that are not provided with bare boards.
+
+
+                        FLASHPOINT INSTALLATION NOTES
+
+o RAIDPlus Support
+
+  FlashPoint Host Adapters now include RAIDPlus, Mylex's bootable software
+  RAID.  RAIDPlus is not supported on Linux, and there are no plans to support
+  it.  The MD driver in Linux 2.0 provides for concatenation (LINEAR) and
+  striping (RAID-0), and support for mirroring (RAID-1), fixed parity (RAID-4),
+  and distributed parity (RAID-5) is available separately.  The built-in Linux
+  RAID support is generally more flexible and is expected to perform better
+  than RAIDPlus, so there is little impetus to include RAIDPlus support in the
+  BusLogic driver.
+
+o Enabling UltraSCSI Transfers
+
+  FlashPoint Host Adapters ship with their configuration set to "Factory
+  Default" settings that are conservative and do not allow for UltraSCSI speed
+  to be negotiated.  This results in fewer problems when these host adapters
+  are installed in systems with cabling or termination that is not sufficient
+  for UltraSCSI operation, or where existing SCSI devices do not properly
+  respond to synchronous transfer negotiation for UltraSCSI speed.  AutoSCSI
+  may be used to load "Optimum Performance" settings which allow UltraSCSI
+  speed to be negotiated with all devices, or UltraSCSI speed can be enabled on
+  an individual basis.  It is recommended that SCAM be manually disabled after
+  the "Optimum Performance" settings are loaded.
+
 
                      BT-948/958/958D INSTALLATION NOTES
 
@@ -284,113 +342,254 @@ o PCI Slot Scanning Order
   so as to recognize the host adapters in the same order as they are enumerated
   by the host adapter's BIOS.
 
-o Mega-Transfers/Second
+o Enabling UltraSCSI Transfers
+
+  The BT-948/958/958D ship with their configuration set to "Factory Default"
+  settings that are conservative and do not allow for UltraSCSI speed to be
+  negotiated.  This results in fewer problems when these host adapters are
+  installed in systems with cabling or termination that is not sufficient for
+  UltraSCSI operation, or where existing SCSI devices do not properly respond
+  to synchronous transfer negotiation for UltraSCSI speed.  AutoSCSI may be
+  used to load "Optimum Performance" settings which allow UltraSCSI speed to be
+  negotiated with all devices, or UltraSCSI speed can be enabled on an
+  individual basis.  It is recommended that SCAM be manually disabled after the
+  "Optimum Performance" settings are loaded.
+
+
+                               DRIVER OPTIONS
+
+BusLogic Driver Options may be specified either via the Linux Kernel Command
+Line or via the Loadable Kernel Module Installation Facility.  Driver Options
+for multiple host adapters may be specified either by separating the option
+strings by a semicolon, or by specifying multiple "BusLogic=" strings on the
+command line.  Individual option specifications for a single host adapter are
+separated by commas.  The Probing and Debugging Options apply to all host
+adapters whereas the remaining options apply individually only to the
+selected host adapter.
+
+The BusLogic Driver Probing Options comprise the following:
+
+IO:<integer>
+
+  The "IO:" option specifies an ISA I/O Address to be probed for a non-PCI
+  MultiMaster Host Adapter.  If neither "IO:" nor "NoProbeISA" options are
+  specified, then the standard list of BusLogic MultiMaster ISA I/O Addresses
+  will be probed (0x330, 0x334, 0x230, 0x234, 0x130, and 0x134).  Multiple
+  "IO:" options may be specified to precisely determine the I/O Addresses to
+  be probed, but the probe order will always follow the standard list.
+
+NoProbe
 
-  The driver reports on the synchronous transfer parameters negotiated between
-  the host adapter and target devices in units of "mega-transfers/second".  For
-  wide devices, the unit of transfer is 16 bits if wide negotiation has been
-  successfully completed.  Therefore, the total transfer rate to wide devices
-  will generally be twice the synchronous tranfer rate reported by the driver.
+  The "NoProbe" option disables all probing and therefore no BusLogic Host
+  Adapters will be detected.
 
+NoProbeISA
 
-                            COMMAND LINE OPTIONS
+  The "NoProbeISA" option disables probing of the standard BusLogic ISA I/O
+  Addresses and therefore only PCI MultiMaster and FlashPoint Host Adapters
+  will be detected.
 
-Many features of this driver are configurable by specification of appropriate
-kernel command line options.  A full description of the command line options
-may be found in the comments before BusLogic_Setup in the kernel source code
-file "BusLogic.c".  The following examples may be useful as a starting point:
+NoProbePCI
 
-  "BusLogic=NoProbe"
+  The "NoProbePCI" options disables the interrogation of PCI Configuration
+  Space and therefore only ISA Multimaster Host Adapters will be detected, as
+  well as PCI Multimaster Host Adapters that have their ISA Compatible I/O
+  Port set to "Primary" or "Alternate".
 
-    No probing of any kind is to be performed, and hence no BusLogic Host
-    Adapters will be detected.
+NoSortPCI
 
-  "BusLogic=NoProbeISA"
+  The "NoSortPCI" option forces PCI MultiMaster Host Adapters to be
+  enumerated in the order provided by the PCI BIOS, ignoring any setting of
+  the AutoSCSI "Use Bus And Device # For PCI Scanning Seq." option.
 
-    No probing of the standard ISA I/O Addresses will be done, and hence only
-    PCI Host Adapters will be detected.
+MultiMasterFirst
 
-  "BusLogic=NoProbePCI"
+  The "MultiMasterFirst" option forces MultiMaster Host Adapters to be probed
+  before FlashPoint Host Adapters.  By default, if both FlashPoint and PCI
+  MultiMaster Host Adapters are present, this driver will probe for
+  FlashPoint Host Adapters first unless the BIOS primary disk is controlled
+  by the first PCI MultiMaster Host Adapter, in which case MultiMaster Host
+  Adapters will be probed first.
 
-    No interrogation of PCI Configuration Space will be made, and hence only
-    ISA Multimaster Host Adapters will be detected, as well as PCI Multimaster
-    Host Adapters that have their ISA Compatible I/O Port set to "Primary" or
-    "Alternate".
+FlashPointFirst
 
-  "BusLogic=NoSortPCI"
+  The "FlashPointFirst" option forces FlashPoint Host Adapters to be probed
+  before MultiMaster Host Adapters.
 
-    PCI MultiMaster Host Adapters will be enumerated in the order provided by
-    the PCI BIOS, ignoring any setting of the AutoSCSI "Use Bus And Device #
-    For PCI Scanning Seq." option.
+The BusLogic Driver Tagged Queuing Options allow for explicitly specifying
+the Queue Depth and whether Tagged Queuing is permitted for each Target
+Device (assuming that the Target Device supports Tagged Queuing).  The Queue
+Depth is the number of SCSI Commands that are allowed to be concurrently
+presented for execution (either to the Host Adapter or Target Device).  Note
+that explicitly enabling Tagged Queuing may lead to problems; the option to
+enable or disable Tagged Queuing is provided primarily to allow disabling
+Tagged Queuing on Target Devices that do not implement it correctly.  The
+following options are available:
 
-  "BusLogic=MultiMasterFirst"
+QueueDepth:<integer>
 
-    By default, if both FlashPoint and PCI MultiMaster Host Adapters are
-    present, this driver will probe for FlashPoint Host Adapters first unless
-    the BIOS primary disk is controlled by the first PCI MultiMaster Host
-    Adapter, in which case MultiMaster Host Adapters will be probed first.
-    This option forces MultiMaster Host Adapters to be probed first.
+  The "QueueDepth:" or QD:" option specifies the Queue Depth to use for all
+  Target Devices that support Tagged Queuing.  If no Queue Depth option is
+  provided, the Queue Depth will be determined automatically based on the
+  Host Adapter's Total Queue Depth and the number, type, speed, and
+  capabilities of the detected Target Devices.  For Host Adapters that
+  require ISA Bounce Buffers, the Queue Depth is automatically set by default
+  to BusLogic_QueueDepthBounceBuffers to avoid excessive preallocation of DMA
+  Bounce Buffer memory.  Target Devices that do not support Tagged Queuing
+  always use a Queue Depth of BusLogic_UntaggedQueueDepth.
 
-  "BusLogic=FlashPointFirst"
+QueueDepth:[<integer>,<integer>...]
 
-    By default, if both FlashPoint and PCI MultiMaster Host Adapters are
-    present, this driver will probe for FlashPoint Host Adapters first unless
-    the BIOS primary disk is controlled by the first PCI MultiMaster Host
-    Adapter, in which case MultiMaster Host Adapters will be probed first.
-    This option forces FlashPoint Host Adapters to be probed first.
+  The "QueueDepth:[...]" or "QD:[...]" option specifies the Queue Depth
+  individually for each Target Device.  If an <integer> is omitted, the
+  associated Target Device will have its Queue Depth selected automatically.
 
-  "BusLogic=0x330"
+TaggedQueuing:Default
 
-    This command line limits probing to the single I/O port at 0x330.
+  The "TaggedQueuing:Default" or "TQ:Default" option permits Tagged Queuing
+  based on the firmware version of the BusLogic Host Adapter and based on
+  whether the Queue Depth allows queuing multiple commands.
 
-  "BusLogic=0,1"
+TaggedQueuing:Enable
 
-    This command line selects default probing and a tagged queue depth of 1
-    which also disables tagged queuing.  It may be useful if problems arise
-    during installation on a system with a flaky SCSI configuration.  In cases
-    of a marginal SCSI configuration it may also be beneficial to disable fast
-    transfers and/or synchronous negotiation using AutoSCSI on FlashPoint and
-    "W" and "C" series MultiMaster host adapters.  Disconnect/reconnect may
-    also be disabled for fast devices such as disk drives, but should not be
-    disabled for tape drives or other devices where a single command may take
-    over a second to execute.
+  The "TaggedQueuing:Enable" or "TQ:Enable" option enables Tagged Queuing for
+  all Target Devices on this Host Adapter, overriding any limitation that
+  would otherwise be imposed based on the Host Adapter firmware version.
 
-  "BusLogic=0,0,30"
+TaggedQueuing:Disable
 
-    This command line selects default probing and automatic tagged queue depth
-    selection, but changes the bus settle time to 30 seconds.  It may be useful
-    with SCSI devices that take an unusually long time to become ready to
-    accept commands after a SCSI bus reset.  Some tape drives will not respond
-    properly immediately after a SCSI bus reset, especially if a tape is
-    present in the drive.
+  The "TaggedQueuing:Disable" or "TQ:Disable" option disables Tagged Queuing
+  for all Target Devices on this Host Adapter.
 
-  "BusLogic=TQ:Disable"
+TaggedQueuing:<Target-Spec>
 
-    This command line selects default probing and disables tagged queuing.
+  The "TaggedQueuing:<Target-Spec>" or "TQ:<Target-Spec>" option controls
+  Tagged Queuing individually for each Target Device.  <Target-Spec> is a
+  sequence of "Y", "N", and "X" characters.  "Y" enables Tagged Queuing, "N"
+  disables Tagged Queuing, and "X" accepts the default based on the firmware
+  version.  The first character refers to Target Device 0, the second to
+  Target Device 1, and so on; if the sequence of "Y", "N", and "X" characters
+  does not cover all the Target Devices, unspecified characters are assumed
+  to be "X".
 
-  "BusLogic=0,15,TQ:N"
+The BusLogic Driver Error Recovery Option allows for explicitly specifying
+the Error Recovery action to be performed when BusLogic_ResetCommand is
+called due to a SCSI Command failing to complete successfully.  The following
+options are available:
 
-    This command line selects a tagged queue depth of 15 and disables tagged
-    queuing for target 0, while allowing tagged queuing for all other target
-    devices.
+ErrorRecovery:Default
 
-Note that limiting the tagged queue depth or disabling tagged queuing can
-substantially impact performance.
+  The "ErrorRecovery:Default" or "ER:Default" option selects between the Hard
+  Reset and Bus Device Reset options based on the recommendation of the SCSI
+  Subsystem.
 
+ErrorRecovery:HardReset
 
-                                INSTALLATION
+  The "ErrorRecovery:HardReset" or "ER:HardReset" option will initiate a Host
+  Adapter Hard Reset which also causes a SCSI Bus Reset.
 
-This distribution was prepared for Linux kernel version 2.0.30, but should be
-compatible with 2.0.4 or any later 2.0 series kernel if BusLogic.patch is also
-applied.
+ErrorRecovery:BusDeviceReset
+
+  The "ErrorRecovery:BusDeviceReset" or "ER:BusDeviceReset" option will send
+  a Bus Device Reset message to the individual Target Device causing the
+  error.  If Error Recovery is again initiated for this Target Device and no
+  SCSI Command to this Target Device has completed successfully since the Bus
+  Device Reset message was sent, then a Hard Reset will be attempted.
+
+ErrorRecovery:None
+
+  The "ErrorRecovery:None" or "ER:None" option suppresses Error Recovery.
+  This option should only be selected if a SCSI Bus Reset or Bus Device Reset
+  will cause the Target Device or a critical operation to suffer a complete
+  and unrecoverable failure.
+
+ErrorRecovery:<Target-Spec>
+
+  The "ErrorRecovery:<Target-Spec>" or "ER:<Target-Spec>" option controls
+  Error Recovery individually for each Target Device.  <Target-Spec> is a
+  sequence of "D", "H", "B", and "N" characters.  "D" selects Default, "H"
+  selects Hard Reset, "B" selects Bus Device Reset, and "N" selects None.
+  The first character refers to Target Device 0, the second to Target Device
+  1, and so on; if the sequence of "D", "H", "B", and "N" characters does not
+  cover all the possible Target Devices, unspecified characters are assumed
+  to be "D".
+
+The BusLogic Driver Miscellaneous Options comprise the following:
+
+BusSettleTime:<seconds>
+
+  The "BusSettleTime:" or "BST:" option specifies the Bus Settle Time in
+  seconds.  The Bus Settle Time is the amount of time to wait between a Host
+  Adapter Hard Reset which initiates a SCSI Bus Reset and issuing any SCSI
+  Commands.  If unspecified, it defaults to BusLogic_DefaultBusSettleTime.
+
+InhibitTargetInquiry
+
+  The "InhibitTargetInquiry" option inhibits the execution of an Inquire
+  Target Devices or Inquire Installed Devices command on MultiMaster Host
+  Adapters.  This may be necessary with some older Target Devices that do not
+  respond correctly when Logical Units above 0 are addressed.
+
+The BusLogic Driver Debugging Options comprise the following:
+
+TraceProbe
+
+  The "TraceProbe" option enables tracing of Host Adapter Probing.
+
+TraceHardwareReset
+
+  The "TraceHardwareReset" option enables tracing of Host Adapter Hardware
+  Reset.
+
+TraceConfiguration
+
+  The "TraceConfiguration" option enables tracing of Host Adapter
+  Configuration.
+
+TraceErrors
+
+  The "TraceErrors" option enables tracing of SCSI Commands that return an
+  error from the Target Device.  The CDB and Sense Data will be printed for
+  each SCSI Command that fails.
+
+Debug
+
+  The "Debug" option enables all debugging options.
+
+The following examples demonstrate setting the Queue Depth for Target Devices
+1 and 2 on the first host adapter to 7 and 15, the Queue Depth for all Target
+Devices on the second host adapter to 31, and the Bus Settle Time on the
+second host adapter to 30 seconds.
+
+Linux Kernel Command Line:
+
+  linux BusLogic=QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30
+
+LILO Linux Boot Loader (in /etc/lilo.conf):
+
+  append = "BusLogic=QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30"
+
+INSMOD Loadable Kernel Module Installation Facility:
+
+  insmod BusLogic.o \
+      'BusLogic_Options="QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30"'
+
+NOTE: Module Utilities 2.1.71 or later is required for correct parsing
+      of driver options containing commas.
+
+
+                             DRIVER INSTALLATION
+
+This distribution was prepared for Linux kernel version 2.0.33, but should be
+compatible with 2.0.4 or any later 2.0 series kernel.
 
 To install the new BusLogic SCSI driver, you may use the following commands,
 replacing "/usr/src" with wherever you keep your Linux kernel source tree:
 
   cd /usr/src
-  tar -xvzf BusLogic-2.0.10.tar.gz
+  tar -xvzf BusLogic-2.0.11.tar.gz
   mv README.* LICENSE.* BusLogic.[ch] FlashPoint.c linux/drivers/scsi
-  patch -p < BusLogic.patch        # Only for kernels prior to 2.0.30
+  patch -p < BusLogic.patch
   cd linux
   make config
   make depend
@@ -399,11 +598,6 @@ replacing "/usr/src" with wherever you keep your Linux kernel source tree:
 Then install "arch/i386/boot/zImage" as your standard kernel, run lilo if
 appropriate, and reboot.
 
-Be sure to answer "y" to the "BusLogic SCSI support" query during the "make
-config" step.  If your system was already configured for the old BusLogic
-driver or for an older version of this driver, you may omit the "make config"
-step above.
-
 
                      BUSLOGIC ANNOUNCEMENTS MAILING LIST
 
diff --git a/drivers/scsi/README.Mylex b/drivers/scsi/README.Mylex
new file mode 100644 (file)
index 0000000..a786fab
--- /dev/null
@@ -0,0 +1,6 @@
+Please see the file README.BusLogic for information about Linux support for
+Mylex (formerly BusLogic) MultiMaster and FlashPoint SCSI Host Adapters.
+
+The Mylex DAC960 PCI RAID Controllers are not supported at the present time,
+but work on a Linux driver for the DAC960 is in progress.  Please consult
+http://www.dandelion.com/Linux/ for further information on the DAC960 driver.
index bfe20c96b836f3e231f8fc197d922b8976a20b8a..18c7e037ed3a1acc0b8236b60cc07ed48029839c 100644 (file)
@@ -68,7 +68,7 @@ extern int tmscsim_proc_info(char *buffer, char **start, off_t offset, int lengt
        NULL,   /* *usage_count */      \
        &proc_scsi_tmscsim,     /* *proc_dir */         \
        tmscsim_proc_info,      /* (*proc_info)() */    \
-       "Tekram DC390(T) V1.10 Dec-05-1996",  /* *name */ \
+       "Tekram DC390(T) V1.11 Feb-05-1997",  /* *name */ \
        DC390_detect,                   \
        DC390_release,  /* (*release)() */      \
        NULL,   /* *(*info)() */        \
@@ -96,7 +96,7 @@ extern int tmscsim_proc_info(char *buffer, char **start, off_t offset, int lengt
        NULL,   /* *usage_count */      \
        &proc_scsi_tmscsim,     /* *proc_dir */         \
        tmscsim_proc_info,      /* (*proc_info)() */    \
-       "Tekram DC390(T) V1.10 Dec-05-1996",  /* *name */ \
+       "Tekram DC390(T) V1.11 Feb-05-1997",  /* *name */ \
        DC390_detect,                   \
        DC390_release,  /* (*release)() */      \
        NULL,   /* *(*info)() */        \
@@ -122,7 +122,7 @@ extern int tmscsim_proc_info(char *buffer, char **start, off_t offset, int lengt
 #define DC390_T     {          \
        NULL,                   \
        NULL,                   \
-       "Tekram DC390(T) V1.10 Dec-05-1996",\
+       "Tekram DC390(T) V1.11 Feb-05-1997",\
        DC390_detect,           \
        DC390_release,                  \
        NULL, /* info */        \
index ca5cd6ada64a0ea0957d2cb944541610697bd02e..50dc0a4cea5f37e861247a379bfda4d4c2948727 100644 (file)
@@ -258,6 +258,21 @@ static void rw_intr (Scsi_Cmnd *SCpnt)
          good_sectors = 0;
       }
     
+    /*
+     * Handle RECOVERED ERRORs that indicate success after recovery action
+     * by the target device.
+     */
+
+    if (SCpnt->sense_buffer[0] == 0xF0 &&          /* Sense data is valid */
+       SCpnt->sense_buffer[2] == RECOVERED_ERROR)
+      {
+       printk("scsidisk recovered I/O error: dev %s, sector %lu, absolute sector %lu\n",
+              kdevname(SCpnt->request.rq_dev), SCpnt->request.sector, 
+              SCpnt->request.sector + sd[MINOR(SCpnt->request.rq_dev)].start_sect);
+       good_sectors = this_count;
+       result = 0;
+      }
+
     /*
      * First case : we assume that the command succeeded.  One of two things 
      * will happen here.  Either we will be finished, or there will be more
index b840acd67d52b40d39a8ffa64215f94911e107d0..f483b89bd438eac2372b1d8d78dac5d4e5637d59 100644 (file)
@@ -519,11 +519,39 @@ int sr_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigne
        return result;
     }
        
-    case CDROMREADMODE2:
-       return -EINVAL;
+    /* these are compatible with the ide-cd driver */
+    case CDROMREADRAW:
     case CDROMREADMODE1:
-       return -EINVAL;
-       
+    case CDROMREADMODE2:
+    {
+       unsigned char      *raw;
+        struct cdrom_msf   msf;
+        int                blocksize, lba, rc;
+
+        if (cmd == CDROMREADMODE1)
+                blocksize = CD_FRAMESIZE;       /* 2048 */
+        else if (cmd == CDROMREADMODE2)
+                blocksize = CD_FRAMESIZE_RAW0;  /* 2336 */
+        else
+               /* some SCSI drives do not allow this one */
+                blocksize = CD_FRAMESIZE_RAW;   /* 2352 */
+
+       if (copy_from_user(&msf,(void*)arg,sizeof(msf)))
+               return -EFAULT;
+       if (!(raw = scsi_malloc(2048+512)))
+               return -ENOMEM;
+
+       lba = (((msf.cdmsf_min0 * CD_SECS) + msf.cdmsf_sec0)
+                       * CD_FRAMES + msf.cdmsf_frame0) - CD_BLOCK_OFFSET;
+       rc = sr_read_sector(target, lba, blocksize, raw);
+       if (!rc)
+               if (copy_to_user((void*)arg, raw, blocksize))
+                       rc = -EFAULT;
+
+       scsi_free(raw,2048+512);
+       return rc;
+    }
+
        /* block-copy from ../block/sbpcd.c with some adjustments... */
     case CDROMMULTISESSION: /* tell start-of-last-session to user */
     {
index f5ceb137174f5f8222df309d7a61e5b190d8fdc6..be986ff05aee9ba0148109716389bc1019630a93 100644 (file)
@@ -24,6 +24,8 @@
  *     1.09  11/30/96  KG      Added register the allocated IO space   *
  *     1.10  12/05/96  CLH     Modified tmscsim_proc_info(), and reset *
  *                             pending interrupt in DC390_detect()     *
+ *     1.11  02/05/97  KG/CLH  Fixeds problem with partitions greater  *
+ *                             than 1GB                                *
  ***********************************************************************/
 
 
@@ -689,11 +691,11 @@ int DC390_bios_param(Disk *disk, kdev_t devno, int geom[])
     sectors = 32;
     cylinders = disk->capacity / (heads * sectors);
 
-    if ( cylinders > 1024)
+    if ( (pACB->Gmode2 & GREATER_1G) && (cylinders > 1024) )
     {
       heads = 255;
       sectors = 63;
-      cylinders = disk->capacity / (255 * 63);
+      cylinders = disk->capacity / (heads * sectors);
     }
 
     geom[0] = heads;
@@ -1182,7 +1184,7 @@ int DC390_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, USHORT index )
 #ifdef VERSION_ELF_1_2_13
        if( request_irq(Irq, DC390_Interrupt, SA_INTERRUPT, "tmscsim"))
 #else
-       if( request_irq(Irq, DC390_Interrupt, SA_INTERRUPT, "tmscsim", NULL))
+       if( request_irq(Irq, DC390_Interrupt, SA_INTERRUPT | SA_SHIRQ, "tmscsim", NULL))
 #endif
        {
            printk("DC390: register IRQ error!\n");
@@ -1793,7 +1795,7 @@ int tmscsim_proc_info(char *buffer, char **start,
   if (acbpnt == (PACB)-1) return(-ESRCH);
   if(!shpnt) return(-ESRCH);
 
-  if(inout) // Has data been written to the file ?
+  if(inout) /* Has data been written to the file ? */
     return(tmscsim_set_info(buffer, length, shpnt));
 
   SPRINTF("Tekram DC390(T) PCI SCSI Host Adadpter, ");
diff --git a/drivers/sound/.defines b/drivers/sound/.defines
new file mode 100644 (file)
index 0000000..b42573c
--- /dev/null
@@ -0,0 +1,118 @@
+# Computer generated file. Please don't edit
+
+ifdef CONFIG_PSS
+CONFIG_MPU_EMU=y
+endif
+
+ifdef CONFIG_SSCAPE
+CONFIG_MPU_EMU=y
+endif
+
+ifdef CONFIG_CS4232
+CONFIG_MPU_EMU=y
+endif
+
+ifdef CONFIG_MAUI
+CONFIG_MPU_EMU=y
+endif
+
+ifdef CONFIG_PSS
+CONFIG_AD1848=y
+endif
+
+ifdef CONFIG_GUS16
+CONFIG_AD1848=y
+endif
+
+ifdef CONFIG_GUSMAX
+CONFIG_AD1848=y
+endif
+
+ifdef CONFIG_MSS
+CONFIG_AD1848=y
+endif
+
+ifdef CONFIG_SSCAPE
+CONFIG_AD1848=y
+endif
+
+ifdef CONFIG_TRIX
+CONFIG_AD1848=y
+endif
+
+ifdef CONFIG_MAD16
+CONFIG_AD1848=y
+endif
+
+ifdef CONFIG_CS4232
+CONFIG_AD1848=y
+endif
+
+ifdef CONFIG_SB
+CONFIG_SBDSP=y
+endif
+
+ifdef CONFIG_TRIX
+CONFIG_SBDSP=y
+endif
+
+ifdef CONFIG_MAD16
+CONFIG_SBDSP=y
+endif
+
+ifdef CONFIG_SB
+CONFIG_UART401=y
+endif
+
+ifdef CONFIG_TRIX
+CONFIG_UART401=y
+endif
+
+ifdef CONFIG_MAD16
+CONFIG_UART401=y
+endif
+
+ifdef CONFIG_PAS
+CONFIG_SEQUENCER=y
+endif
+
+ifdef CONFIG_SB
+CONFIG_SEQUENCER=y
+endif
+
+ifdef CONFIG_ADLIB
+CONFIG_SEQUENCER=y
+endif
+
+ifdef CONFIG_GUS
+CONFIG_SEQUENCER=y
+endif
+
+ifdef CONFIG_MPU401
+CONFIG_SEQUENCER=y
+endif
+
+ifdef CONFIG_PSS
+CONFIG_SEQUENCER=y
+endif
+
+ifdef CONFIG_SSCAPE
+CONFIG_SEQUENCER=y
+endif
+
+ifdef CONFIG_TRIX
+CONFIG_SEQUENCER=y
+endif
+
+ifdef CONFIG_MAD16
+CONFIG_SEQUENCER=y
+endif
+
+ifdef CONFIG_CS4232
+CONFIG_SEQUENCER=y
+endif
+
+ifdef CONFIG_MAUI
+CONFIG_SEQUENCER=y
+endif
+
index b1bc3607904bd99befe4226407f4ba54ee59935f..b160c29e591e38f9491037db7bf98aa84e30d9b2 100644 (file)
-#
-# Sound driver configuration
-#
-#--------
-# There is another config script which is compatible with rest of
-# the kernel. It can be activated by running 'make mkscript' in this
-# directory. Please note that this is an _experimental_ feature which
-# doesn't work with all cards (PSS, SM Wave, AudioTrix Pro, Maui).
-#--------
-#
-$MAKE -C drivers/sound config || exit 1
+bool 'ProAudioSpectrum 16 support' CONFIG_PAS
+bool 'Sound Blaster (SB, SBPro, SB16, clones) support' CONFIG_SB
+bool 'Generic OPL2/OPL3 FM synthesizer support' CONFIG_ADLIB
+bool 'Gravis Ultrasound support' CONFIG_GUS
+bool 'MPU-401 support (NOT for SB16)' CONFIG_MPU401
+bool '6850 UART Midi support' CONFIG_UART6850
+bool 'PSS (ECHO-ADI2111) support' CONFIG_PSS
+bool '16 bit sampling option of GUS (_NOT_ GUS MAX)' CONFIG_GUS16
+bool 'GUS MAX support' CONFIG_GUSMAX
+bool 'Microsoft Sound System support' CONFIG_MSS
+bool 'Ensoniq SoundScape support' CONFIG_SSCAPE
+bool 'MediaTrix AudioTrix Pro support' CONFIG_TRIX
+bool 'Support for MAD16 and/or Mozart based cards' CONFIG_MAD16
+bool 'Support for Crystal CS4232 based (PnP) cards' CONFIG_CS4232
+bool 'Support for Turtle Beach Wave Front (Maui, Tropez) synthesizers' CONFIG_MAUI
+bool '/dev/dsp and /dev/audio support' CONFIG_AUDIO
+bool 'MIDI interface support' CONFIG_MIDI
+bool 'FM synthesizer (YM3812/OPL-3) support' CONFIG_YM3812
+
+if [ "$CONFIG_SB" = "y" ]; then
+hex 'I/O base for SB Check from manual of the card' SBC_BASE 220
+fi
+
+if [ "$CONFIG_SB" = "y" ]; then
+int 'Sound Blaster IRQ Check from manual of the card' SBC_IRQ 7
+fi
+
+if [ "$CONFIG_SB" = "y" ]; then
+int 'Sound Blaster DMA 0, 1 or 3' SBC_DMA 1
+fi
+
+if [ "$CONFIG_SB" = "y" ]; then
+int 'Sound Blaster 16 bit DMA (_REQUIRED_for SB16, Jazz16, SMW) 5, 6 or 7 (use 1 for 8 bit cards)' SB_DMA2 5
+fi
+
+if [ "$CONFIG_SB" = "y" ]; then
+hex 'MPU401 I/O base of SB16, Jazz16 and ES1688 Check from manual of the card' SB_MPU_BASE 0
+fi
+
+if [ "$CONFIG_SB" = "y" ]; then
+int 'SB MPU401 IRQ (Jazz16, SM Wave and ES1688) Use -1 with SB16' SB_MPU_IRQ -1
+fi
+
+if [ "$CONFIG_PAS" = "y" ]; then
+int 'PAS16 IRQ 3, 4, 5, 7, 9, 10, 11, 12, 14 or 15' PAS_IRQ 10
+fi
+
+if [ "$CONFIG_PAS" = "y" ]; then
+int 'PAS16 DMA 0, 1, 3, 5, 6 or 7' PAS_DMA 3
+fi
+
+if [ "$CONFIG_GUS" = "y" ]; then
+hex 'I/O base for GUS 210, 220, 230, 240, 250 or 260' GUS_BASE 220
+fi
+
+if [ "$CONFIG_GUS" = "y" ]; then
+int 'GUS IRQ 3, 5, 7, 9, 11, 12 or 15' GUS_IRQ 15
+fi
+
+if [ "$CONFIG_GUS" = "y" ]; then
+int 'GUS DMA 1, 3, 5, 6 or 7' GUS_DMA 6
+fi
+
+if [ "$CONFIG_GUS" = "y" ]; then
+int 'Second DMA channel for GUS 1, 3, 5, 6 or 7' GUS_DMA2 -1
+fi
+
+if [ "$CONFIG_GUS16" = "y" ]; then
+hex 'I/O base for the 16 bit daughtercard of GUS 530, 604, E80 or F40' GUS16_BASE 530
+fi
+
+if [ "$CONFIG_GUS16" = "y" ]; then
+int 'GUS 16 bit daughtercard IRQ 3, 4, 5, 7, or 9' GUS16_IRQ 7
+fi
+
+if [ "$CONFIG_GUS16" = "y" ]; then
+int 'GUS DMA 0, 1 or 3' GUS16_DMA 3
+fi
+
+if [ "$CONFIG_MPU401" = "y" ]; then
+hex 'I/O base for MPU401 Check from manual of the card' MPU_BASE 330
+fi
+
+if [ "$CONFIG_MPU401" = "y" ]; then
+int 'MPU401 IRQ Check from manual of the card' MPU_IRQ 9
+fi
+
+if [ "$CONFIG_MAUI" = "y" ]; then
+hex 'I/O base for Maui 210, 230, 260, 290, 300, 320, 338 or 330' MAUI_BASE 330
+fi
+
+if [ "$CONFIG_MAUI" = "y" ]; then
+int 'Maui IRQ 5, 9, 12 or 15' MAUI_IRQ 9
+fi
+
+if [ "$CONFIG_UART6850" = "y" ]; then
+hex 'I/O base for UART 6850 MIDI port (Unknown)' U6850_BASE 0
+fi
+
+if [ "$CONFIG_UART6850" = "y" ]; then
+int 'UART6850 IRQ (Unknown)' U6850_IRQ -1
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+hex 'PSS I/O base 220 or 240' PSS_BASE 220
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+hex 'PSS audio I/O base 530, 604, E80 or F40' PSS_MSS_BASE 530
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+int 'PSS audio IRQ 7, 9, 10 or 11' PSS_MSS_IRQ 11
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+int 'PSS audio DMA 0, 1 or 3' PSS_MSS_DMA 3
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+hex 'PSS MIDI I/O base ' PSS_MPU_BASE 330
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+int 'PSS MIDI IRQ 3, 4, 5, 7 or 9' PSS_MPU_IRQ 9
+fi
+
+if [ "$CONFIG_MSS" = "y" ]; then
+hex 'MSS/WSS I/O base 530, 604, E80 or F40' MSS_BASE 530
+fi
 
+if [ "$CONFIG_MSS" = "y" ]; then
+int 'MSS/WSS IRQ 7, 9, 10 or 11' MSS_IRQ 11
+fi
+
+if [ "$CONFIG_MSS" = "y" ]; then
+int 'MSS/WSS DMA 0, 1 or 3' MSS_DMA 3
+fi
+
+if [ "$CONFIG_SSCAPE" = "y" ]; then
+hex 'SoundScape MIDI I/O base 320, 330, 340 or 350' SSCAPE_BASE 330
+fi
+
+if [ "$CONFIG_SSCAPE" = "y" ]; then
+int 'SoundScape MIDI IRQ ' SSCAPE_IRQ 9
+fi
+
+if [ "$CONFIG_SSCAPE" = "y" ]; then
+int 'SoundScape initialization DMA 0, 1 or 3' SSCAPE_DMA 3
+fi
+
+if [ "$CONFIG_SSCAPE" = "y" ]; then
+hex 'SoundScape audio I/O base 534, 608, E84 or F44' SSCAPE_MSS_BASE 534
+fi
+
+if [ "$CONFIG_SSCAPE" = "y" ]; then
+int 'SoundScape audio IRQ 7, 9, 10 or 11' SSCAPE_MSS_IRQ 11
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+hex 'AudioTrix audio I/O base 530, 604, E80 or F40' TRIX_BASE 530
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix audio IRQ 7, 9, 10 or 11' TRIX_IRQ 11
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix audio DMA 0, 1 or 3' TRIX_DMA 0
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix second (duplex) DMA 0, 1 or 3' TRIX_DMA2 3
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+hex 'AudioTrix MIDI I/O base 330, 370, 3B0 or 3F0' TRIX_MPU_BASE 330
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix MIDI IRQ 3, 4, 5, 7 or 9' TRIX_MPU_IRQ 9
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+hex 'AudioTrix SB I/O base 220, 210, 230, 240, 250, 260 or 270' TRIX_SB_BASE 220
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix SB IRQ 3, 4, 5 or 7' TRIX_SB_IRQ 7
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix SB DMA 1 or 3' TRIX_SB_DMA 1
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+hex 'CS4232 audio I/O base 530, 604, E80 or F40' CS4232_BASE 530
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+int 'CS4232 audio IRQ 5, 7, 9, 11, 12 or 15' CS4232_IRQ 11
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+int 'CS4232 audio DMA 0, 1 or 3' CS4232_DMA 0
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+int 'CS4232 second (duplex) DMA 0, 1 or 3' CS4232_DMA2 3
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+hex 'CS4232 MIDI I/O base 330, 370, 3B0 or 3F0' CS4232_MPU_BASE 330
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+int 'CS4232 MIDI IRQ 5, 7, 9, 11, 12 or 15' CS4232_MPU_IRQ 9
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+hex 'MAD16 audio I/O base 530, 604, E80 or F40' MAD16_BASE 530
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+int 'MAD16 audio IRQ 7, 9, 10 or 11' MAD16_IRQ 11
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+int 'MAD16 audio DMA 0, 1 or 3' MAD16_DMA 3
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+int 'MAD16 second (duplex) DMA 0, 1 or 3' MAD16_DMA2 0
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+hex 'MAD16 MIDI I/O base 300, 310, 320 or 330 (0 disables)' MAD16_MPU_BASE 330
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+int 'MAD16 MIDI IRQ 5, 7, 9 or 10' MAD16_MPU_IRQ 9
+fi
+
+if [ "$CONFIG_AUDIO" = "y" ]; then
+int 'Audio DMA buffer size 4096, 16384, 32768 or 65536' DSP_BUFFSIZE 65536
+fi
+#
+$MAKE -C drivers/sound kernelconfig || exit 1
 bool 'Additional low level drivers' CONFIG_LOWLEVEL_SOUND
 
 if [ "$CONFIG_LOWLEVEL_SOUND" = "y" ]; then
diff --git a/drivers/sound/local.h b/drivers/sound/local.h
new file mode 100644 (file)
index 0000000..69b5396
--- /dev/null
@@ -0,0 +1,45 @@
+/* Computer generated file. Please don't edit! */
+
+#define KERNEL_COMPATIBLE_CONFIG
+
+#define SELECTED_SOUND_OPTIONS 0x00000000
+
+#if \
+  defined(CONFIG_PSS) || defined(CONFIG_SSCAPE) || \
+  defined(CONFIG_CS4232) || defined(CONFIG_MAUI)
+#      define CONFIG_MPU_EMU
+#endif
+
+#if \
+  defined(CONFIG_PSS) || defined(CONFIG_GUS16) || \
+  defined(CONFIG_GUSMAX) || defined(CONFIG_MSS) || \
+  defined(CONFIG_SSCAPE) || defined(CONFIG_TRIX) || \
+  defined(CONFIG_MAD16) || defined(CONFIG_CS4232)
+#      define CONFIG_AD1848
+#endif
+
+#if \
+  defined(CONFIG_SB) || defined(CONFIG_TRIX) || \
+  defined(CONFIG_MAD16)
+#      define CONFIG_SBDSP
+#endif
+
+#if \
+  defined(CONFIG_SB) || defined(CONFIG_TRIX) || \
+  defined(CONFIG_MAD16)
+#      define CONFIG_UART401
+#endif
+
+#if \
+  defined(CONFIG_PAS) || defined(CONFIG_SB) || \
+  defined(CONFIG_ADLIB) || defined(CONFIG_GUS) || \
+  defined(CONFIG_MPU401) || defined(CONFIG_PSS) || \
+  defined(CONFIG_SSCAPE) || defined(CONFIG_TRIX) || \
+  defined(CONFIG_MAD16) || defined(CONFIG_CS4232) || \
+  defined(CONFIG_MAUI)
+#      define CONFIG_SEQUENCER
+#endif
+
+#define SOUND_CONFIG_DATE "Sun Mar 8 23:17:14 GMT 1998"
+#define SOUND_CONFIG_BY "root"
+#define SOUND_UNAME_A "Linux roadrunner.swansea.linux.org.uk 2.1.88 #7 Thu Mar 5 01:09:39 GMT 1998 i586 unknown"
index effec81e36db36309577a75054158b16d73a35bb..abcffcd80e3eae167d0f50fe80482fbb111e7014 100644 (file)
@@ -58,6 +58,7 @@
  *
  */
 
+#include <linux/config.h> /* CONFIG_ACI_MIXER */
 #include "../sound_config.h"
 #ifdef CONFIG_ACI_MIXER
 
index 639bb77a997d0430a90628b2574767af79fb467b..92fb802d2fb60fe325ca69f9645169947c66537c 100644 (file)
@@ -10,11 +10,42 @@ tristate 'Extended fs support' CONFIG_EXT_FS
 tristate 'Second extended fs support' CONFIG_EXT2_FS
 tristate 'xiafs filesystem support' CONFIG_XIA_FS
 
-# msdos filesystems
-tristate 'DOS FAT fs support' CONFIG_FAT_FS
-dep_tristate 'MSDOS fs support' CONFIG_MSDOS_FS $CONFIG_FAT_FS
-dep_tristate 'VFAT (Windows-95) fs support' CONFIG_VFAT_FS $CONFIG_FAT_FS
-dep_tristate 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS
+tristate 'Native language support (Unicode, codepages)' CONFIG_NLS
+if [ "$CONFIG_NLS" = "y" -o "$CONFIG_NLS" = "m" ]; then
+  dep_tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS $CONFIG_NLS
+
+  # msdos filesystems
+  dep_tristate 'DOS FAT fs support' CONFIG_FAT_FS $CONFIG_NLS
+  dep_tristate 'MSDOS fs support' CONFIG_MSDOS_FS $CONFIG_FAT_FS
+  dep_tristate 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS
+  dep_tristate 'VFAT (Windows-95) fs support' CONFIG_VFAT_FS $CONFIG_FAT_FS
+  dep_tristate 'Codepage 437'      CONFIG_NLS_CODEPAGE_437 $CONFIG_NLS
+  dep_tristate 'Codepage 737'      CONFIG_NLS_CODEPAGE_737 $CONFIG_NLS
+  dep_tristate 'Codepage 775'      CONFIG_NLS_CODEPAGE_775 $CONFIG_NLS
+  dep_tristate 'Codepage 850'      CONFIG_NLS_CODEPAGE_850 $CONFIG_NLS
+  dep_tristate 'Codepage 852'      CONFIG_NLS_CODEPAGE_852 $CONFIG_NLS
+  dep_tristate 'Codepage 855'      CONFIG_NLS_CODEPAGE_855 $CONFIG_NLS
+  dep_tristate 'Codepage 857'      CONFIG_NLS_CODEPAGE_857 $CONFIG_NLS
+  dep_tristate 'Codepage 860'      CONFIG_NLS_CODEPAGE_860 $CONFIG_NLS
+  dep_tristate 'Codepage 861'      CONFIG_NLS_CODEPAGE_861 $CONFIG_NLS
+  dep_tristate 'Codepage 862'      CONFIG_NLS_CODEPAGE_862 $CONFIG_NLS
+  dep_tristate 'Codepage 863'      CONFIG_NLS_CODEPAGE_863 $CONFIG_NLS
+  dep_tristate 'Codepage 864'      CONFIG_NLS_CODEPAGE_864 $CONFIG_NLS
+  dep_tristate 'Codepage 865'      CONFIG_NLS_CODEPAGE_865 $CONFIG_NLS
+  dep_tristate 'Codepage 866'      CONFIG_NLS_CODEPAGE_866 $CONFIG_NLS
+  dep_tristate 'Codepage 869'      CONFIG_NLS_CODEPAGE_869 $CONFIG_NLS
+  dep_tristate 'Codepage 874'      CONFIG_NLS_CODEPAGE_874 $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-1'    CONFIG_NLS_ISO8859_1    $CONFIG_NLS 
+  dep_tristate 'NLS ISO 8859-2'    CONFIG_NLS_ISO8859_2    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-3'    CONFIG_NLS_ISO8859_3    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-4'    CONFIG_NLS_ISO8859_4    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-5'    CONFIG_NLS_ISO8859_5    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-6'    CONFIG_NLS_ISO8859_6    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-7'    CONFIG_NLS_ISO8859_7    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-8'    CONFIG_NLS_ISO8859_8    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-9'    CONFIG_NLS_ISO8859_9    $CONFIG_NLS
+  dep_tristate 'NLS KOI8-R'        CONFIG_NLS_KOI8_R       $CONFIG_NLS
+fi
 
 bool '/proc filesystem support' CONFIG_PROC_FS
 if [ "$CONFIG_INET" = "y" ]; then
@@ -34,7 +65,6 @@ fi
 if [ "$CONFIG_IPX" != "n" ]; then
   tristate 'NCP filesystem support (to mount NetWare volumes)' CONFIG_NCP_FS
 fi
-tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS
 tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS
 tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS
 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
index 3586e059da9feaf808ea8ab3c974fb006a385706..5ac1952a9daaf93ddb55ae003d024891542b7474 100644 (file)
@@ -13,7 +13,8 @@ O_TARGET := fs.o
 O_OBJS    = open.o read_write.o inode.o devices.o file_table.o buffer.o \
                super.o  block_dev.o stat.o exec.o pipe.o namei.o fcntl.o \
                ioctl.o readdir.o select.o fifo.o locks.o filesystems.o \
-               dcache.o bad_inode.o $(BINFMTS) 
+               dcache.o bad_inode.o $(BINFMTS)
+OX_OBJS   = $(NLS)
 
 MOD_LIST_NAME := FS_MODULES
 ALL_SUB_DIRS = minix ext ext2 fat msdos vfat proc isofs nfs xiafs umsdos \
@@ -192,4 +193,292 @@ endif
 # binfmt_script is always there
 BINFMTS += binfmt_script.o
 
+ifeq ($(CONFIG_NLS),y)
+NLS += nls.o
+else
+  ifeq ($(CONFIG_NLS),m)
+  MX_OBJS += nls.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_437),y)
+NLS += nls_cp437.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_437),m)
+  M_OBJS += nls_cp437.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_737),y)
+NLS += nls_cp737.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_737),m)
+  M_OBJS += nls_cp737.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_775),y)
+NLS += nls_cp775.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_775),m)
+  M_OBJS += nls_cp775.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_850),y)
+NLS += nls_cp850.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_850),m)
+  M_OBJS += nls_cp850.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_852),y)
+NLS += nls_cp852.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_852),m)
+  M_OBJS += nls_cp852.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_855),y)
+NLS += nls_cp855.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_855),m)
+  M_OBJS += nls_cp855.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_857),y)
+NLS += nls_cp857.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_857),m)
+  M_OBJS += nls_cp857.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_860),y)
+NLS += nls_cp860.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_860),m)
+  M_OBJS += nls_cp860.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_861),y)
+NLS += nls_cp861.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_861),m)
+  M_OBJS += nls_cp861.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_862),y)
+NLS += nls_cp862.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_862),m)
+  M_OBJS += nls_cp862.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_863),y)
+NLS += nls_cp863.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_863),m)
+  M_OBJS += nls_cp863.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_864),y)
+NLS += nls_cp864.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_864),m)
+  M_OBJS += nls_cp864.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_865),y)
+NLS += nls_cp865.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_865),m)
+  M_OBJS += nls_cp865.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_866),y)
+NLS += nls_cp866.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_866),m)
+  M_OBJS += nls_cp866.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_869),y)
+NLS += nls_cp869.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_869),m)
+  M_OBJS += nls_cp869.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_874),y)
+NLS += nls_cp874.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_874),m)
+  M_OBJS += nls_cp874.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1250),y)
+NLS += nls_cp1250.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1250),m)
+  M_OBJS += nls_cp1250.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1251),y)
+NLS += nls_cp1251.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1251),m)
+  M_OBJS += nls_cp1251.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1252),y)
+NLS += nls_cp1252.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1252),m)
+  M_OBJS += nls_cp1252.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1253),y)
+NLS += nls_cp1253.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1253),m)
+  M_OBJS += nls_cp1253.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1254),y)
+NLS += nls_cp1254.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1254),m)
+  M_OBJS += nls_cp1254.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1255),y)
+NLS += nls_cp1255.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1255),m)
+  M_OBJS += nls_cp1255.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1256),y)
+NLS += nls_cp1256.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1256),m)
+  M_OBJS += nls_cp1256.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1257),y)
+NLS += nls_cp1257.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1257),m)
+  M_OBJS += nls_cp1257.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1258),y)
+NLS += nls_cp1258.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1258),m)
+  M_OBJS += nls_cp1258.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_1),y)
+NLS += nls_iso8859_1.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_1),m)
+  M_OBJS += nls_iso8859_1.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_2),y)
+NLS += nls_iso8859_2.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_2),m)
+  M_OBJS += nls_iso8859_2.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_3),y)
+NLS += nls_iso8859_3.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_3),m)
+  M_OBJS += nls_iso8859_3.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_4),y)
+NLS += nls_iso8859_4.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_4),m)
+  M_OBJS += nls_iso8859_4.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_5),y)
+NLS += nls_iso8859_5.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_5),m)
+  M_OBJS += nls_iso8859_5.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_6),y)
+NLS += nls_iso8859_6.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_6),m)
+  M_OBJS += nls_iso8859_6.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_7),y)
+NLS += nls_iso8859_7.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_7),m)
+  M_OBJS += nls_iso8859_7.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_8),y)
+NLS += nls_iso8859_8.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_8),m)
+  M_OBJS += nls_iso8859_8.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_9),y)
+NLS += nls_iso8859_9.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_9),m)
+  M_OBJS += nls_iso8859_9.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_KOI8_R),y)
+NLS += nls_koi8_r.o
+else
+  ifeq ($(CONFIG_NLS_KOI8_R),m)
+  M_OBJS += nls_koi8_r.o
+  endif
+endif
+
 include $(TOPDIR)/Rules.make
index 44b4663bbcafd749c109aa043d855f4a680feb41..a1b70b7564b7401b79c32394008b39dd2c1c7510 100644 (file)
@@ -578,7 +578,7 @@ static int empty_dir (struct inode * inode)
        offset = de->rec_len + de1->rec_len;
        de = (struct ext2_dir_entry *) ((char *) de1 + de1->rec_len);
        while (offset < inode->i_size ) {
-               if ((void *) de >= (void *) (bh->b_data + sb->s_blocksize)) {
+               if (!bh || (void *) de >= (void *) (bh->b_data + sb->s_blocksize)) {
                        brelse (bh);
                        bh = ext2_bread (inode, offset >> EXT2_BLOCK_SIZE_BITS(sb), 1, &err);
                        if (!bh) {
index eebbf29b5a19f2bccc4b021ec500aa678ff5fae4..bd1ca4286152c71839c24ce141bac2b922f07cb3 100644 (file)
 #include <linux/fs.h>
 #include <linux/msdos_fs.h>
 
+#if 0
+#  define PRINTK(x) printk x
+#else
+#  define PRINTK(x)
+#endif
+
 struct buffer_head *fat_bread (
        struct super_block *sb,
        int block)
 {
        struct buffer_head *ret = NULL;
 
+       PRINTK(("fat_bread: block=0x%x\n", block));
        /* Note that the blocksize is 512 or 1024, but the first read
           is always of size 1024. Doing readahead may be counterproductive
           or just plain wrong. */
@@ -73,6 +80,7 @@ struct buffer_head *fat_getblk (
        int block)
 {
        struct buffer_head *ret = NULL;
+       PRINTK(("fat_getblk: block=0x%x\n", block));
        if (sb->s_blocksize == 512){
                ret = getblk (sb->s_dev,block,512);
        }else{
index af79ce25e499dea907410db1732f0c982e2a9ca2..9b43e41d1b696d3f01531ebb7bb71b1991a724e0 100644 (file)
 
 #include "msbuffer.h"
 
+#if 0
+#  define PRINTK(x) printk x
+#else
+#  define PRINTK(x)
+#endif
 
 static struct fat_cache *fat_cache,cache[FAT_CACHE];
 
@@ -22,11 +27,13 @@ int fat_access(struct super_block *sb,int nr,int new_value)
 {
        struct buffer_head *bh,*bh2,*c_bh,*c_bh2;
        unsigned char *p_first,*p_last;
-       int first,last,next,copy,b;
+       int copy,first,last,next,b;
 
        if ((unsigned) (nr-2) >= MSDOS_SB(sb)->clusters)
                return 0;
-       if (MSDOS_SB(sb)->fat_bits == 16) {
+       if (MSDOS_SB(sb)->fat_bits == 32) {
+               first = last = nr*4;
+       } else if (MSDOS_SB(sb)->fat_bits == 16) {
                first = last = nr*2;
        } else {
                first = nr*3/2;
@@ -46,13 +53,19 @@ int fat_access(struct super_block *sb,int nr,int new_value)
                        return 0;
                }
        }
-       if (MSDOS_SB(sb)->fat_bits == 16) {
+       if (MSDOS_SB(sb)->fat_bits == 32) {
+               p_first = p_last = NULL; /* GCC needs that stuff */
+               next = CF_LE_L(((unsigned long *) bh->b_data)[(first &
+                   (SECTOR_SIZE-1)) >> 2]);
+               if (next >= 0xffffff7) next = -1;
+               PRINTK(("fat_bread: 0x%x, nr=0x%x, first=0x%x, next=0x%d\n", b, nr, first, next));
+
+       } else if (MSDOS_SB(sb)->fat_bits == 16) {
                p_first = p_last = NULL; /* GCC needs that stuff */
                next = CF_LE_W(((unsigned short *) bh->b_data)[(first &
                    (SECTOR_SIZE-1)) >> 1]);
                if (next >= 0xfff7) next = -1;
-       }
-       else {
+       } else {
                p_first = &((unsigned char *) bh->b_data)[first & (SECTOR_SIZE-1)];
                p_last = &((unsigned char *) bh2->b_data)[(first+1) &
                    (SECTOR_SIZE-1)];
@@ -61,10 +74,13 @@ int fat_access(struct super_block *sb,int nr,int new_value)
                if (next >= 0xff7) next = -1;
        }
        if (new_value != -1) {
-               if (MSDOS_SB(sb)->fat_bits == 16)
+               if (MSDOS_SB(sb)->fat_bits == 32) {
+                       ((unsigned long *) bh->b_data)[(first & (SECTOR_SIZE-1)) >>
+                           2] = CT_LE_L(new_value);
+               } else if (MSDOS_SB(sb)->fat_bits == 16) {
                        ((unsigned short *) bh->b_data)[(first & (SECTOR_SIZE-1)) >>
                            1] = CT_LE_W(new_value);
-               else {
+               else {
                        if (nr & 1) {
                                *p_first = (*p_first & 0xf) | (new_value << 4);
                                *p_last = new_value >> 4;
@@ -239,16 +255,17 @@ int get_cluster(struct inode *inode,int cluster)
        return nr;
 }
 
-
 int fat_smap(struct inode *inode,int sector)
 {
        struct msdos_sb_info *sb;
        int cluster,offset;
 
        sb = MSDOS_SB(inode->i_sb);
-       if (inode->i_ino == MSDOS_ROOT_INO || (S_ISDIR(inode->i_mode) &&
-           !MSDOS_I(inode)->i_start)) {
-               if (sector >= sb->dir_entries >> MSDOS_DPS_BITS) return 0;
+       if ((sb->fat_bits != 32) &&
+           (inode->i_ino == MSDOS_ROOT_INO || (S_ISDIR(inode->i_mode) &&
+            !MSDOS_I(inode)->i_start))) {
+               if (sector >= sb->dir_entries >> MSDOS_DPS_BITS)
+                       return 0;
                return sector+sb->dir_start;
        }
        cluster = sector/sb->cluster_size;
@@ -264,6 +281,7 @@ int fat_smap(struct inode *inode,int sector)
 int fat_free(struct inode *inode,int skip)
 {
        int nr,last;
+       int fat_bits;
 
        if (!(nr = MSDOS_I(inode)->i_start)) return 0;
        last = 0;
@@ -275,11 +293,13 @@ int fat_free(struct inode *inode,int skip)
                        return -EIO;
                }
        }
-       if (last)
-               fat_access(inode->i_sb,last,MSDOS_SB(inode->i_sb)->fat_bits ==
-                   12 ? 0xff8 : 0xfff8);
-       else {
+       if (last) {
+               fat_bits = MSDOS_SB(inode->i_sb)->fat_bits;
+               fat_access(inode->i_sb,last,fat_bits == 12 ? EOF_FAT12 :
+                          fat_bits == 16 ? EOF_FAT16 : EOF_FAT32);
+       } else {
                MSDOS_I(inode)->i_start = 0;
+               MSDOS_I(inode)->i_logstart = 0;
                inode->i_dirt = 1;
        }
        lock_fat(inode->i_sb);
@@ -288,8 +308,12 @@ int fat_free(struct inode *inode,int skip)
                        fat_fs_panic(inode->i_sb,"fat_free: deleting beyond EOF");
                        break;
                }
-               if (MSDOS_SB(inode->i_sb)->free_clusters != -1)
+               if (MSDOS_SB(inode->i_sb)->free_clusters != -1) {
                        MSDOS_SB(inode->i_sb)->free_clusters++;
+                       if (MSDOS_SB(inode->i_sb)->fat_bits == 32) {
+                               fat_clusters_flush(inode->i_sb);
+                       }
+               }
                inode->i_blocks -= MSDOS_SB(inode->i_sb)->cluster_size;
        }
        unlock_fat(inode->i_sb);
index db537c6660a398f1a6ae2710ab6235b02760a6c0..ea135700cd2fd842f40e5624e160877aed29780b 100644 (file)
  *  Merged with msdos fs by Henrik Storner <storner@osiris.ping.dk>
  */
 
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+
+#include <linux/version.h>
 #include <linux/fs.h>
 #include <linux/msdos_fs.h>
+#include <linux/nls.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/stat.h>
 #include <linux/dirent.h>
 #include <linux/mm.h>
 
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+#include <asm/uaccess.h>
+#define FAT_GET_USER(len, addr) get_user(len, addr)
+#define FAT_COPY_TO_USER(uaddr, kaddr, len) copy_to_user(uaddr, kaddr, len)
+#else
 #include <asm/segment.h>
+#define FAT_GET_USER(len, addr) (len) = get_user(addr)
+#define FAT_COPY_TO_USER(uaddr, kaddr, len) memcpy_tofs(uaddr, kaddr, len)
+#endif
 
 #include "msbuffer.h"
-#include "tables.h"
 
 
 #define PRINTK(X)
 
+
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+static long fat_dir_read(struct inode * inode,struct file * filp,
+                        char * buf,unsigned long count)
+#else
 static int fat_dir_read(struct inode * inode,struct file * filp, char * buf,int count)
+#endif
 {
        return -EISDIR;
 }
@@ -39,7 +56,7 @@ struct file_operations fat_dir_operations = {
        fat_dir_read,           /* read */
        NULL,                   /* write - bad */
        fat_readdir,            /* readdir */
-       NULL,                   /* select - default */
+       NULL,                   /* select v2.0.x/poll v2.1.x - default */
        fat_dir_ioctl,          /* ioctl - default */
        NULL,                   /* mmap */
        NULL,                   /* no special open code */
@@ -47,7 +64,9 @@ struct file_operations fat_dir_operations = {
        file_fsync              /* fsync */
 };
 
-/* Convert Unicode string to ASCII.  If uni_xlate is enabled and we
+/*
+ * Convert Unicode 16 to UTF8, translated unicode, or ascii.
+ * If uni_xlate is enabled and we
  * can't get a 1:1 conversion, use a colon as an escape character since
  * it is normally invalid on the vfat filesystem.  The following three
  * characters are a sort of uuencoded 16 bit Unicode value.  This lets
@@ -55,10 +74,11 @@ struct file_operations fat_dir_operations = {
  * into some trouble with long Unicode names, but ignore that right now.
  */
 static int
-uni2ascii(unsigned char *uni, unsigned char *ascii, int uni_xlate)
+uni16_to_x8(unsigned char *ascii, unsigned char *uni, int uni_xlate,
+           struct nls_table *nls)
 {
        unsigned char *ip, *op;
-       unsigned char page, pg_off;
+       unsigned char ch, cl;
        unsigned char *uni_page;
        unsigned short val;
 
@@ -66,21 +86,21 @@ uni2ascii(unsigned char *uni, unsigned char *ascii, int uni_xlate)
        op = ascii;
 
        while (*ip || ip[1]) {
-               pg_off = *ip++;
-               page = *ip++;
-               
-               uni_page = fat_uni2asc_pg[page];
-               if (uni_page && uni_page[pg_off]) {
-                       *op++ = uni_page[pg_off];
+               cl = *ip++;
+               ch = *ip++;
+
+               uni_page = nls->page_uni2charset[ch];
+               if (uni_page && uni_page[cl]) {
+                       *op++ = uni_page[cl];
                } else {
                        if (uni_xlate == 1) {
                                *op++ = ':';
-                               val = (pg_off << 8) + page;
-                               op[2] = fat_uni2code[val & 0x3f];
+                               val = (cl << 8) + ch;
+                               op[2] = fat_uni2esc[val & 0x3f];
                                val >>= 6;
-                               op[1] = fat_uni2code[val & 0x3f];
+                               op[1] = fat_uni2esc[val & 0x3f];
                                val >>= 6;
-                               *op = fat_uni2code[val & 0x3f];
+                               *op = fat_uni2esc[val & 0x3f];
                                op += 3;
                        } else {
                                *op++ = '?';
@@ -91,6 +111,19 @@ uni2ascii(unsigned char *uni, unsigned char *ascii, int uni_xlate)
        return (op - ascii);
 }
 
+
+static void dump_de(struct msdos_dir_entry *de)
+{
+       int i;
+       unsigned char *p = (unsigned char *) de;
+       printk("[");
+
+       for (i = 0; i < 32; i++, p++) {
+               printk("%02x ", *p);
+       }
+       printk("]\n");
+}
+
 int fat_readdirx(
        struct inode *inode,
        struct file *filp,
@@ -114,7 +147,9 @@ int fat_readdirx(
        unsigned char alias_checksum = 0; /* Make compiler warning go away */
        unsigned char long_slots = 0;
        int uni_xlate = MSDOS_SB(sb)->options.unicode_xlate;
+       int utf8 = MSDOS_SB(sb)->options.utf8;
        unsigned char *unicode = NULL;
+       struct nls_table *nls = MSDOS_SB(sb)->nls_io;
 
        if (!inode || !S_ISDIR(inode->i_mode))
                return -EBADF;
@@ -137,6 +172,9 @@ int fat_readdirx(
        is_long = 0;
        ino = fat_get_entry(inode,&filp->f_pos,&bh,&de);
        while (ino > -1) {
+#if 0
+               dump_de(de);
+#endif
                /* Check for long filename entry */
                if (MSDOS_SB(sb)->options.isvfat && (de->name[0] == (__s8) DELETED_FLAG)) {
                        is_long = 0;
@@ -213,10 +251,10 @@ int fat_readdirx(
                        char bufname[14];
                        char *ptname = bufname;
                        int dotoffset = 0;
+                       int was_long = is_long;
 
                        if (is_long) {
                                unsigned char sum;
-                               long_len = uni2ascii(unicode, longname, uni_xlate);
                                for (sum = 0, i = 0; i < 11; i++) {
                                        sum = (((sum&1)<<7)|((sum&0xfe)>>1)) + de->name[i];
                                }
@@ -225,6 +263,11 @@ int fat_readdirx(
                                        PRINTK(("Checksums don't match %d != %d\n", sum, alias_checksum));
                                        is_long = 0;
                                }
+                               if (utf8) {
+                                       long_len = utf8_wcstombs(longname, (__u16 *) unicode, sizeof(longname));
+                               } else {
+                                       long_len = uni16_to_x8(longname, unicode, uni_xlate, nls);
+                               }
                        }
 
                        if ((de->attr & ATTR_HIDDEN) && MSDOS_SB(sb)->options.dotsOK) {
@@ -264,7 +307,7 @@ int fat_readdirx(
                                                bufname[i+dotoffset] = '\0';
                                        }
                                        spos = oldpos;
-                                       if (is_long) {
+                                       if (was_long) {
                                                spos = filp->f_pos - sizeof(struct msdos_dir_entry);
                                        } else {
                                                long_slots = 0;
@@ -343,7 +386,8 @@ static int vfat_ioctl_fill(
        int len, slen;
        int dotdir;
 
-       if (get_user(&d1->d_reclen) != 0) {
+       FAT_GET_USER(len, &d1->d_reclen);
+       if (len != 0) {
                return -1;
        }
 
@@ -356,19 +400,19 @@ static int vfat_ioctl_fill(
                len = strlen(name);
        }
        if (len != name_len) {
-               memcpy_tofs(d2->d_name, name, len);
+               FAT_COPY_TO_USER(d2->d_name, name, len);
                put_user(0, d2->d_name + len);
                put_user(len, &d2->d_reclen);
                put_user(ino, &d2->d_ino);
                put_user(offset, &d2->d_off);
                slen = name_len - len;
-               memcpy_tofs(d1->d_name, name+len+1, slen);
+               FAT_COPY_TO_USER(d1->d_name, name+len+1, slen);
                put_user(0, d1->d_name+slen);
                put_user(slen, &d1->d_reclen);
        } else {
                put_user(0, d2->d_name);
                put_user(0, &d2->d_reclen);
-               memcpy_tofs(d1->d_name, name, len);
+               FAT_COPY_TO_USER(d1->d_name, name, len);
                put_user(0, d1->d_name+len);
                put_user(len, &d1->d_reclen);
        }
@@ -391,7 +435,7 @@ int fat_dir_ioctl(struct inode * inode, struct file * filp,
        switch (cmd) {
        case VFAT_IOCTL_READDIR_BOTH: {
                struct dirent *d1 = (struct dirent *)arg;
-               err = verify_area(VERIFY_WRITE, d1, sizeof (*d1));
+               err = verify_area(VERIFY_WRITE, d1, sizeof(struct dirent[2]));
                if (err)
                        return err;
                put_user(0, &d1->d_reclen);
@@ -401,7 +445,7 @@ int fat_dir_ioctl(struct inode * inode, struct file * filp,
        case VFAT_IOCTL_READDIR_SHORT: {
                struct dirent *d1 = (struct dirent *)arg;
                put_user(0, &d1->d_reclen);
-               err = verify_area(VERIFY_WRITE, d1, sizeof (*d1));
+               err = verify_area(VERIFY_WRITE, d1, sizeof(struct dirent[2]));
                if (err)
                        return err;
                return fat_readdirx(inode,filp,(void *)arg,
index 6318549ccb1c5aa042bdff58a3e4bce2d8855a79..e74ff7cd278fcd01d3f84a9bc207de7d51809b22 100644 (file)
@@ -4,55 +4,65 @@
  * Exported kernel symbols for the low-level FAT-based fs support.
  *
  */
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
+#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/mm.h>
 #include <linux/msdos_fs.h>
 
 #include "msbuffer.h"
-#include "tables.h"
 
 extern struct file_operations fat_dir_operations;
 
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+#define X(sym) EXPORT_SYMBOL(sym);
+#define X_PUNCT ;
+#else
+#define X_PUNCT ,
 static struct symbol_table fat_syms = {
 #include <linux/symtab_begin.h>
-       X(fat_a2alias),
-       X(fat_a2uni),
-       X(fat_add_cluster),
-       X(fat_bmap),
-       X(fat_brelse),
-       X(fat_cache_inval_inode),
-       X(fat_code2uni),
-       X(fat_date_unix2dos),
-       X(fat_dir_operations),
-       X(fat_file_read),
-       X(fat_file_write),
-       X(fat_fs_panic),
-       X(fat_get_entry),
-       X(fat_lock_creation),
-       X(fat_mark_buffer_dirty),
-       X(fat_mmap),
-       X(fat_notify_change),
-       X(fat_parent_ino),
-       X(fat_put_inode),
-       X(fat_put_super),
-       X(fat_read_inode),
-       X(fat_read_super),
-       X(fat_readdirx),
-       X(fat_readdir),
-       X(fat_scan),
-       X(fat_smap),
-       X(fat_statfs),
-       X(fat_truncate),
-       X(fat_uni2asc_pg),
-       X(fat_uni2code),
-       X(fat_unlock_creation),
-       X(fat_write_inode),
+#endif
+X(fat_add_cluster) X_PUNCT
+X(fat_bmap) X_PUNCT
+X(fat_brelse) X_PUNCT
+X(fat_cache_inval_inode) X_PUNCT
+X(fat_esc2uni) X_PUNCT
+X(fat_date_unix2dos) X_PUNCT
+X(fat_dir_operations) X_PUNCT
+X(fat_file_read) X_PUNCT
+X(fat_file_write) X_PUNCT
+X(fat_fs_panic) X_PUNCT
+X(fat_get_entry) X_PUNCT
+X(fat_lock_creation) X_PUNCT
+X(fat_mark_buffer_dirty) X_PUNCT
+X(fat_mmap) X_PUNCT
+X(fat_notify_change) X_PUNCT
+X(fat_parent_ino) X_PUNCT
+X(fat_put_inode) X_PUNCT
+X(fat_put_super) X_PUNCT
+X(fat_read_inode) X_PUNCT
+X(fat_read_super) X_PUNCT
+X(fat_readdirx) X_PUNCT
+X(fat_readdir) X_PUNCT
+X(fat_scan) X_PUNCT
+X(fat_smap) X_PUNCT
+X(fat_statfs) X_PUNCT
+X(fat_truncate) X_PUNCT
+X(fat_uni2esc) X_PUNCT
+X(fat_unlock_creation) X_PUNCT
+X(fat_write_inode) X_PUNCT
+#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,0)
 #include <linux/symtab_end.h>
 };                                           
+#endif
 
 int init_fat_fs(void)
 {
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+       return 0;
+#else
        return register_symtab(&fat_syms);
+#endif
 }
-
index f2b2ec2308d9fbb52151fd87b4a54ad53c72b2ab..37dab80bff5d68f8bb0f3077a3009949e5f07467 100644 (file)
@@ -6,6 +6,8 @@
  *  regular file handling primitives for fat-based filesystems
  */
 
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
 #include <linux/sched.h>
 #include <linux/locks.h>
 #include <linux/fs.h>
 #include <linux/string.h>
 #include <linux/pagemap.h>
 
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+#include <asm/uaccess.h>
+#define FAT_COPY_TO_USER(uaddr, kaddr, len) copy_to_user(uaddr, kaddr, len)
+#define FAT_COPY_FROM_USER(uaddr, kaddr, len) copy_from_user(uaddr, kaddr, len)
+#define FAT_GET_USER(c, ptr) get_user((c), ptr)
+#else
 #include <asm/segment.h>
+#define FAT_COPY_TO_USER(uaddr, kaddr, len) memcpy_tofs(uaddr, kaddr, len)
+#define FAT_COPY_FROM_USER(uaddr, kaddr, len) memcpy_fromfs(uaddr, kaddr, len)
+#define FAT_GET_USER(c, ptr) (c) = get_user(ptr)
+#endif
 #include <asm/system.h>
 
 #include "msbuffer.h"
@@ -32,7 +44,7 @@ static struct file_operations fat_file_operations = {
        fat_file_read,          /* read */
        fat_file_write,         /* write */
        NULL,                   /* readdir - bad */
-       NULL,                   /* select - default */
+       NULL,                   /* select v2.0.x/poll v2.1.x - default */
        NULL,                   /* ioctl - default */
        generic_file_mmap,      /* mmap */
        NULL,                   /* no special open is needed */
@@ -71,7 +83,7 @@ static struct file_operations fat_file_operations_1024 = {
        fat_file_read,          /* read */
        fat_file_write,         /* write */
        NULL,                   /* readdir - bad */
-       NULL,                   /* select - default */
+       NULL,                   /* select v2.0.x/poll v2.1.x - default */
        NULL,                   /* ioctl - default */
        fat_mmap,               /* mmap */
        NULL,                   /* no special open is needed */
@@ -152,11 +164,12 @@ static void fat_prefetch (
 /*
        Read a file into user space
 */
-int fat_file_read(
-       struct inode *inode,
-       struct file *filp,
-       char *buf,
-       int count)
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+long fat_file_read(struct inode *inode,struct file *filp,char *buf,
+                  unsigned long count)
+#else
+int fat_file_read(struct inode *inode,struct file *filp,char *buf,int count)
+#endif
 {
        struct super_block *sb = inode->i_sb;
        char *start = buf;
@@ -175,7 +188,11 @@ int fat_file_read(
                printk("fat_file_read: mode = %07o\n",inode->i_mode);
                return -EINVAL;
        }
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+       if (filp->f_pos >= inode->i_size || count == 0) return 0;
+#else
        if (filp->f_pos >= inode->i_size || count <= 0) return 0;
+#endif
        /*
                Tell the buffer cache which block we expect to read in advance
                Since we are limited with the stack, we preread only MSDOS_PREFETCH
@@ -238,7 +255,7 @@ int fat_file_read(
                size = MIN(SECTOR_SIZE-offset,left_in_file);
                if (MSDOS_I(inode)->i_binary) {
                        size = MIN(size,end-buf);
-                       memcpy_tofs(buf,data,size);
+                       FAT_COPY_TO_USER(buf,data,size);
                        buf += size;
                        filp->f_pos += size;
                }else{
@@ -269,11 +286,12 @@ int fat_file_read(
 /*
        Write to a file either from user space
 */
-int fat_file_write(
-       struct inode *inode,
-       struct file *filp,
-       const char *buf,
-       int count)
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+long fat_file_write(struct inode *inode,struct file *filp,const char *buf,
+                   unsigned long count)
+#else
+int fat_file_write(struct inode *inode,struct file *filp,const char *buf,int count)
+#endif
 {
        struct super_block *sb = inode->i_sb;
        int sector,offset,size,left,written;
@@ -301,8 +319,11 @@ int fat_file_write(
  */
        if (filp->f_flags & O_APPEND)
                filp->f_pos = inode->i_size;
-       if (count <= 0)
-               return 0;
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+       if (count == 0) return 0;
+#else
+       if (count <= 0) return 0;
+#endif
        error = carry = 0;
        for (start = buf; count || carry; count -= size) {
                while (!(sector = fat_smap(inode,filp->f_pos >> SECTOR_BITS)))
@@ -329,7 +350,7 @@ int fat_file_write(
                        break;
                }
                if (binary_mode) {
-                       memcpy_fromfs(bh->b_data+offset,buf,written = size);
+                       FAT_COPY_FROM_USER(bh->b_data+offset,buf,written = size);
                        buf += size;
                } else {
                        written = left = SECTOR_SIZE-offset;
@@ -340,7 +361,8 @@ int fat_file_write(
                                carry = 0;
                        }
                        for (size = 0; size < count && left; size++) {
-                               if ((ch = get_user(buf++)) == '\n') {
+                               FAT_GET_USER(ch, buf++);
+                               if (ch == '\n') {
                                        *to++ = '\r';
                                        left--;
                                }
index 1e68debd8f44b19bcc6506bea172b0848c4d9546..39f5d2bf39b6c5780b98fb704557c63d51d37b03 100644 (file)
@@ -5,10 +5,13 @@
  *  VFAT extensions by Gordon Chaffee, merged with msdos fs by Henrik Storner
  */
 
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
 #define __NO_VERSION__
 #include <linux/module.h>
 
 #include <linux/msdos_fs.h>
+#include <linux/nls.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/stat.h>
 #include <linux/locks.h>
+#include <linux/malloc.h>
 
 #include "msbuffer.h"
-#include "tables.h"
 
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+#include <asm/uaccess.h>
+#define FAT_COPY_TO_USER(uaddr, kaddr, len) copy_to_user(uaddr, kaddr, len)
+#else
 #include <asm/segment.h>
+#define FAT_COPY_TO_USER(uaddr, kaddr, len) memcpy_tofs(uaddr, kaddr, len)
+#endif
 #include <asm/unaligned.h>
 
-
+#if 0
+#  define PRINTK(x) printk x
+#else
+#  define PRINTK(x)
+#endif
 
 void fat_put_inode(struct inode *inode)
 {
@@ -75,8 +88,22 @@ done:
 
 void fat_put_super(struct super_block *sb)
 {
+       if (MSDOS_SB(sb)->fat_bits == 32) {
+               fat_clusters_flush(sb);
+       }
        fat_cache_inval_dev(sb->s_dev);
        set_blocksize (sb->s_dev,BLOCK_SIZE);
+       if (MSDOS_SB(sb)->nls_disk) {
+               unload_nls(MSDOS_SB(sb)->nls_disk);
+               MSDOS_SB(sb)->nls_disk = NULL;
+               MSDOS_SB(sb)->options.codepage = 0;
+       }
+       if (MSDOS_SB(sb)->nls_io) {
+               unload_nls(MSDOS_SB(sb)->nls_io);
+               MSDOS_SB(sb)->nls_io = NULL;
+               kfree(MSDOS_SB(sb)->options.iocharset);
+               MSDOS_SB(sb)->options.iocharset = NULL;
+       }
        lock_super(sb);
        sb->s_dev = 0;
        unlock_super(sb);
@@ -88,27 +115,38 @@ void fat_put_super(struct super_block *sb)
 static int parse_options(char *options,int *fat, int *blksize, int *debug,
                         struct fat_mount_options *opts)
 {
-       char *this_char,*value;
+       char *this_char,*value,save,*savep;
+       char *p;
+       int ret, len;
 
        opts->name_check = 'n';
        opts->conversion = 'b';
        opts->fs_uid = current->uid;
        opts->fs_gid = current->gid;
        opts->fs_umask = current->fs->umask;
-       opts->quiet = opts->sys_immutable = opts->dotsOK = opts->showexec = opts->isvfat = 0;
+       opts->quiet = opts->sys_immutable = opts->dotsOK = opts->showexec = 0;
+       opts->codepage = 0;
+       opts->utf8 = 0;
+       opts->iocharset = NULL;
        *debug = *fat = 0;
 
        if (!options) return 1;
+       save = 0;
+       savep = NULL;
+       ret = 1;
        for (this_char = strtok(options,","); this_char; this_char = strtok(NULL,",")) {
-               if ((value = strchr(this_char,'=')) != NULL)
+               if ((value = strchr(this_char,'=')) != NULL) {
+                       save = *value;
+                       savep = value;
                        *value++ = 0;
+               }
                if (!strcmp(this_char,"check") && value) {
                        if (value[0] && !value[1] && strchr("rns",*value))
                                opts->name_check = *value;
                        else if (!strcmp(value,"relaxed")) opts->name_check = 'r';
                        else if (!strcmp(value,"normal")) opts->name_check = 'n';
                        else if (!strcmp(value,"strict")) opts->name_check = 's';
-                       else return 0;
+                       else ret = 0;
                }
                else if (!strcmp(this_char,"conv") && value) {
                        if (value[0] && !value[1] && strchr("bta",*value))
@@ -116,7 +154,7 @@ static int parse_options(char *options,int *fat, int *blksize, int *debug,
                        else if (!strcmp(value,"binary")) opts->conversion = 'b';
                        else if (!strcmp(value,"text")) opts->conversion = 't';
                        else if (!strcmp(value,"auto")) opts->conversion = 'a';
-                       else return 0;
+                       else ret = 0;
                }
                else if (!strcmp(this_char,"dots")) {
                        opts->dotsOK = 1;
@@ -130,72 +168,99 @@ static int parse_options(char *options,int *fat, int *blksize, int *debug,
                else if (!strcmp(this_char,"dotsOK") && value) {
                        if (!strcmp(value,"yes")) opts->dotsOK = 1;
                        else if (!strcmp(value,"no")) opts->dotsOK = 0;
-                       else return 0;
+                       else ret = 0;
                }
                else if (!strcmp(this_char,"uid")) {
-                       if (!value || !*value)
-                               return 0;
-                       opts->fs_uid = simple_strtoul(value,&value,0);
-                       if (*value)
-                               return 0;
+                       if (!value || !*value) ret = 0;
+                       else {
+                               opts->fs_uid = simple_strtoul(value,&value,0);
+                               if (*value) ret = 0;
+                       }
                }
                else if (!strcmp(this_char,"gid")) {
-                       if (!value || !*value)
-                               return 0;
-                       opts->fs_gid = simple_strtoul(value,&value,0);
-                       if (*value)
-                               return 0;
+                       if (!value || !*value) ret= 0;
+                       else {
+                               opts->fs_gid = simple_strtoul(value,&value,0);
+                               if (*value) ret = 0;
+                       }
                }
                else if (!strcmp(this_char,"umask")) {
-                       if (!value || !*value)
-                               return 0;
-                       opts->fs_umask = simple_strtoul(value,&value,8);
-                       if (*value)
-                               return 0;
+                       if (!value || !*value) ret = 0;
+                       else {
+                               opts->fs_umask = simple_strtoul(value,&value,8);
+                               if (*value) ret = 0;
+                       }
                }
                else if (!strcmp(this_char,"debug")) {
-                       if (value) return 0;
-                       *debug = 1;
+                       if (value) ret = 0;
+                       else *debug = 1;
                }
                else if (!strcmp(this_char,"fat")) {
-                       if (!value || !*value)
-                               return 0;
-                       *fat = simple_strtoul(value,&value,0);
-                       if (*value || (*fat != 12 && *fat != 16))
-                               return 0;
+                       if (!value || !*value) ret = 0;
+                       else {
+                               *fat = simple_strtoul(value,&value,0);
+                               if (*value || (*fat != 12 && *fat != 16 &&
+                                              *fat != 32)) 
+                                       ret = 0;
+                       }
                }
                else if (!strcmp(this_char,"quiet")) {
-                       if (value) return 0;
-                       opts->quiet = 1;
+                       if (value) ret = 0;
+                       else opts->quiet = 1;
                }
                else if (!strcmp(this_char,"blocksize")) {
                        *blksize = simple_strtoul(value,&value,0);
-                       if (*value)
-                               return 0;
-                       if (*blksize != 512 && *blksize != 1024){
+                       if (*value) ret = 0;
+                       else if (*blksize != 512 && *blksize != 1024){
                                printk ("MSDOS FS: Invalid blocksize (512 or 1024)\n");
                        }
                }
                else if (!strcmp(this_char,"sys_immutable")) {
-                       if (value)
-                               return 0;
-                       opts->sys_immutable = 1;
+                       if (value) ret = 0;
+                       else opts->sys_immutable = 1;
+               }
+               else if (!strcmp(this_char,"codepage")) {
+                       opts->codepage = simple_strtoul(value,&value,0);
+                       if (*value) ret = 0;
+                       else printk ("MSDOS FS: Using codepage %d\n", opts->codepage);
                }
+               else if (!strcmp(this_char,"iocharset")) {
+                       p = value;
+                       while (*value && *value != ',') value++;
+                       len = value - p;
+                       if (len) {
+                               opts->iocharset = kmalloc(len+1, GFP_KERNEL);
+                               memcpy(opts->iocharset, p, len);
+                               opts->iocharset[len] = 0;
+                               printk ("MSDOS FS: Using IO charset %s\n",
+                                       opts->iocharset);
+                       } else {
+                               opts->iocharset = NULL;
+                               ret = 0;
+                       }
+               }
+
+               if (this_char != options) *(this_char-1) = ',';
+               if (value) *savep = save;
+               if (ret == 0) return 0;
        }
        return 1;
 }
 
 
 /* Read the super block of an MS-DOS FS. */
-
+/* XXX: Make sure we handle the case of no codepage (unable to load) */
 struct super_block *fat_read_super(struct super_block *sb,void *data, int silent)
 {
        struct buffer_head *bh;
-       struct msdos_boot_sector *b;
+       struct fat_boot_sector *b;
        int data_sectors,logical_sector_size,sector_mult,fat_clusters=0;
-       int debug,error,fat;
+       int debug,error,fat,cp;
        int blksize = 512;
+       int fat32;
        struct fat_mount_options opts;
+       char buf[50];
+       char *p;
 
        MOD_INC_USE_COUNT;
        if (hardsect_size[MAJOR(sb->s_dev)] != NULL){
@@ -204,6 +269,7 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
                        printk ("MSDOS: Hardware sector size is %d\n",blksize);
                }
        }
+       opts.isvfat = MSDOS_SB(sb)->options.isvfat;
        if (!parse_options((char *) data, &fat, &blksize, &debug, &opts)
                || (blksize != 512 && blksize != 1024)) {
                sb->s_dev = 0;
@@ -224,8 +290,8 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
                MOD_DEC_USE_COUNT;
                return NULL;
        }
-       b = (struct msdos_boot_sector *) bh->b_data;
        set_blocksize(sb->s_dev, blksize);
+
 /*
  * The DOS3 partition size limit is *not* 32M as many people think.  
  * Instead, it is 64K sectors (with the usual sector size being
@@ -244,15 +310,37 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
 #define ROUND_TO_MULTIPLE(n,m) ((n) && (m) ? (n)+(m)-1-((n)-1)%(m) : 0)
     /* don't divide by zero */
 
+       b = (struct fat_boot_sector *) bh->b_data;
        logical_sector_size =
                CF_LE_W(get_unaligned((unsigned short *) &b->sector_size));
        sector_mult = logical_sector_size >> SECTOR_BITS;
        MSDOS_SB(sb)->cluster_size = b->cluster_size*sector_mult;
        MSDOS_SB(sb)->fats = b->fats;
        MSDOS_SB(sb)->fat_start = CF_LE_W(b->reserved)*sector_mult;
-       MSDOS_SB(sb)->fat_length = CF_LE_W(b->fat_length)*sector_mult;
-       MSDOS_SB(sb)->dir_start = (CF_LE_W(b->reserved)+b->fats*CF_LE_W(
-           b->fat_length))*sector_mult;
+       if (!b->fat_length && b->fat32_length) {
+               struct fat_boot_fsinfo *fsinfo;
+
+               /* Must be FAT32 */
+               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;
+               fsinfo = (struct fat_boot_fsinfo *)
+                       &bh->b_data[MSDOS_SB(sb)->fsinfo_offset];
+               if (CF_LE_L(fsinfo->signature) != 0x61417272) {
+                       printk("fat_read_super: Did not find valid FSINFO signature. Found 0x%x\n", CF_LE_L(fsinfo->signature));
+               } else {
+                       MSDOS_SB(sb)->free_clusters = CF_LE_L(fsinfo->free_clusters);
+               }
+       } else {
+               fat32 = 0;
+               MSDOS_SB(sb)->fat_length = CF_LE_W(b->fat_length)*sector_mult;
+               MSDOS_SB(sb)->root_cluster = 0;
+               MSDOS_SB(sb)->free_clusters = -1; /* Don't know yet */
+       }
+       MSDOS_SB(sb)->dir_start= CF_LE_W(b->reserved)*sector_mult+
+           b->fats*MSDOS_SB(sb)->fat_length;
        MSDOS_SB(sb)->dir_entries =
                CF_LE_W(get_unaligned((unsigned short *) &b->dir_entries));
        MSDOS_SB(sb)->data_start = MSDOS_SB(sb)->dir_start+ROUND_TO_MULTIPLE((
@@ -267,8 +355,9 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
        if (!error) {
                MSDOS_SB(sb)->clusters = b->cluster_size ? data_sectors/
                    b->cluster_size/sector_mult : 0;
-               MSDOS_SB(sb)->fat_bits = fat ? fat : MSDOS_SB(sb)->clusters >
-                   MSDOS_FAT12 ? 16 : 12;
+               MSDOS_SB(sb)->fat_bits = fat32 ? 32 :
+                       (fat ? fat :
+                        (MSDOS_SB(sb)->clusters > MSDOS_FAT12 ? 16 : 12));
                fat_clusters = MSDOS_SB(sb)->fat_length*SECTOR_SIZE*8/
                    MSDOS_SB(sb)->fat_bits;
                error = !MSDOS_SB(sb)->fats || (MSDOS_SB(sb)->dir_entries &
@@ -294,12 +383,13 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
                       opts.conversion,opts.fs_uid,opts.fs_gid,opts.fs_umask,
                       MSDOS_CAN_BMAP(MSDOS_SB(sb)) ? ",bmap" : "");
                printk("[me=0x%x,cs=%d,#f=%d,fs=%d,fl=%d,ds=%d,de=%d,data=%d,"
-                      "se=%d,ts=%ld,ls=%d]\n",b->media,MSDOS_SB(sb)->cluster_size,
+                      "se=%d,ts=%ld,ls=%d,rc=%ld,fc=%u]\n",b->media,MSDOS_SB(sb)->cluster_size,
                       MSDOS_SB(sb)->fats,MSDOS_SB(sb)->fat_start,MSDOS_SB(sb)->fat_length,
                       MSDOS_SB(sb)->dir_start,MSDOS_SB(sb)->dir_entries,
                       MSDOS_SB(sb)->data_start,
                       CF_LE_W(*(unsigned short *) &b->sectors),
-                      (unsigned long)b->total_sect,logical_sector_size);
+                      (unsigned long)b->total_sect,logical_sector_size,
+                      MSDOS_SB(sb)->root_cluster,MSDOS_SB(sb)->free_clusters);
                printk ("Transaction block size = %d\n",blksize);
        }
        if (MSDOS_SB(sb)->clusters+2 > fat_clusters)
@@ -314,17 +404,54 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
        }
        sb->s_magic = MSDOS_SUPER_MAGIC;
        /* set up enough so that it can read an inode */
-       MSDOS_SB(sb)->free_clusters = -1; /* don't know yet */
        MSDOS_SB(sb)->fat_wait = NULL;
        MSDOS_SB(sb)->fat_lock = 0;
        MSDOS_SB(sb)->prev_free = 0;
        memcpy(&(MSDOS_SB(sb)->options), &opts, sizeof(struct fat_mount_options));
+
+       cp = opts.codepage ? opts.codepage : 437;
+       sprintf(buf, "cp%d", cp);
+       MSDOS_SB(sb)->nls_disk = load_nls(buf);
+       if (! MSDOS_SB(sb)->nls_disk) {
+               /* Fail only if explicit charset specified */
+               if (opts.codepage == 0) {
+                       MSDOS_SB(sb)->options.codepage = 0;
+                       MSDOS_SB(sb)->nls_disk = load_nls_default();
+               } else {
+                       sb->s_dev = 0;
+                       MOD_DEC_USE_COUNT;
+                       return NULL;
+               }
+       }
+
+       p = opts.iocharset ? opts.iocharset : "iso8859-1";
+       MSDOS_SB(sb)->nls_io = NULL;
+       if (MSDOS_SB(sb)->options.isvfat && !opts.utf8) {
+               MSDOS_SB(sb)->nls_io = load_nls(p);
+               if (! MSDOS_SB(sb)->nls_io) {
+                       /* Fail only if explicit charset specified */
+                       if (opts.iocharset) {
+                               kfree(opts.iocharset);
+                               unload_nls(MSDOS_SB(sb)->nls_disk);
+                               sb->s_dev = 0;
+                               MOD_DEC_USE_COUNT;
+                               return NULL;
+                       } else {
+                               MSDOS_SB(sb)->nls_io = load_nls_default();
+                       }
+               }
+       }
+
        if (!(sb->s_mounted = iget(sb,MSDOS_ROOT_INO))) {
                sb->s_dev = 0;
                printk("get root inode failed\n");
+               unload_nls(MSDOS_SB(sb)->nls_disk);
+               if (MSDOS_SB(sb)->nls_io) unload_nls(MSDOS_SB(sb)->nls_io);
+               if (opts.iocharset) kfree(opts.iocharset);
                MOD_DEC_USE_COUNT;
                return NULL;
        }
+
        return sb;
 }
 
@@ -352,7 +479,7 @@ void fat_statfs(struct super_block *sb,struct statfs *buf, int bufsiz)
        tmp.f_files = 0;
        tmp.f_ffree = 0;
        tmp.f_namelen = 12;
-       memcpy_tofs(buf, &tmp, bufsiz);
+       FAT_COPY_TO_USER(buf, &tmp, bufsiz);
 }
 
 
@@ -362,7 +489,7 @@ int fat_bmap(struct inode *inode,int block)
        int cluster,offset;
 
        sb = MSDOS_SB(inode->i_sb);
-       if (inode->i_ino == MSDOS_ROOT_INO) {
+       if ((inode->i_ino == MSDOS_ROOT_INO) && (sb->fat_bits != 32)) {
                return sb->dir_start + block;
        }
        cluster = block/sb->cluster_size;
@@ -388,6 +515,8 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
        struct msdos_dir_entry *raw_entry;
        int nr;
 
+       PRINTK(("fat_read_inode: inode=%p, sb->dir_start=0x%x\n",
+               inode, MSDOS_SB(sb)->dir_start));
        MSDOS_I(inode)->i_busy = 0;
        MSDOS_I(inode)->i_depend = MSDOS_I(inode)->i_old = NULL;
        MSDOS_I(inode)->i_linked = MSDOS_I(inode)->i_oldlink = NULL;
@@ -399,17 +528,33 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
                inode->i_mode = (S_IRWXUGO & ~MSDOS_SB(sb)->options.fs_umask) |
                    S_IFDIR;
                inode->i_op = fs_dir_inode_ops;
-               inode->i_nlink = fat_subdirs(inode)+2;
-                   /* subdirs (neither . nor ..) plus . and "self" */
-               inode->i_size = MSDOS_SB(sb)->dir_entries*
-                   sizeof(struct msdos_dir_entry);
+               if (MSDOS_SB(sb)->fat_bits == 32) {
+                       MSDOS_I(inode)->i_start = MSDOS_SB(sb)->root_cluster;
+                       if ((nr = MSDOS_I(inode)->i_start) != 0) {
+                               while (nr != -1) {
+                                       inode->i_size += SECTOR_SIZE*MSDOS_SB(sb)->cluster_size;
+                                       if (!(nr = fat_access(sb,nr,-1))) {
+                                               printk("Directory %ld: bad FAT\n",
+                                                      inode->i_ino);
+                                               break;
+                                       }
+                               }
+                       }
+               } else {
+                       MSDOS_I(inode)->i_start = 0;
+                       inode->i_size = MSDOS_SB(sb)->dir_entries*
+                               sizeof(struct msdos_dir_entry);
+               }
                inode->i_blksize = MSDOS_SB(sb)->cluster_size*
                    SECTOR_SIZE;
                inode->i_blocks = (inode->i_size+inode->i_blksize-1)/
                    inode->i_blksize*MSDOS_SB(sb)->cluster_size;
-               MSDOS_I(inode)->i_start = 0;
+               MSDOS_I(inode)->i_logstart = 0;
+
                MSDOS_I(inode)->i_attrs = 0;
                inode->i_mtime = inode->i_atime = inode->i_ctime = 0;
+               inode->i_nlink = fat_subdirs(inode)+2;
+                   /* subdirs (neither . nor ..) plus . and "self" */
                return;
        }
        if (!(bh = fat_bread(sb, inode->i_ino >> MSDOS_DPB_BITS))) {
@@ -425,6 +570,11 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
                inode->i_op = fs_dir_inode_ops;
 
                MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start);
+               if (MSDOS_SB(sb)->fat_bits == 32) {
+                       MSDOS_I(inode)->i_start |=
+                               (CF_LE_W(raw_entry->starthi) << 16);
+               }
+               MSDOS_I(inode)->i_logstart = MSDOS_I(inode)->i_start;
                inode->i_nlink = fat_subdirs(inode);
                    /* includes .., compensating for "self" */
 #ifdef DEBUG
@@ -434,7 +584,7 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
                }
 #endif
                inode->i_size = 0;
-               if ((nr = CF_LE_W(raw_entry->start)) != 0)
+               if ((nr = MSDOS_I(inode)->i_start) != 0)
                        while (nr != -1) {
                                inode->i_size += SECTOR_SIZE*MSDOS_SB(inode->
                                    i_sb)->cluster_size;
@@ -455,6 +605,11 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
                        ? &fat_file_inode_operations_1024
                        : &fat_file_inode_operations;
                MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start);
+               if (MSDOS_SB(sb)->fat_bits == 32) {
+                       MSDOS_I(inode)->i_start |=
+                               (CF_LE_W(raw_entry->starthi) << 16);
+               }
+               MSDOS_I(inode)->i_logstart = MSDOS_I(inode)->i_start;
                inode->i_nlink = 1;
                inode->i_size = CF_LE_L(raw_entry->size);
        }
@@ -526,7 +681,8 @@ void fat_write_inode(struct inode *inode)
        }
        raw_entry->attr |= MSDOS_MKATTR(inode->i_mode) |
            MSDOS_I(inode)->i_attrs;
-       raw_entry->start = CT_LE_W(MSDOS_I(inode)->i_start);
+       raw_entry->start = CT_LE_W(MSDOS_I(inode)->i_logstart);
+       raw_entry->starthi = CT_LE_W(MSDOS_I(inode)->i_logstart >> 16);
        fat_date_unix2dos(inode->i_mtime,&raw_entry->time,&raw_entry->date);
        raw_entry->time = CT_LE_W(raw_entry->time);
        raw_entry->date = CT_LE_W(raw_entry->date);
index 1b772fdea80454de10d1d4716aab6fa1cecac141..64790c59296a003c8dd5323e8f44bc6d3b9b4cf0 100644 (file)
 
 #include "msbuffer.h"
 
-#define PRINTK(x)
+#if 0
+#  define PRINTK(x)    printk x
+#else
+#  define PRINTK(x)
+#endif
 #define Printk(x)      printk x
 
 /* Well-known binary file extensions - of course there are many more */
@@ -23,7 +27,7 @@ static char bin_extensions[] =
   "EXE" "COM" "BIN" "APP" "SYS" "DRV" "OVL" "OVR" "OBJ" "LIB" "DLL" "PIF" /* program code */
   "ARC" "ZIP" "LHA" "LZH" "ZOO" "TAR" "Z  " "ARJ"      /* common archivers */
   "TZ " "TAZ" "TZP" "TPZ"              /* abbreviations of tar.Z and tar.zip */
-  "GZ " "TGZ" "DEB"                    /* .gz, .tar.gz and Debian packages   */
+  "GZ " "TGZ" "DEB" "RPM"              /* .gz, .tar.gz and Debian packages   */
   "GIF" "BMP" "TIF" "GL " "JPG" "PCX"  /* graphics */
   "TFM" "VF " "GF " "PK " "PXL" "DVI"; /* TeX */
 
@@ -77,7 +81,7 @@ int is_binary(char conversion,char *extension)
 /* (rename might deadlock before detecting cross-FS moves.) */
 
 static struct wait_queue *creation_wait = NULL;
-static creation_lock = 0;
+static int creation_lock = 0;
 
 
 void fat_lock_creation(void)
@@ -107,6 +111,34 @@ void unlock_fat(struct super_block *sb)
        wake_up(&MSDOS_SB(sb)->fat_wait);
 }
 
+/* Flushes the number of free clusters on FAT32 */
+/* XXX: Need to write one per FSINFO block.  Currently only writes 1 */
+void fat_clusters_flush(struct super_block *sb)
+{
+       int offset;
+       struct buffer_head *bh;
+       struct fat_boot_fsinfo *fsinfo;
+
+       /* The fat32 boot fs info is at offset 0x3e0 by observation */
+       offset = MSDOS_SB(sb)->fsinfo_offset;
+       bh = fat_bread(sb, (offset >> SECTOR_BITS));
+       if (bh == NULL) {
+               printk("FAT bread failed in fat_clusters_flush\n");
+               return;
+       }
+       fsinfo = (struct fat_boot_fsinfo *)
+               &bh->b_data[offset & (SECTOR_SIZE-1)];
+
+       /* Sanity check */
+       if (CF_LE_L(fsinfo->signature) != 0x61417272) {
+               printk("fat_clusters_flush: Did not find valid FSINFO signature. Found 0x%x.  offset=0x%x\n", CF_LE_L(fsinfo->signature), offset);
+               fat_brelse(sb, bh);
+               return;
+       }
+       fsinfo->free_clusters = CF_LE_L(MSDOS_SB(sb)->free_clusters);
+       fat_mark_buffer_dirty(sb, bh, 1);
+       fat_brelse(sb, bh);
+}
 
 /*
  * fat_add_cluster tries to allocate a new cluster and adds it to the file
@@ -120,7 +152,9 @@ int fat_add_cluster(struct inode *inode)
        struct buffer_head *bh;
        int cluster_size = MSDOS_SB(sb)->cluster_size;
 
-       if (inode->i_ino == MSDOS_ROOT_INO) return -ENOSPC;
+       if (MSDOS_SB(sb)->fat_bits != 32) {
+               if (inode->i_ino == MSDOS_ROOT_INO) return -ENOSPC;
+       }
        if (!MSDOS_SB(sb)->free_clusters) return -ENOSPC;
        lock_fat(sb);
        limit = MSDOS_SB(sb)->clusters;
@@ -139,10 +173,14 @@ printk("free cluster: %d\n",nr);
                unlock_fat(sb);
                return -ENOSPC;
        }
-       fat_access(sb,nr,MSDOS_SB(sb)->fat_bits == 12 ?
-           0xff8 : 0xfff8);
-       if (MSDOS_SB(sb)->free_clusters != -1)
+       fat_access(sb,nr,MSDOS_SB(sb)->fat_bits == 12 ? EOF_FAT12 :
+                  MSDOS_SB(sb)->fat_bits == 16 ? EOF_FAT16 : EOF_FAT32);
+       if (MSDOS_SB(sb)->free_clusters != -1) {
                MSDOS_SB(sb)->free_clusters--;
+       }
+       if (MSDOS_SB(sb)->fat_bits == 32) {
+               fat_clusters_flush(sb);
+       }
        unlock_fat(sb);
 #ifdef DEBUG
 printk("set to %x\n",fat_access(sb,nr,-1));
@@ -179,6 +217,7 @@ printk("last = %d\n",last);
        if (last) fat_access(sb,last,nr);
        else {
                MSDOS_I(inode)->i_start = nr;
+               MSDOS_I(inode)->i_logstart = nr;
                inode->i_dirt = 1;
        }
 #ifdef DEBUG
@@ -244,6 +283,9 @@ int date_dos2unix(unsigned short time,unsigned short date)
            month < 2 ? 1 : 0)+3653);
                        /* days since 1.1.70 plus 80's leap day */
        secs += sys_tz.tz_minuteswest*60;
+       if (sys_tz.tz_dsttime) {
+           secs -= 3600;
+       }
        return secs;
 }
 
@@ -256,6 +298,8 @@ void fat_date_unix2dos(int unix_date,unsigned short *time,
        int day,year,nl_day,month;
 
        unix_date -= sys_tz.tz_minuteswest*60;
+       if (sys_tz.tz_dsttime) unix_date += 3600;
+
        *time = (unix_date % 60)/2+(((unix_date/60) % 60) << 5)+
            (((unix_date/3600) % 24) << 11);
        day = unix_date/86400-3652;
@@ -298,7 +342,7 @@ int fat_get_entry(struct inode *dir, loff_t *pos,struct buffer_head **bh,
                        fat_brelse(sb, *bh);
                PRINTK (("get_entry sector apres brelse\n"));
                if (!(*bh = fat_bread(sb, sector))) {
-                       printk("Directory sread (sector %d) failed\n",sector);
+                       printk("Directory sread (sector 0x%x) failed\n",sector);
                        continue;
                }
                PRINTK (("get_entry apres sread\n"));
@@ -340,7 +384,13 @@ int fat_get_entry(struct inode *dir, loff_t *pos,struct buffer_head **bh,
      !(data[entry].attr & ATTR_VOLUME);
 
 #define RSS_START /* search for start cluster */ \
-    done = !IS_FREE(data[entry].name) && CF_LE_W(data[entry].start) == *number;
+    done = !IS_FREE(data[entry].name) \
+      && ( \
+           ( \
+             (MSDOS_SB(sb)->fat_bits != 32) ? 0 : (CF_LE_W(data[entry].starthi) << 16) \
+           ) \
+           | CF_LE_W(data[entry].start) \
+         ) == *number;
 
 #define RSS_FREE /* search for free entry */ \
     { \
@@ -393,6 +443,9 @@ static int raw_scan_sector(struct super_block *sb,int sector,const char *name,
                if (done) {
                        if (ino) *ino = sector*MSDOS_DPS+entry;
                        start = CF_LE_W(data[entry].start);
+                       if (MSDOS_SB(sb)->fat_bits == 32) {
+                               start |= (CF_LE_W(data[entry].starthi) << 16);
+                       }
                        if (!res_bh)
                                fat_brelse(sb, bh);
                        else {
@@ -488,6 +541,7 @@ int fat_parent_ino(struct inode *dir,int locked)
        static int zero = 0;
        int error,curr,prev,nr;
 
+       PRINTK(("fat_parent_ino: Debug 0\n"));
        if (!S_ISDIR(dir->i_mode)) panic("Non-directory fed to m_p_i");
        if (dir->i_ino == MSDOS_ROOT_INO) return dir->i_ino;
        if (!locked) fat_lock_creation(); /* prevent renames */
@@ -496,18 +550,27 @@ int fat_parent_ino(struct inode *dir,int locked)
                if (!locked) fat_unlock_creation();
                return curr;
        }
+       PRINTK(("fat_parent_ino: Debug 1 curr=%d\n", curr));
        if (!curr) nr = MSDOS_ROOT_INO;
        else {
+               PRINTK(("fat_parent_ino: Debug 2\n"));
                if ((prev = raw_scan(dir->i_sb,curr,MSDOS_DOTDOT,&zero,NULL,
                    NULL,NULL,SCAN_ANY)) < 0) {
+                       PRINTK(("fat_parent_ino: Debug 3 prev=%d\n", prev));
                        if (!locked) fat_unlock_creation();
                        return prev;
                }
+               PRINTK(("fat_parent_ino: Debug 4 prev=%d\n", prev));
+               if (prev == 0 && MSDOS_SB(dir->i_sb)->fat_bits == 32) {
+                       prev = MSDOS_SB(dir->i_sb)->root_cluster;
+               }
                if ((error = raw_scan(dir->i_sb,prev,NULL,&curr,&nr,NULL,
                    NULL,SCAN_ANY)) < 0) {
+                       PRINTK(("fat_parent_ino: Debug 5 error=%d\n", error));
                        if (!locked) fat_unlock_creation();
                        return error;
                }
+               PRINTK(("fat_parent_ino: Debug 6 nr=%d\n", nr));
        }
        if (!locked) fat_unlock_creation();
        return nr;
@@ -524,10 +587,12 @@ int fat_subdirs(struct inode *dir)
        int count;
 
        count = 0;
-       if (dir->i_ino == MSDOS_ROOT_INO)
+       if ((dir->i_ino == MSDOS_ROOT_INO) &&
+           (MSDOS_SB(dir->i_sb)->fat_bits != 32)) {
                (void) raw_scan_root(dir->i_sb,NULL,&count,NULL,NULL,NULL,SCAN_ANY);
-       else {
-               if (!MSDOS_I(dir)->i_start) return 0; /* in mkdir */
+       } else {
+               if ((dir->i_ino != MSDOS_ROOT_INO) &&
+                   !MSDOS_I(dir)->i_start) return 0; /* in mkdir */
                else (void) raw_scan_nonroot(dir->i_sb,MSDOS_I(dir)->i_start,
                    NULL,&count,NULL,NULL,NULL,SCAN_ANY);
        }
@@ -545,10 +610,7 @@ int fat_scan(struct inode *dir,const char *name,struct buffer_head **res_bh,
 {
        int res;
 
-       res = (name)
-               ? raw_scan(dir->i_sb,MSDOS_I(dir)->i_start,
-                   name, NULL, ino, res_bh, res_de, scantype)
-               : raw_scan(dir->i_sb,MSDOS_I(dir)->i_start,
-                   NULL, NULL, ino, res_bh, res_de, scantype);
+       res = raw_scan(dir->i_sb,MSDOS_I(dir)->i_start,
+                      name, NULL, ino, res_bh, res_de, scantype);
        return res<0 ? res : 0;
 }
index 779710c38a4b3f361797087c411b120ae709be77..cb31025dcc356e1e9d4a29436c8995f42123e766 100644 (file)
@@ -7,6 +7,9 @@
  *     mmap handling for fat-based filesystems
  */
 
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
+
 #include <linux/stat.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/malloc.h>
 #include <linux/msdos_fs.h>
 
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+#include <asm/uaccess.h>
+#else
 #include <asm/segment.h>
+#endif
 #include <asm/system.h>
 
 /*
index 3e8379374f260aa8329ff99e0b2f52c32cf39bf7..c4ad91c3cd61c86da11ac9135e6a0cf9e008713d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * linux/fs/fat/tables.c
  *
- * ASCII / Unicode translation tables for VFAT filename handling.
+ * Unicode escape translation tables for VFAT filename handling.
  * By Gordon Chaffee.
  *
  * Note: This file is used by all fat-based filesystems.
@@ -9,10 +9,9 @@
 
 #include <linux/kernel.h>
 #include <linux/string.h>
+#include <linux/msdos_fs.h>
 
-#include "tables.h"
-
-unsigned char fat_uni2code[64] = {
+unsigned char fat_uni2esc[64] = {
        '0', '1', '2', '3', '4', '5', '6', '7',
        '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
        'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
@@ -23,7 +22,7 @@ unsigned char fat_uni2code[64] = {
        'u', 'v', 'w', 'x', 'y', 'z', '+', '-'
 };
 
-unsigned char fat_code2uni[256] = {
+unsigned char fat_esc2uni[256] = {
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
@@ -58,209 +57,6 @@ unsigned char fat_code2uni[256] = {
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
 };
 
-static unsigned char page00[256] = {
-       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
-       0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 0x08-0x0F */
-       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
-       0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, /* 0x18-0x1F */
-       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
-       0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, /* 0x28-0x2F */
-       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
-       0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, /* 0x38-0x3F */
-       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
-       0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, /* 0x48-0x4F */
-       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
-       0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, /* 0x58-0x5F */
-       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
-       0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, /* 0x68-0x6F */
-       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
-       0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, /* 0x78-0x7F */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, /* 0x98-0x9F */
-       0xFF, 0xAD, 0xBD, 0x9C, 0xCF, 0xBE, 0xDD, 0xF5, /* 0xA0-0xA7 */
-       0xF9, 0xB8, 0x00, 0xAE, 0xAA, 0xF0, 0x00, 0xEE, /* 0xA8-0xAF */
-       0xF8, 0xF1, 0xFD, 0xFC, 0xEF, 0xE6, 0xF4, 0xFA, /* 0xB0-0xB7 */
-       0xF7, 0xFB, 0x00, 0xAF, 0xAC, 0xAB, 0xF3, 0x00, /* 0xB8-0xBF */
-       0xB7, 0xB5, 0xB6, 0xC7, 0x8E, 0x8F, 0x92, 0x80, /* 0xC0-0xC7 */
-       0xD4, 0x90, 0xD2, 0xD3, 0xDE, 0xD6, 0xD7, 0xD8, /* 0xC8-0xCF */
-       0x00, 0xA5, 0xE3, 0xE0, 0xE2, 0xE5, 0x99, 0x9E, /* 0xD0-0xD7 */
-       0x9D, 0xEB, 0xE9, 0xEA, 0x9A, 0xED, 0xE8, 0xE1, /* 0xD8-0xDF */
-       0xA1, 0xA0, 0x83, 0xC6, 0x84, 0x86, 0x91, 0x87, /* 0xE0-0xE7 */
-       0x8A, 0x82, 0x88, 0x89, 0x8D, 0x00, 0x8C, 0x8B, /* 0xE8-0xEF */
-       0xD0, 0xA4, 0x95, 0xA2, 0x93, 0xE4, 0x94, 0xF6, /* 0xF0-0xF7 */
-       0x9B, 0x97, 0xA3, 0x96, 0x81, 0xEC, 0xE7, 0x98  /* 0xF8-0xFF */
-};
-
-
-static unsigned char page25[256] = {
-       0xC4, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
-       0x00, 0x00, 0x00, 0x00, 0xDA, 0x00, 0x00, 0x00, /* 0x08-0x0F */
-       0xBF, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
-       0xD9, 0x00, 0x00, 0x00, 0xC3, 0x00, 0x00, 0x00, /* 0x18-0x1F */
-       0x00, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0xC2, 0x00, 0x00, 0x00, /* 0x28-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0xC1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0xC5, 0x00, 0x00, 0x00, /* 0x38-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4F */
-       0xCD, 0xBA, 0x00, 0x00, 0xC9, 0x00, 0x00, 0xBB, /* 0x50-0x57 */
-       0x00, 0x00, 0xC8, 0x00, 0x00, 0xBC, 0x00, 0x00, /* 0x58-0x5F */
-       0xCC, 0x00, 0x00, 0xB9, 0x00, 0x00, 0xCB, 0x00, /* 0x60-0x67 */
-       0x00, 0xCA, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* 0x68-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7F */
-
-       0xDF, 0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8F */
-       0x00, 0xB0, 0xB1, 0xB2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9F */
-       0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  /* 0xF8-0xFF */
-};
-
-
-unsigned char *fat_uni2asc_pg[256] = {
-       page00, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-       NULL,   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-       NULL,   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-       NULL,   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-       NULL,   NULL, NULL, NULL, page25
-};
-
-/* Conversion from ASCII name characters to the shortname character
- * should probably just just use XXX
- */
-unsigned char fat_a2alias[256] = 
-{
-       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
-       0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 0x08-0x0F */
-       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
-       0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, /* 0x18-0x1F */
-       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
-       0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, /* 0x28-0x2F */
-       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
-       0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, /* 0x38-0x3F */
-       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
-       0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, /* 0x48-0x4F */
-       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
-       0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, /* 0x58-0x5F */
-       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
-       0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, /* 0x68-0x6F */
-       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
-       0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, /* 0x78-0x7F */
-
-       0x80, 0x9A, 0x90, 0xB6, 0x8E, 0xB7, 0x8F, 0x80, /* 0x80-0x87 */
-       0xD2, 0xD3, 0xD4, 0xD8, 0xD7, 0xDE, 0x8E, 0x8F, /* 0x88-0x8F */
-       0x90, 0x92, 0x92, 0xE2, 0x99, 0xE3, 0xEA, 0xEB, /* 0x90-0x97 */
-/*_~1*/        0x98, 0x99, 0x9A, 0x9D, 0x9C, 0x9D, 0x9E, 0x9F, /* 0x98-0x9F */
-       0xB5, 0xD6, 0xE0, 0xE9, 0xA5, 0xA5, 0xA6, 0xA7, /* 0xA0-0xA7 */
-       0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, /* 0xA8-0xAF */
-       0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, /* 0xB0-0xB7 */
-       0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, /* 0xB8-0xBF */
-       0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 0xC0-0xC7 */
-       0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, /* 0xC8-0xCF */
-       0xD1, 0xD1, 0xD2, 0xD3, 0xD4, 0x49, 0xD6, 0xD7, /* 0xD0-0xD7 */
-       0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, /* 0xD8-0xDF */
-       0xE0, 0xE1, 0xE2, 0xE3, 0x05, 0x05, 0xE6, 0xE8, /* 0xE0-0xE7 */
-       0xE8, 0xE9, 0xEA, 0xEB, 0xED, 0xED, 0xEE, 0xEF, /* 0xE8-0xEF */
-       0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 0xF0-0xF7 */
-       0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF  /* 0xF8-0xFF */
-};
-
-struct unicode_value fat_a2uni[256] = {
-/* 0x00 */
-{0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
-{0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
-{0x08, 0x00}, {0x09, 0x00}, {0x0A, 0x00}, {0x0B, 0x00},
-{0x0C, 0x00}, {0x0D, 0x00}, {0x0E, 0x00}, {0x0F, 0x00},
-/* 0x10 */
-{0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
-{0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
-{0x18, 0x00}, {0x19, 0x00}, {0x1A, 0x00}, {0x1B, 0x00},
-{0x1C, 0x00}, {0x1D, 0x00}, {0x1E, 0x00}, {0x1F, 0x00},
-/* 0x20 */
-{0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
-{0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
-{0x28, 0x00}, {0x29, 0x00}, {0x2A, 0x00}, {0x2B, 0x00},
-{0x2C, 0x00}, {0x2D, 0x00}, {0x2E, 0x00}, {0x2F, 0x00},
-/* 0x30 */
-{0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
-{0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
-{0x38, 0x00}, {0x39, 0x00}, {0x3A, 0x00}, {0x3B, 0x00},
-{0x3C, 0x00}, {0x3D, 0x00}, {0x3E, 0x00}, {0x3F, 0x00},
-/* 0x40 */
-{0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
-{0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
-{0x48, 0x00}, {0x49, 0x00}, {0x4A, 0x00}, {0x4B, 0x00},
-{0x4C, 0x00}, {0x4D, 0x00}, {0x4E, 0x00}, {0x4F, 0x00},
-/* 0x50 */
-{0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
-{0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
-{0x58, 0x00}, {0x59, 0x00}, {0x5A, 0x00}, {0x5B, 0x00},
-{0x5C, 0x00}, {0x5D, 0x00}, {0x5E, 0x00}, {0x5F, 0x00},
-/* 0x60 */
-{0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
-{0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
-{0x68, 0x00}, {0x69, 0x00}, {0x6A, 0x00}, {0x6B, 0x00},
-{0x6C, 0x00}, {0x6D, 0x00}, {0x6E, 0x00}, {0x6F, 0x00},
-/* 0x70 */
-{0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
-{0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
-{0x78, 0x00}, {0x79, 0x00}, {0x7A, 0x00}, {0x7B, 0x00},
-{0x7C, 0x00}, {0x7D, 0x00}, {0x7E, 0x00}, {0x7F, 0x00},
-/* 0x80 */
-{0xC7, 0x00}, {0xFC, 0x00}, {0xE9, 0x00}, {0xE2, 0x00},
-{0xE4, 0x00}, {0xE0, 0x00}, {0xE5, 0x00}, {0xE7, 0x00},
-{0xEA, 0x00}, {0xEB, 0x00}, {0xE8, 0x00}, {0xEF, 0x00},
-{0xEE, 0x00}, {0xEC, 0x00}, {0xC4, 0x00}, {0xC5, 0x00},
-/* 0x90 */
-{0xC9, 0x00}, {0xE6, 0x00}, {0xC6, 0x00}, {0xF4, 0x00},
-{0xF6, 0x00}, {0xF2, 0x00}, {0xFB, 0x00}, {0xF9, 0x00},
-{0xFF, 0x00}, {0xD6, 0x00}, {0xDC, 0x00}, {0xF8, 0x00},
-{0xA3, 0x00}, {0xD8, 0x00}, {0xD7, 0x00}, {0x92, 0x00},
-/* 0xA0 */
-{0xE1, 0x00}, {0xE0, 0x00}, {0xF3, 0x00}, {0xFA, 0x00},
-{0xF1, 0x00}, {0xD1, 0x00}, {0xAA, 0x00}, {0xBA, 0x00},
-{0xBF, 0x00}, {0xAE, 0x00}, {0xAC, 0x00}, {0xBD, 0x00},
-{0xBC, 0x00}, {0xA1, 0x00}, {0xAB, 0x00}, {0xBB, 0x00},
-/* 0xB0 */
-{0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
-{0x24, 0x25}, {0xC1, 0x00}, {0xC2, 0x00}, {0xC0, 0x00},
-{0xA9, 0x00}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
-{0x5D, 0x25}, {0xA2, 0x00}, {0xA5, 0x00}, {0x10, 0x25},
-/* 0xC0 */
-{0x14, 0x25}, {0x34, 0x25}, {0x2C, 0x25}, {0x1C, 0x25},
-{0x00, 0x25}, {0x3C, 0x25}, {0xE3, 0x00}, {0xC3, 0x00},
-{0x5A, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
-{0x60, 0x25}, {0x50, 0x25}, {0x6C, 0x25}, {0xA4, 0x00},
-/* 0xD0 */
-{0xF0, 0x00}, {0xD0, 0x00}, {0xCA, 0x00}, {0xCB, 0x00},
-{0xC8, 0x00}, {0x31, 0x01}, {0xCD, 0x00}, {0xCE, 0x00},
-{0xCF, 0x00}, {0x18, 0x25}, {0x0C, 0x25}, {0x88, 0x25},
-{0x84, 0x25}, {0xA6, 0x00}, {0xCC, 0x00}, {0x80, 0x25},
-/* 0xE0 */
-{0xD3, 0x00}, {0xDF, 0x00}, {0xD4, 0x00}, {0xD2, 0x00},
-{0xF5, 0x00}, {0xD5, 0x00}, {0xB5, 0x00}, {0xFE, 0x00},
-{0xDE, 0x00}, {0xDA, 0x00}, {0xDB, 0x00}, {0xD9, 0x00},
-{0xFD, 0x00}, {0xDD, 0x00}, {0xAF, 0x00}, {0xB4, 0x00},
-/* 0xF0 */
-{0xAD, 0x00}, {0xB1, 0x00}, {0x17, 0x20}, {0xBE, 0x00},
-{0xB6, 0x00}, {0xA7, 0x00}, {0xF7, 0x00}, {0xB8, 0x00},
-{0xB0, 0x00}, {0xA8, 0x00}, {0xB7, 0x00}, {0xB9, 0x00},
-{0xB3, 0x00}, {0xB2, 0x00}, {0xA0, 0x25}, {0xA0, 0x00}};
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
index 5b431d281ce0f46bcf7a8d66f5c97f0d4159846c..f81d1ffc5acbd5d15b35c5bb9e610e60bab7d9cd 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _FS_FAT_TABLES_H
+#define _FS_FAT_TABLES_H
+
 struct unicode_value {
        unsigned char uni1;
        unsigned char uni2;
@@ -33,3 +36,5 @@ extern unsigned char fat_code2uni[];
  * c-continued-brace-offset: 0
  * End:
  */
+
+#endif /* _FS_FAT_TABLES_H */
index 8cacd9e7df7d50fde2941b501817f8e7acbfc266..84fcb62554db918993e1cd1ce2eec7fe60dd33eb 100644 (file)
@@ -43,6 +43,10 @@ asmlinkage int sys_setup(void)
 
        binfmt_setup();
 
+#ifdef CONFIG_NLS
+       init_nls();
+#endif
+
 #ifdef CONFIG_EXT_FS
        init_ext_fs();
 #endif
index 8dd4cc9ec4d541e9c844f35a808e3d616f940c55..b4c92ba79f7556dae032a62d7364853eef132580 100644 (file)
@@ -8,7 +8,7 @@
 # Note 2! The CFLAGS definitions are now in the main makefile...
 
 O_TARGET := isofs.o
-O_OBJS   := namei.o inode.o file.o dir.o util.o rock.o symlink.o
+O_OBJS   := namei.o inode.o file.o dir.o util.o rock.o symlink.o joliet.o
 M_OBJS   := $(O_TARGET)
 
 include $(TOPDIR)/Rules.make
index 32b09355830bce3dfec4da8a870e8d9dfe6e3350..04c95b5804dadc130feb821298b3a4e4806598d2 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <asm/segment.h>
 
+
 static int isofs_readdir(struct inode *, struct file *, void *, filldir_t);
 
 static struct file_operations isofs_dir_operations =
@@ -114,15 +115,18 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
        unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
        unsigned char bufbits = ISOFS_BUFFER_BITS(inode);
        unsigned int block, offset;
-       int inode_number;
+       int inode_number = 0;   /* Quiet GCC */
        struct buffer_head *bh;
-       int len, rrflag;
-       int high_sierra = 0;
-       char *name;
+       int len;
+       int map;
+       int high_sierra;
+       int first_de = 1;
+       char *p = NULL;         /* Quiet GCC */
        struct iso_directory_record *de;
 
        offset = filp->f_pos & (bufsize - 1);
        block = isofs_bmap(inode, filp->f_pos >> bufbits);
+       high_sierra = inode->i_sb->u.isofs_sb.s_high_sierra;
 
        if (!block)
                return 0;
@@ -154,7 +158,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
                }
 
                de = (struct iso_directory_record *) (bh->b_data + offset);
-               inode_number = (block << bufbits) + (offset & (bufsize - 1));
+               if(first_de) inode_number = (block << bufbits) + (offset & (bufsize - 1));
 
                de_len = *(unsigned char *) de;
 #ifdef DEBUG
@@ -215,6 +219,13 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
                }
                offset = next_offset;
 
+               if(de->flags[-high_sierra] & 0x80) {
+                       first_de = 0;
+                       filp->f_pos += de_len;
+                       continue;
+               }
+               first_de = 1;
+
                /* Handle the case of the '.' directory */
                if (de->name_len[0] == 1 && de->name[0] == 0) {
                        if (filldir(dirent, ".", 1, filp->f_pos, inode->i_ino) < 0)
@@ -223,6 +234,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
                        continue;
                }
 
+               len = 0;
+
                /* Handle the case of the '..' directory */
                if (de->name_len[0] == 1 && de->name[0] == 1) {
                        inode_number = parent_inode_number(inode, de);
@@ -236,46 +249,43 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
 
                /* Handle everything else.  Do name translation if there
                   is no Rock Ridge NM field. */
-
                if (inode->i_sb->u.isofs_sb.s_unhide == 'n') {
                        /* Do not report hidden or associated files */
-                       high_sierra = inode->i_sb->u.isofs_sb.s_high_sierra;
                        if (de->flags[-high_sierra] & 5) {
                                filp->f_pos += de_len;
                                continue;
                        }
                }
 
-               /* Check Rock Ridge name translation.. */
-               len = de->name_len[0];
-               name = de->name;
-               rrflag = get_rock_ridge_filename(de, &name, &len, inode);
-               if (rrflag) {
-                       /* rrflag == 1 means that we have a new name (kmalloced) */
-                       if (rrflag == 1) {
-                               rrflag = filldir(dirent, name, len, filp->f_pos, inode_number);
-                               dcache_add(inode, name, len, inode_number);
-                               kfree(name); /* this was allocated in get_r_r_filename.. */
-                               if (rrflag < 0)
-                                       break;
+               map = 1;
+               if (inode->i_sb->u.isofs_sb.s_rock) {
+                       len = get_rock_ridge_filename(de, tmpname, inode);
+                       if (len != 0) {
+                               p = tmpname;
+                               map = 0;
                        }
-                       filp->f_pos += de_len;
-                       continue;
                }
-
-               if (inode->i_sb->u.isofs_sb.s_mapping == 'n') {
-                       len = isofs_name_translate(name, len, tmpname);
-                       if (filldir(dirent, tmpname, len, filp->f_pos, inode_number) < 0)
-                               break;
-                       dcache_add(inode, tmpname, len, inode_number);
-                       filp->f_pos += de_len;
-                       continue;
+               if (map) {
+                       if (inode->i_sb->u.isofs_sb.s_joliet_level) {
+                               len = get_joliet_filename(de, inode, tmpname);
+                               p = tmpname;
+                       } else {
+                               if (inode->i_sb->u.isofs_sb.s_mapping == 'n') {
+                                       len = isofs_name_translate(de->name, de->name_len[0],
+                                                                  tmpname);
+                                       p = tmpname;
+                               } else {
+                                       p = de->name;
+                                       len = de->name_len[0];
+                               }
+                       }
                }
+               if (len > 0) {
+                       if (filldir(dirent, p, len, filp->f_pos, inode_number) < 0)
+                               break;
 
-               if (filldir(dirent, name, len, filp->f_pos, inode_number) < 0)
-                       break;
-
-               dcache_add(inode, name, len, inode_number);
+                       dcache_add(inode, p, len, inode_number);
+               }
                filp->f_pos += de_len;
                continue;
        }
@@ -301,7 +311,7 @@ static int isofs_readdir(struct inode *inode, struct file *filp,
        tmpname = (char *) __get_free_page(GFP_KERNEL);
        if (!tmpname)
                return -ENOMEM;
-       tmpde = (struct iso_directory_record *) (tmpname+256);
+       tmpde = (struct iso_directory_record *) (tmpname+1024);
 
        result = do_isofs_readdir(inode, filp, dirent, filldir, tmpname, tmpde);
 
index b00c408533855390f7ffdfcee0f2d942b7e33669..1d62dcf53ac63e542e04f2bace2b5f88ec30ed14 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/malloc.h>
 #include <linux/errno.h>
 #include <linux/cdrom.h>
+#include <linux/nls.h>
 
 #include <asm/system.h>
 #include <asm/segment.h>
@@ -38,6 +39,10 @@ static int check_bread = 0;
 
 void isofs_put_super(struct super_block *sb)
 {
+       if (sb->u.isofs_sb.s_nls_iocharset) {
+               unload_nls(sb->u.isofs_sb.s_nls_iocharset);
+               sb->u.isofs_sb.s_nls_iocharset = NULL;
+       }
        lock_super(sb);
 
 #ifdef LEAK_CHECK
@@ -64,6 +69,7 @@ static struct super_operations isofs_sops = {
 struct iso9660_options{
   char map;
   char rock;
+  char joliet;
   char cruft;
   char unhide;
   unsigned char check;
@@ -72,14 +78,18 @@ struct iso9660_options{
   mode_t mode;
   gid_t gid;
   uid_t uid;
+  char *iocharset;
+  unsigned char utf8;
 };
 
 static int parse_options(char *options, struct iso9660_options * popt)
 {
-       char *this_char,*value;
+       char *this_char,*value,*p;
+       int len;
 
        popt->map = 'n';
        popt->rock = 'y';
+       popt->joliet = 'y';
        popt->cruft = 'n';
        popt->unhide = 'n';
        popt->check = 's';              /* default: strict */
@@ -88,12 +98,18 @@ static int parse_options(char *options, struct iso9660_options * popt)
        popt->mode = S_IRUGO;
        popt->gid = 0;
        popt->uid = 0;
+       popt->iocharset = NULL;
+       popt->utf8 = 0;
        if (!options) return 1;
        for (this_char = strtok(options,","); this_char; this_char = strtok(NULL,",")) {
                if (strncmp(this_char,"norock",6) == 0) {
                  popt->rock = 'n';
                  continue;
                }
+               if (strncmp(this_char,"nojoliet",8) == 0) {
+                 popt->joliet = 'n';
+                 continue;
+               }
                if (strncmp(this_char,"unhide",6) == 0) {
                  popt->unhide = 'y';
                  continue;
@@ -102,9 +118,27 @@ static int parse_options(char *options, struct iso9660_options * popt)
                  popt->cruft = 'y';
                  continue;
                }
+               if (strncmp(this_char,"utf8",4) == 0) {
+                 popt->utf8 = 1;
+                 continue;
+               }
                if ((value = strchr(this_char,'=')) != NULL)
                        *value++ = 0;
-               if (!strcmp(this_char,"map") && value) {
+
+               if (!strcmp(this_char,"iocharset")) {
+                       p = value;
+                       while (*value && *value != ',') value++;
+                       len = value - p;
+                       if (len) {
+                               popt->iocharset = kmalloc(len+1, GFP_KERNEL);
+                               memcpy(popt->iocharset, p, len);
+                               popt->iocharset[len] = 0;
+                       } else {
+                               popt->iocharset = NULL;
+                               return 0;
+                       }
+               }
+               else if (!strcmp(this_char,"map") && value) {
                        if (value[0] && !value[1] && strchr("on",*value))
                                popt->map = *value;
                        else if (!strcmp(value,"off")) popt->map = 'o';
@@ -227,11 +261,14 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
        kdev_t dev = s->s_dev;
        unsigned int vol_desc_start;
        int orig_zonesize;
+       char *p;
+       int joliet_level = 0;
 
        struct iso_volume_descriptor *vdp;
        struct hs_volume_descriptor *hdp;
 
        struct iso_primary_descriptor *pri = NULL;
+       struct iso_supplementary_descriptor *sec = NULL;
        struct hs_primary_descriptor *h_pri = NULL;
 
        struct iso_directory_record *rootp;
@@ -249,6 +286,7 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
 #if 0
        printk("map = %c\n", opt.map);
        printk("rock = %c\n", opt.rock);
+       printk("joliet = %c\n", opt.joliet);
        printk("check = %c\n", opt.check);
        printk("cruft = %c\n", opt.cruft);
        printk("unhide = %c\n", opt.unhide);
@@ -275,57 +313,84 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
        vol_desc_start = isofs_get_last_session(dev);
        
        for (iso_blknum = vol_desc_start+16;
-             iso_blknum < vol_desc_start+100; iso_blknum++) {
-                int b = iso_blknum << (ISOFS_BLOCK_BITS-blocksize_bits);
-
-               if (!(bh = bread(dev,b,opt.blocksize))) {
-                       s->s_dev = 0;
-                       printk("isofs_read_super: bread failed, dev "
-                              "%s iso_blknum %d block %d\n",
-                              kdevname(dev), iso_blknum, b);
-                       unlock_super(s);
-                       MOD_DEC_USE_COUNT;
-                       return NULL;
-               }
+             iso_blknum < vol_desc_start+100; iso_blknum++)
+       {
+           int b = iso_blknum << (ISOFS_BLOCK_BITS-blocksize_bits);
 
-               vdp = (struct iso_volume_descriptor *)bh->b_data;
-               hdp = (struct hs_volume_descriptor *)bh->b_data;
+           if (!(bh = bread(dev,b,opt.blocksize))) {
+               s->s_dev = 0;
+               printk("isofs_read_super: bread failed, dev "
+                      "%s iso_blknum %d block %d\n",
+                      kdevname(dev), iso_blknum, b);
+               unlock_super(s);
+               MOD_DEC_USE_COUNT;
+               return NULL;
+           }
 
+           vdp = (struct iso_volume_descriptor *)bh->b_data;
+           hdp = (struct hs_volume_descriptor *)bh->b_data;
+           
+           if (strncmp (hdp->id, HS_STANDARD_ID, sizeof hdp->id) == 0) {
+               if (isonum_711 (hdp->type) != ISO_VD_PRIMARY)
+                   goto out;
+               if (isonum_711 (hdp->type) == ISO_VD_END)
+                   goto out;
                
-               if (strncmp (hdp->id, HS_STANDARD_ID, sizeof hdp->id) == 0) {
-                 if (isonum_711 (hdp->type) != ISO_VD_PRIMARY)
-                       goto out;
-                 if (isonum_711 (hdp->type) == ISO_VD_END)
-                       goto out;
-               
-                       s->u.isofs_sb.s_high_sierra = 1;
-                       high_sierra = 1;
-                       opt.rock = 'n';
-                       h_pri = (struct hs_primary_descriptor *)vdp;
+               s->u.isofs_sb.s_high_sierra = 1;
+               high_sierra = 1;
+               opt.rock = 'n';
+               h_pri = (struct hs_primary_descriptor *)vdp;
+               break;
+           }
+
+           if (strncmp (vdp->id, ISO_STANDARD_ID, sizeof vdp->id) == 0) {
+               if (isonum_711 (vdp->type) == ISO_VD_END)
+                   break;
+               if (isonum_711 (vdp->type) == ISO_VD_PRIMARY) {
+                   if (pri == NULL) {
+                       pri = (struct iso_primary_descriptor *)vdp;
+                   }
+               } else if (isonum_711 (vdp->type) == ISO_VD_SUPPLEMENTARY) {
+                   sec = (struct iso_supplementary_descriptor *)vdp;
+                   if (sec->escape[0] == 0x25 && sec->escape[1] == 0x2f) {
+                       if (opt.joliet == 'y') {
+                           if (sec->escape[2] == 0x40) {
+                               joliet_level = 1;
+                           } else if (sec->escape[2] == 0x43) {
+                               joliet_level = 2;
+                           } else if (sec->escape[2] == 0x45) {
+                               joliet_level = 3;
+                           }
+                           printk("ISO9660 Extensions: Microsoft Joliet Level %d\n",
+                                  joliet_level);
+                       }
                        break;
+                   } else {
+                       /* Unknown supplementary volume descriptor */
+                       sec = NULL;
+                   }
                }
-               
-               if (strncmp (vdp->id, ISO_STANDARD_ID, sizeof vdp->id) == 0) {
-                 if (isonum_711 (vdp->type) != ISO_VD_PRIMARY)
-                       goto out;
-                 if (isonum_711 (vdp->type) == ISO_VD_END)
-                       goto out;
-               
-                       pri = (struct iso_primary_descriptor *)vdp;
-                       break;
-               }
+               /* Just skip any volume descriptors we don't recognize */
+           }
 
-               brelse(bh);
-             }
-       if(iso_blknum == vol_desc_start + 100) {
-               if (!silent)
-                       printk("Unable to identify CD-ROM format.\n");
-               s->s_dev = 0;
-               unlock_super(s);
-               MOD_DEC_USE_COUNT;
-               return NULL;
+           brelse(bh);
        }
-       
+       if ((pri == NULL) && (sec == NULL) && (h_pri == NULL)) {
+           if (!silent)
+               printk("Unable to identify CD-ROM format.\n");
+           s->s_dev = 0;
+           unlock_super(s);
+           MOD_DEC_USE_COUNT;
+           return NULL;
+       }
+       s->u.isofs_sb.s_joliet_level = joliet_level;
+       if (joliet_level && opt.rock == 'n') {
+           /* This is the case of Joliet with the norock mount flag.
+            * A disc with both Joliet and Rock Ridge is handled later
+            */
+           pri = (struct iso_primary_descriptor *) sec;
+       }
+
        if(high_sierra){
          rootp = (struct iso_directory_record *) h_pri->root_directory_record;
 #ifndef IGNORE_WRONG_MULTI_VOLUME_SPECS
@@ -365,11 +430,6 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
              goto out;
          }
 
-       /* RDE: data zone now byte offset! */
-
-       s->u.isofs_sb.s_firstdatazone = ((isonum_733 (rootp->extent) + 
-                                          isonum_711 (rootp->ext_attr_length))
-                                        << s -> u.isofs_sb.s_log_zone_size);
        s->s_magic = ISOFS_SUPER_MAGIC;
        
        /* The CDROM is read-only, has no nodes (devices) on it, and since
@@ -381,13 +441,17 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
        
        brelse(bh);
        
+       /* RDE: data zone now byte offset! */
+
+       s->u.isofs_sb.s_firstdatazone = ((isonum_733 (rootp->extent) + 
+                                          isonum_711 (rootp->ext_attr_length))
+                                        << s -> u.isofs_sb.s_log_zone_size);
        printk(KERN_DEBUG "Max size:%ld   Log zone size:%ld\n",
               s->u.isofs_sb.s_max_size, 
               1UL << s->u.isofs_sb.s_log_zone_size);
-       printk(KERN_DEBUG "First datazone:%ld   Root inode number %d\n",
+       printk(KERN_DEBUG "First datazone:%ld   Root inode number %ld\n",
               s->u.isofs_sb.s_firstdatazone >> s -> u.isofs_sb.s_log_zone_size,
-              (isonum_733(rootp->extent) + isonum_711(rootp->ext_attr_length))
-                       << s -> u.isofs_sb.s_log_zone_size);
+              s->u.isofs_sb.s_firstdatazone);
        if(high_sierra) printk(KERN_DEBUG "Disc in High Sierra format.\n");
        unlock_super(s);
        /* set up enough so that it can read an inode */
@@ -412,16 +476,36 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
            printk(KERN_DEBUG "Forcing new log zone size:%d\n", opt.blocksize);
          }
 
+       s->u.isofs_sb.s_nls_iocharset = NULL;
+       if (joliet_level == 0) {
+               if (opt.iocharset) {
+                       kfree(opt.iocharset);
+                       opt.iocharset = NULL;
+               }
+       } else if (opt.utf8 == 0) {
+               p = opt.iocharset ? opt.iocharset : "iso8859-1";
+               s->u.isofs_sb.s_nls_iocharset = load_nls(p);
+               if (! s->u.isofs_sb.s_nls_iocharset) {
+                       /* Fail only if explicit charset specified */
+                       if (opt.iocharset) {
+                               kfree(opt.iocharset);
+                               goto out;
+                       } else {
+                               s->u.isofs_sb.s_nls_iocharset = load_nls_default();
+                       }
+               }
+       }
        s->s_dev = dev;
        s->s_op = &isofs_sops;
        s->u.isofs_sb.s_mapping = opt.map;
-       s->u.isofs_sb.s_rock = (opt.rock == 'y' ? 1 : 0);
+       s->u.isofs_sb.s_rock = (opt.rock == 'y' ? 2 : 0);
        s->u.isofs_sb.s_name_check = opt.check;
        s->u.isofs_sb.s_conversion = opt.conversion;
        s->u.isofs_sb.s_cruft = opt.cruft;
        s->u.isofs_sb.s_unhide = opt.unhide;
        s->u.isofs_sb.s_uid = opt.uid;
        s->u.isofs_sb.s_gid = opt.gid;
+       s->u.isofs_sb.s_utf8 = opt.utf8;
        /*
         * It would be incredibly stupid to allow people to mark every file on the disk
         * as suid, so we merely allow them to set the default permissions.
@@ -429,21 +513,47 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
        s->u.isofs_sb.s_mode = opt.mode & 0777;
        s->s_blocksize = opt.blocksize;
        s->s_blocksize_bits = blocksize_bits;
-       s->s_mounted = iget(s, (isonum_733(rootp->extent) + 
-                           isonum_711(rootp->ext_attr_length))
-                               << s -> u.isofs_sb.s_log_zone_size);
+       s->s_mounted = iget(s, s->u.isofs_sb.s_firstdatazone);
+
+       /*
+        * If this disk has both Rock Ridge and Joliet on it, then we
+        * want to use Rock Ridge by default.  This can be overridden
+        * by using the norock mount option.  There is still one other
+        * possibility that is not taken into account: a Rock Ridge
+        * CD with Unicode names.  Until someone sees such a beast, it
+        * will not be supported.
+        */
+       if (joliet_level && opt.rock == 'y' && s->u.isofs_sb.s_rock != 1) {
+               iput(s->s_mounted);
+               pri = (struct iso_primary_descriptor *) sec;
+               rootp = (struct iso_directory_record *)
+                       pri->root_directory_record;
+               s->u.isofs_sb.s_firstdatazone =
+                       ((isonum_733 (rootp->extent) +
+                         isonum_711 (rootp->ext_attr_length))
+                        << s -> u.isofs_sb.s_log_zone_size);
+               s->s_mounted = iget(s, s->u.isofs_sb.s_firstdatazone);
+               s->u.isofs_sb.s_rock = 0;
+       }
        unlock_super(s);
 
        if (!(s->s_mounted)) {
                s->s_dev = 0;
                printk("get root inode failed\n");
+               if (s->u.isofs_sb.s_nls_iocharset)
+                       unload_nls(s->u.isofs_sb.s_nls_iocharset);
+               if (opt.iocharset) kfree(opt.iocharset);
                MOD_DEC_USE_COUNT;
                return NULL;
        }
 
        if(!check_disk_change(s->s_dev)) {
-         return s;
+               return s;
        }
+       if (s->u.isofs_sb.s_nls_iocharset)
+               unload_nls(s->u.isofs_sb.s_nls_iocharset);
+       if (opt.iocharset) kfree(opt.iocharset);
+
  out: /* Kick out for various error conditions */
        brelse(bh);
        s->s_dev = 0;
@@ -470,17 +580,24 @@ void isofs_statfs (struct super_block *sb, struct statfs *buf, int bufsiz)
 
 int isofs_bmap(struct inode * inode,int block)
 {
+       off_t b_off, offset, size;
+       struct inode *ino;
+       unsigned int firstext;
+       unsigned long nextino;
+       int i;
 
        if (block<0) {
                printk("_isofs_bmap: block<0");
                return 0;
        }
 
+       b_off = block << ISOFS_BUFFER_BITS(inode);
+
        /*
         * If we are beyond the end of this file, don't give out any
         * blocks.
         */
-       if( (block << ISOFS_BUFFER_BITS(inode)) > inode->i_size )
+       if( b_off > inode->i_size )
          {
            off_t       max_legal_read_offset;
 
@@ -494,7 +611,7 @@ int isofs_bmap(struct inode * inode,int block)
             */
            max_legal_read_offset = (inode->i_size + PAGE_SIZE - 1) 
              & ~(PAGE_SIZE - 1);
-           if( (block << ISOFS_BUFFER_BITS(inode)) >= max_legal_read_offset )
+           if( b_off >= max_legal_read_offset )
              {
 
                printk("_isofs_bmap: block>= EOF(%d, %ld)", block, 
@@ -503,7 +620,42 @@ int isofs_bmap(struct inode * inode,int block)
            return 0;
          }
 
-       return (inode->u.isofs_i.i_first_extent >> ISOFS_BUFFER_BITS(inode)) + block;
+       offset = 0;
+       firstext = inode->u.isofs_i.i_first_extent;
+       size = inode->u.isofs_i.i_section_size;
+       nextino = inode->u.isofs_i.i_next_section_ino;
+#ifdef DEBUG
+       printk("first inode: inode=%lu nextino=%lu firstext=%u size=%lu\n",
+               inode->i_ino, nextino, firstext, size);
+#endif
+       i = 0;
+       while(b_off >= offset + size) {
+               offset += size;
+
+               if(nextino == 0) return 0;
+               ino = iget(inode->i_sb, nextino);
+               if(!ino) return 0;
+               firstext = ino->u.isofs_i.i_first_extent;
+               size = ino->u.isofs_i.i_section_size;
+#ifdef DEBUG
+               printk("read inode: inode=%lu ino=%lu nextino=%lu firstext=%u size=%lu\n",
+                       inode->i_ino, nextino, ino->u.isofs_i.i_next_section_ino, firstext, size);
+#endif
+               nextino = ino->u.isofs_i.i_next_section_ino;
+               iput(ino);
+               
+               if(++i > 100) {
+                       printk("isofs_bmap: More than 100 file sections ?!?, aborting...\n");
+                       printk("isofs_bmap: ino=%lu block=%d firstext=%u size=%u nextino=%lu\n",
+                               inode->i_ino, block, firstext, (unsigned)size, nextino);
+                       return 0;
+               }
+       }
+#ifdef DEBUG
+       printk("isofs_bmap: mapped inode:block %lu:%d to block %lu\n",
+               inode->i_ino, block, (b_off - offset + firstext) >> ISOFS_BUFFER_BITS(inode));
+#endif
+       return (b_off - offset + firstext) >> ISOFS_BUFFER_BITS(inode);
 }
 
 
@@ -517,6 +669,82 @@ static void test_and_set_uid(uid_t *p, uid_t value)
        }
 }
 
+static int isofs_read_level3_size(struct inode * inode)
+{
+       unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
+       struct buffer_head * bh = NULL;
+       struct iso_directory_record * raw_inode = NULL;         /* quiet gcc */
+       unsigned char *pnt = NULL;
+       void *cpnt = NULL;
+       int block = 0;                  /* Quiet GCC */
+       unsigned long ino;
+       int i;
+
+       inode->i_size = 0;
+       inode->u.isofs_i.i_next_section_ino = 0;
+       ino = inode->i_ino;
+       i = 0;
+       do {
+               if(i > 100) {
+                       printk("isofs_read_level3_size: More than 100 file sections ?!?, aborting...\n"
+                              "isofs_read_level3_size: inode=%lu ino=%lu\n", inode->i_ino, ino);
+                       return 0;
+               }
+
+               if(bh == NULL || block != ino >> ISOFS_BUFFER_BITS(inode)) {
+                       if(bh) brelse(bh);
+                       block = ino >> ISOFS_BUFFER_BITS(inode);
+                       if (!(bh=bread(inode->i_dev,block, bufsize))) {
+                               printk("unable to read i-node block");
+                               return 1;
+                       }
+               }
+               pnt = ((unsigned char *) bh->b_data
+                      + (ino & (bufsize - 1)));
+       
+               if ((ino & (bufsize - 1)) + *pnt > bufsize){
+                       int frag1, offset;
+       
+                       offset = (ino & (bufsize - 1));
+                       frag1 = bufsize - offset;
+                       cpnt = kmalloc(*pnt,GFP_KERNEL);
+                       if (cpnt == NULL) {
+                               printk(KERN_INFO "NoMem ISO inode %lu\n",inode->i_ino);
+                               brelse(bh);
+                               return 1;
+                       }
+                       memcpy(cpnt, bh->b_data + offset, frag1);
+                       brelse(bh);
+                       if (!(bh = bread(inode->i_dev,++block, bufsize))) {
+                               kfree(cpnt);
+                               printk("unable to read i-node block");
+                               return 1;
+                       }
+                       offset += *pnt - bufsize;
+                       memcpy((char *)cpnt+frag1, bh->b_data, offset);
+                       pnt = ((unsigned char *) cpnt);
+               }
+               
+               if(*pnt == 0) {
+                       ino = (ino & ~(ISOFS_BLOCK_SIZE - 1)) + ISOFS_BLOCK_SIZE;
+                       continue;
+               }
+               raw_inode = ((struct iso_directory_record *) pnt);
+
+               inode->i_size += isonum_733 (raw_inode->size);
+               if(i == 1) inode->u.isofs_i.i_next_section_ino = ino;
+
+               ino += *pnt;
+               if (cpnt) {
+                       kfree (cpnt);
+                       cpnt = NULL;
+               }
+               i++;
+       } while(raw_inode->flags[-inode->i_sb->u.isofs_sb.s_high_sierra] & 0x80);
+       brelse(bh);
+       return 0;
+}
+
 void isofs_read_inode(struct inode * inode)
 {
        unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
@@ -584,7 +812,13 @@ void isofs_read_inode(struct inode * inode)
        }
        inode->i_uid = inode->i_sb->u.isofs_sb.s_uid;
        inode->i_gid = inode->i_sb->u.isofs_sb.s_gid;
-       inode->i_size = isonum_733 (raw_inode->size);
+
+       inode->u.isofs_i.i_section_size = isonum_733 (raw_inode->size);
+       if(raw_inode->flags[-high_sierra] & 0x80) {
+               if(isofs_read_level3_size(inode)) goto fail;
+       } else {
+               inode->i_size = isonum_733 (raw_inode->size);
+       }
 
        /* There are defective discs out there - we do this to protect
           ourselves.  A cdrom will never contain more than 800Mb */
diff --git a/fs/isofs/joliet.c b/fs/isofs/joliet.c
new file mode 100644 (file)
index 0000000..1b1f26a
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ *  linux/fs/isofs/joliet.c
+ *
+ *  (C) 1996 Gordon Chaffee
+ *
+ *  Joliet: Microsoft's Unicode extensions to iso9660
+ */
+
+#include <linux/string.h>
+#include <linux/config.h>
+#include <linux/nls.h>
+#include <linux/malloc.h>
+#include <linux/iso_fs.h>
+
+/*
+ * Convert Unicode 16 to UTF8 or ascii.
+ */
+static int
+uni16_to_x8(unsigned char *ascii, unsigned char *uni, int len,
+           struct nls_table *nls)
+{
+       unsigned char *ip, *op;
+       unsigned char ch, cl;
+       unsigned char *uni_page;
+
+       ip = uni;
+       op = ascii;
+
+       while ((*ip || ip[1]) && len) {
+               ch = *ip++;
+               cl = *ip++;
+
+               uni_page = nls->page_uni2charset[ch];
+               if (uni_page && uni_page[cl]) {
+                       *op++ = uni_page[cl];
+               } else {
+                       *op++ = '?';
+               }
+               len--;
+       }
+       *op = 0;
+       return (op - ascii);
+}
+
+/* Convert big endian wide character string to utf8 */
+static int
+wcsntombs_be(__u8 *s, const __u8 *pwcs, int inlen, int maxlen)
+{
+       const __u8 *ip;
+       __u8 *op;
+       int size;
+       __u16 c;
+
+       op = s;
+       ip = pwcs;
+       while ((*ip || ip[1]) && (maxlen > 0) && (inlen > 0)) {
+               c = (*ip << 8) | ip[1];
+               if (c > 0x7f) {
+                       size = utf8_wctomb(op, c, maxlen);
+                       if (size == -1) {
+                               /* Ignore character and move on */
+                               maxlen--;
+                       } else {
+                               op += size;
+                               maxlen -= size;
+                       }
+               } else {
+                       *op++ = (__u8) c;
+               }
+               ip += 2;
+               inlen--;
+       }
+       return (op - s);
+}
+
+int
+get_joliet_filename(struct iso_directory_record * de, struct inode * inode,
+                   unsigned char *outname)
+{
+       unsigned char utf8;
+       struct nls_table *nls;
+       unsigned char len = 0;
+       int i;
+       char c;
+
+       utf8 = inode->i_sb->u.isofs_sb.s_utf8;
+       nls = inode->i_sb->u.isofs_sb.s_nls_iocharset;
+
+       if (utf8) {
+               len = wcsntombs_be(outname, de->name,
+                                  de->name_len[0] >> 1, PAGE_SIZE);
+       } else {
+               len = uni16_to_x8(outname, de->name,
+                                 de->name_len[0] >> 1, nls);
+       }
+       if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1')) {
+               len -= 2;
+       }
+
+        if (inode->i_sb->u.isofs_sb.s_name_check == 'r') {
+               for (i = 0; i < len; i++) {
+                       c = outname[i];
+                       /* lower case */
+                       if (c >= 'A' && c <= 'Z') c |= 0x20;
+                       if (c == ';') c = '.';
+                       outname[i] = c;
+               }
+       }
+
+       return len;
+}
index 606e05c1f08c2beb3f80a0542b382f409f74e0b5..80aba17a5305750d8f547706305410a78d563264 100644 (file)
@@ -58,8 +58,9 @@ static int isofs_match(int len,const char * name, const char * compare, int dlen
  * itself (as an inode number). It does NOT read the inode of the
  * entry - you'll have to do that yourself if you want to.
  */
-static struct buffer_head * isofs_find_entry(struct inode * dir,
-       const char * name, int namelen, unsigned long * ino, unsigned long * ino_back)
+static struct buffer_head *
+isofs_find_entry(struct inode * dir, const char * name, int namelen,
+                unsigned long * ino, unsigned long * ino_back)
 {
        unsigned long bufsize = ISOFS_BUFFER_SIZE(dir);
        unsigned char bufbits = ISOFS_BUFFER_BITS(dir);
@@ -68,8 +69,9 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
        void * cpnt = NULL;
        unsigned int old_offset;
        unsigned int backlink;
-       int dlen, rrflag, match;
+       int dlen, match;
        char * dpnt;
+       unsigned char *page = NULL;
        struct iso_directory_record * de;
        char c;
 
@@ -100,7 +102,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                                 + ISOFS_BLOCK_SIZE);
                        block = isofs_bmap(dir,f_pos>>bufbits);
                        if (!block || !(bh = bread(dir->i_dev,block,bufsize)))
-                               return 0;
+                               return NULL;
                        continue; /* Will kick out if past end of directory */
                }
 
@@ -114,7 +116,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                        unsigned int frag1;
                        frag1 = bufsize - old_offset;
                        cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
-                       if (!cpnt) return 0;
+                       if (!cpnt) return NULL;
                        memcpy(cpnt, bh->b_data + old_offset, frag1);
 
                        de = (struct iso_directory_record *) cpnt;
@@ -123,21 +125,24 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                        block = isofs_bmap(dir,f_pos>>bufbits);
                        if (!block || !(bh = bread(dir->i_dev,block,bufsize))) {
                                kfree(cpnt);
-                               return 0;
+                               return NULL;
                        };
                        memcpy((char *)cpnt+frag1, bh->b_data, offset);
                }
-               
+
+               dlen = de->name_len[0];
+               dpnt = de->name;
+
                /* Handle the '.' case */
                
-               if (de->name[0]==0 && de->name_len[0]==1) {
+               if (*dpnt==0 && dlen==1) {
                        inode_number = dir->i_ino;
                        backlink = 0;
                }
                
                /* Handle the '..' case */
 
-               if (de->name[0]==1 && de->name_len[0]==1) {
+               else if (*dpnt==1 && dlen==1) {
 #if 0
                        printk("Doing .. (%d %d)",
                               dir->i_sb->s_firstdatazone,
@@ -148,31 +153,39 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                        else
                                inode_number = dir->i_ino;
                        backlink = 0;
-               }
-    
-               dlen = de->name_len[0];
-               dpnt = de->name;
-               /* Now convert the filename in the buffer to lower case */
-               rrflag = get_rock_ridge_filename(de, &dpnt, &dlen, dir);
-               if (rrflag) {
-                 if (rrflag == -1) goto out; /* Relocated deep directory */
                } else {
-                 if(dir->i_sb->u.isofs_sb.s_mapping == 'n') {
-                   for (i = 0; i < dlen; i++) {
-                     c = dpnt[i];
-                     if (c >= 'A' && c <= 'Z') c |= 0x20;  /* lower case */
-                     if (c == ';' && i == dlen-2 && dpnt[i+1] == '1') {
-                       dlen -= 2;
-                       break;
-                     }
-                     if (c == ';') c = '.';
-                     de->name[i] = c;
-                   }
-                   /* This allows us to match with and without a trailing
-                      period.  */
-                   if(dpnt[dlen-1] == '.' && namelen == dlen-1)
-                     dlen--;
-                 }
+                       if (dir->i_sb->u.isofs_sb.s_rock ||
+                           dir->i_sb->u.isofs_sb.s_joliet_level) {
+                               page = (unsigned char *)
+                                       __get_free_page(GFP_KERNEL);
+                               if (!page) return NULL;
+                       }
+                       if (dir->i_sb->u.isofs_sb.s_rock &&
+                           ((i = get_rock_ridge_filename(de, page, dir)))){
+                               if (i == -1)
+                                       goto out;/* Relocated deep directory */
+                               dlen = i;
+                               dpnt = page;
+                       } else if (dir->i_sb->u.isofs_sb.s_joliet_level) {
+                               dlen = get_joliet_filename(de, dir, page);
+                               dpnt = page;
+                       } else if (dir->i_sb->u.isofs_sb.s_mapping == 'n') {
+                               for (i = 0; i < dlen; i++) {
+                                       c = dpnt[i];
+                                       /* lower case */
+                                       if (c >= 'A' && c <= 'Z') c |= 0x20;
+                                       if (c == ';' && i == dlen-2 && dpnt[i+1] == '1') {
+                                               dlen -= 2;
+                                               break;
+                                       }
+                                       if (c == ';') c = '.';
+                                       dpnt[i] = c;
+                               }
+                               /* This allows us to match with and without
+                                * a trailing period. */
+                               if(dpnt[dlen-1] == '.' && namelen == dlen-1)
+                                       dlen--;
+                       }
                }
                /*
                 * Skip hidden or associated files unless unhide is set 
@@ -190,7 +203,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                        cpnt = NULL;
                }
 
-               if(rrflag) kfree(dpnt);
+               if (page) free_page((unsigned long) page);
                if (match) {
                        if(inode_number == -1) {
                                /* Should only happen for the '..' entry */
@@ -239,6 +252,7 @@ int isofs_lookup(struct inode * dir,const char * name, int len,
 
        if (dcache_lookup(dir, name, len, &ino)) ino_back = dir->i_ino;
 
+
        if (!ino) {
                char *lcname;
 
@@ -265,8 +279,9 @@ int isofs_lookup(struct inode * dir,const char * name, int len,
                        iput(dir);
                        return -ENOENT;
                }
-               if (ino_back == dir->i_ino)
+               if (ino_back == dir->i_ino) {
                        dcache_add(dir, name, len, ino);
+               }
                brelse(bh);
        }
 
@@ -282,7 +297,7 @@ int isofs_lookup(struct inode * dir,const char * name, int len,
        */
        
        if (ino_back && !(*result)->i_pipe && (*result)->i_sb == dir->i_sb) {
-         (*result)->u.isofs_i.i_backlink = ino_back; 
+               (*result)->u.isofs_i.i_backlink = ino_back; 
        }
        
        iput(dir);
index 76c3168b2870ba0fd8c4487fc9a44501836531a2..b6fa034d2ebc1fa6d46d0241e6b23ee8369882c0 100644 (file)
@@ -168,15 +168,16 @@ int find_rock_ridge_relocation(struct iso_directory_record * de,
 }
 
 int get_rock_ridge_filename(struct iso_directory_record * de,
-                          char ** name, int * namlen, struct inode * inode)
+                           char * retname, struct inode * inode)
 {
   int len;
   unsigned char * chr;
   CONTINUE_DECLS;
-  char * retname = NULL;
   int retnamlen = 0, truncate=0;
  
   if (!inode->i_sb->u.isofs_sb.s_rock) return 0;
+  *retname = 0;
+  retnamlen = 0;
 
   SETUP_ROCK_RIDGE(de, chr, len);
  repeat:
@@ -207,18 +208,6 @@ int get_rock_ridge_filename(struct iso_directory_record * de,
          printk("Unsupported NM flag settings (%d)\n",rr->u.NM.flags);
          break;
        };
-       if (!retname){
-         retname = (char *) kmalloc (255,GFP_KERNEL);
-         /* This may be a waste, but we only
-            need this for a moment.  The layers
-            that call this function should
-            deallocate the mem fairly soon
-            after control is returned */
-
-         if (!retname) goto out;
-         *retname = 0; /* Zero length string */
-         retnamlen = 0;
-       };
        if((strlen(retname) + rr->len - 5) >= 254) {
          truncate = 1;
          break;
@@ -231,7 +220,6 @@ int get_rock_ridge_filename(struct iso_directory_record * de,
        printk("RR: RE (%x)\n", inode->i_ino);
 #endif
        if (buffer) kfree(buffer);
-       if (retname) kfree(retname);
        return -1;
       default:
        break;
@@ -239,15 +227,9 @@ int get_rock_ridge_filename(struct iso_directory_record * de,
     };
   }
   MAYBE_CONTINUE(repeat,inode);
-  if(retname){
-    *name = retname;
-    *namlen = retnamlen;
-    return 1;
-  };
-  return 0;  /* This file did not have a NM field */
+  return retnamlen; /* If 0, this file did not have a NM field */
  out:
   if(buffer) kfree(buffer);
-  if (retname) kfree(retname);
   return 0;
 }
 
@@ -287,6 +269,7 @@ int parse_rock_ridge_inode(struct iso_directory_record * de,
        CHECK_CE;
        break;
       case SIG('E','R'):
+       inode->i_sb->u.isofs_sb.s_rock = 1;
        printk(KERN_DEBUG"ISO9660 Extensions: ");
        { int p;
          for(p=0;p<rr->u.ER.len_id;p++) printk("%c",rr->u.ER.data[p]);
index b080406cda2b8db01a698e11b7485bbdd4e86f32..31e83a8d0a3ce2cfe973546a67cd464b0c19e348 100644 (file)
@@ -9,6 +9,8 @@
  *  the 386bsd iso9660 filesystem, by Pace Willisson <pace@blitz.com>.
  */
 
+#include <linux/time.h>
+
 int
 isonum_711 (char * p)
 {
@@ -84,10 +86,9 @@ isonum_733 (char * p)
        return (isonum_731 (p));
 }
 
-/* We have to convert from a MM/DD/YY format to the unix ctime format.  We have to
-   take into account leap years and all of that good stuff.  Unfortunately, the kernel
-   does not have the information on hand to take into account daylight savings time,
-   so there will be cases (roughly half the time) where the dates are off by one hour. */
+/* We have to convert from a MM/DD/YY format to the unix ctime format.
+ * We have to take into account leap years and all of that good stuff.
+ */
 int iso_date(char * p, int flag)
 {
        int year, month, day, hour ,minute, second, tz;
@@ -106,6 +107,8 @@ int iso_date(char * p, int flag)
                crtime = 0;
        } else {
                int monlen[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
+               extern struct timezone sys_tz;
+
                days = year * 365;
                if (year > 2)
                        days += (year+1) / 4;
@@ -116,7 +119,9 @@ int iso_date(char * p, int flag)
                days += day - 1;
                crtime = ((((days * 24) + hour) * 60 + minute) * 60)
                        + second;
-               
+               if (sys_tz.tz_dsttime)
+                       crtime -= 3600;
+
                /* sign extend */
                if (tz & 0x80)
                        tz |= (-1 << 8);
index 0e5d3ceda43a5ecab975e3ce1ef0522a4dada602..c0de73f150c3f553f7a364edbc35de33232f05a6 100644 (file)
@@ -60,6 +60,7 @@ struct super_block *msdos_read_super(struct super_block *sb,void *data, int sile
 
        MOD_INC_USE_COUNT;
 
+       MSDOS_SB(sb)->options.isvfat = 0;
        sb->s_op = &msdos_sops;
        res =  fat_read_super(sb, data, silent);
        if (res == NULL)
@@ -263,7 +264,9 @@ static int msdos_create_entry(struct inode *dir, const char *name,int len,
 
        if ((res = fat_scan(dir,NULL,&bh,&de,&ino,SCAN_ANY)) < 0) {
                if (res != -ENOENT) return res;
-               if (dir->i_ino == MSDOS_ROOT_INO) return -ENOSPC;
+               if ((dir->i_ino == MSDOS_ROOT_INO) &&
+                   (MSDOS_SB(sb)->fat_bits != 32))
+                       return -ENOSPC;
                if ((res = fat_add_cluster(dir)) < 0) return res;
                if ((res = fat_scan(dir,NULL,&bh,&de,&ino,SCAN_ANY)) < 0) return res;
        }
@@ -273,10 +276,10 @@ static int msdos_create_entry(struct inode *dir, const char *name,int len,
        dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        dir->i_dirt = 1;
        memcpy(de->name,name,MSDOS_NAME);
-       memset(de->unused, 0, sizeof(de->unused));
        de->attr = is_dir ? ATTR_DIR : ATTR_ARCH;
        de->attr = is_hid ? (de->attr|ATTR_HIDDEN) : (de->attr&~ATTR_HIDDEN);
        de->start = 0;
+       de->starthi = 0;
        fat_date_unix2dos(dir->i_mtime,&de->time,&de->date);
        de->size = 0;
        fat_mark_buffer_dirty(sb, bh, 1);
@@ -367,6 +370,9 @@ static int msdos_empty(struct inode *dir)
                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)) {
@@ -456,6 +462,7 @@ int msdos_mkdir(struct inode *dir,const char *name,int len,int mode)
                goto mkdir_error;
        dot->i_size = inode->i_size; /* doesn't grow in the 2nd create_entry */
        MSDOS_I(dot)->i_start = MSDOS_I(inode)->i_start;
+       MSDOS_I(dot)->i_logstart = MSDOS_I(inode)->i_logstart;
        dot->i_nlink = inode->i_nlink;
        dot->i_dirt = 1;
        iput(dot);
@@ -464,6 +471,7 @@ int msdos_mkdir(struct inode *dir,const char *name,int len,int mode)
        fat_unlock_creation();
        dot->i_size = dir->i_size;
        MSDOS_I(dot)->i_start = MSDOS_I(dir)->i_start;
+       MSDOS_I(dot)->i_logstart = MSDOS_I(dir)->i_logstart;
        dot->i_nlink = dir->i_nlink;
        dot->i_dirt = 1;
        MSDOS_I(inode)->i_busy = 0;
@@ -718,8 +726,10 @@ static int rename_diff_dir(struct inode *old_dir,char *old_name,int old_len,
                        error = -EIO;
                        goto rename_done;
                }
-               dotdot_de->start = MSDOS_I(dotdot_inode)->i_start =
-                   MSDOS_I(new_dir)->i_start;
+               MSDOS_I(dotdot_inode)->i_start = MSDOS_I(new_dir)->i_start;
+               MSDOS_I(dotdot_inode)->i_logstart = MSDOS_I(new_dir)->i_logstart;
+               dotdot_de->start = CT_LE_W(MSDOS_I(new_dir)->i_logstart);
+               dotdot_de->starthi = CT_LE_W((MSDOS_I(new_dir)->i_logstart) >> 16);
                dotdot_inode->i_dirt = 1;
                fat_mark_buffer_dirty(sb, dotdot_bh, 1);
                old_dir->i_nlink--;
diff --git a/fs/nls.c b/fs/nls.c
new file mode 100644 (file)
index 0000000..8b10e10
--- /dev/null
+++ b/fs/nls.c
@@ -0,0 +1,526 @@
+/*
+ * linux/fs/nls.c
+ *
+ * Native language support--charsets and unicode translations.
+ * By Gordon Chaffee 1996, 1997
+ *
+ */
+#ifndef _LINUX_FS_NLS_C
+#define _LINUX_FS_NLS_C
+
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/string.h>
+#include <linux/config.h>
+#include <linux/nls.h>
+#include <linux/malloc.h>
+#ifdef CONFIG_KERNELD
+#include <linux/kerneld.h>
+#endif
+#include <asm/byteorder.h>
+
+static struct nls_table *tables = (struct nls_table *) NULL;
+
+/*
+ * Sample implementation from Unicode home page.
+ * http://www.stonehand.com/unicode/standard/fss-utf.html
+ */
+struct utf8_table {
+       int     cmask;
+       int     cval;
+       int     shift;
+       long    lmask;
+       long    lval;
+};
+
+static struct utf8_table utf8_table[] =
+{
+    {0x80,  0x00,   0*6,    0x7F,           0,         /* 1 byte sequence */},
+    {0xE0,  0xC0,   1*6,    0x7FF,          0x80,      /* 2 byte sequence */},
+    {0xF0,  0xE0,   2*6,    0xFFFF,         0x800,     /* 3 byte sequence */},
+    {0xF8,  0xF0,   3*6,    0x1FFFFF,       0x10000,   /* 4 byte sequence */},
+    {0xFC,  0xF8,   4*6,    0x3FFFFFF,      0x200000,  /* 5 byte sequence */},
+    {0xFE,  0xFC,   5*6,    0x7FFFFFFF,     0x4000000, /* 6 byte sequence */},
+    {0,                                                       /* end of table    */}
+};
+
+int
+utf8_mbtowc(__u16 *p, const __u8 *s, int n)
+{
+       long l;
+       int c0, c, nc;
+       struct utf8_table *t;
+  
+       printk("utf8_mbtowc\n");
+       nc = 0;
+       c0 = *s;
+       l = c0;
+       for (t = utf8_table; t->cmask; t++) {
+               nc++;
+               if ((c0 & t->cmask) == t->cval) {
+                       l &= t->lmask;
+                       if (l < t->lval)
+                               return -1;
+                       *p = l;
+                       return nc;
+               }
+               if (n <= nc)
+                       return -1;
+               s++;
+               c = (*s ^ 0x80) & 0xFF;
+               if (c & 0xC0)
+                       return -1;
+               l = (l << 6) | c;
+       }
+       return -1;
+}
+
+int
+utf8_mbstowcs(__u16 *pwcs, const __u8 *s, int n)
+{
+       __u16 *op;
+       const __u8 *ip;
+       int size;
+
+       printk("\nutf8_mbstowcs: n=%d\n", n);
+       op = pwcs;
+       ip = s;
+       while (*ip && n > 0) {
+               printk(" %02x", *ip);
+               if (*ip & 0x80) {
+                       size = utf8_mbtowc(op, ip, n);
+                       if (size == -1) {
+                               /* Ignore character and move on */
+                               ip++;
+                               n--;
+                       } else {
+                               op += size;
+                               ip += size;
+                               n -= size;
+                       }
+               } else {
+                       *op++ = *ip++;
+               }
+       }
+       return (op - pwcs);
+}
+
+int
+utf8_wctomb(__u8 *s, __u16 wc, int maxlen)
+{
+       long l;
+       int c, nc;
+       struct utf8_table *t;
+  
+       if (s == 0)
+               return 0;
+  
+       l = wc;
+       nc = 0;
+       for (t = utf8_table; t->cmask && maxlen; t++, maxlen--) {
+               nc++;
+               if (l <= t->lmask) {
+                       c = t->shift;
+                       *s = t->cval | (l >> c);
+                       while (c > 0) {
+                               c -= 6;
+                               s++;
+                               *s = 0x80 | ((l >> c) & 0x3F);
+                       }
+                       return nc;
+               }
+       }
+       return -1;
+}
+
+int
+utf8_wcstombs(__u8 *s, const __u16 *pwcs, int maxlen)
+{
+       const __u16 *ip;
+       __u8 *op;
+       int size;
+
+       op = s;
+       ip = pwcs;
+       while (*ip && maxlen > 0) {
+               if (*ip > 0x7f) {
+                       size = utf8_wctomb(op, *ip, maxlen);
+                       if (size == -1) {
+                               /* Ignore character and move on */
+                               maxlen--;
+                       } else {
+                               op += size;
+                               maxlen -= size;
+                       }
+               } else {
+                       *op++ = (__u8) *ip;
+               }
+               ip++;
+       }
+       return (op - s);
+}
+
+int register_nls(struct nls_table * nls)
+{
+       struct nls_table ** tmp = &tables;
+
+       if (!nls)
+               return -EINVAL;
+       if (nls->next)
+               return -EBUSY;
+       while (*tmp) {
+               if (nls == *tmp) {
+                       return -EBUSY;
+               }
+               tmp = &(*tmp)->next;
+       }
+       nls->next = tables;
+       tables = nls;
+       return 0;       
+}
+
+int unregister_nls(struct nls_table * nls)
+{
+       struct nls_table ** tmp = &tables;
+
+       while (*tmp) {
+               if (nls == *tmp) {
+                       *tmp = nls->next;
+                       return 0;
+               }
+               tmp = &(*tmp)->next;
+       }
+       return -EINVAL;
+}
+
+struct nls_table *find_nls(char *charset)
+{
+       struct nls_table *nls = tables;
+       while (nls) {
+               if (! strcmp(nls->charset, charset))
+                       return nls;
+               nls = nls->next;
+       }
+       return NULL;
+}
+
+struct nls_table *load_nls(char *charset)
+{
+       struct nls_table *nls;
+       char buf[40];
+       int ret;
+
+       nls = find_nls(charset);
+       if (nls) {
+               nls->inc_use_count();
+               return nls;
+       }
+
+#ifndef CONFIG_KERNELD
+       return NULL;
+#else
+       if (strlen(charset) > sizeof(buf) - sizeof("nls_")) {
+               printk("Unable to load NLS charset %s: name too long\n", charset);
+               return NULL;
+       }
+               
+       sprintf(buf, "nls_%s", charset);
+       ret = strlen(buf);
+
+       /* Hack to get around genksyms problem */
+       if (buf[ret-2] == '-')
+               buf[ret-2] = '_';
+       if (buf[ret-3] == '-')
+               buf[ret-3] = '_';
+
+       ret = request_module(buf);
+       if (ret != 0) {
+               printk("Unable to load NLS charset %s(%s)\n", charset, buf);
+               return NULL;
+       }
+       nls = find_nls(charset);
+       if (nls) {
+               nls->inc_use_count();
+       }
+       return nls;
+#endif
+}
+
+void unload_nls(struct nls_table *nls)
+{
+       nls->dec_use_count();
+}
+
+struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x80, 0x00}, {0x81, 0x00}, {0x82, 0x00}, {0x83, 0x00},
+       {0x84, 0x00}, {0x85, 0x00}, {0x86, 0x00}, {0x87, 0x00},
+       {0x88, 0x00}, {0x89, 0x00}, {0x8a, 0x00}, {0x8b, 0x00},
+       {0x8c, 0x00}, {0x8d, 0x00}, {0x8e, 0x00}, {0x8f, 0x00},
+       /* 0x90*/
+       {0x90, 0x00}, {0x91, 0x00}, {0x92, 0x00}, {0x93, 0x00},
+       {0x94, 0x00}, {0x95, 0x00}, {0x96, 0x00}, {0x97, 0x00},
+       {0x98, 0x00}, {0x99, 0x00}, {0x9a, 0x00}, {0x9b, 0x00},
+       {0x9c, 0x00}, {0x9d, 0x00}, {0x9e, 0x00}, {0x9f, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00},
+       {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00},
+       {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00},
+       {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00},
+       /* 0xc0*/
+       {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00},
+       {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00},
+       {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00},
+       /* 0xd0*/
+       {0xd0, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00},
+       {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00},
+       {0xdc, 0x00}, {0xdd, 0x00}, {0xde, 0x00}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00},
+       {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00},
+       {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00},
+       {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00},
+       /* 0xf0*/
+       {0xf0, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00},
+       {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00},
+       {0xfc, 0x00}, {0xfd, 0x00}, {0xfe, 0x00}, {0xff, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00
+};
+
+
+void inc_use_count(void)
+{
+}
+
+void dec_use_count(void)
+{
+}
+
+static struct nls_table default_table = {
+       "default",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+
+
+/* Returns a simple default translation table */
+struct nls_table *load_nls_default(void)
+{
+       return &default_table;
+}
+
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+#define X(sym) EXPORT_SYMBOL(sym);
+#define X_PUNCT ;
+#else
+#define X_PUNCT ,
+static struct symbol_table nls_syms = {
+#include <linux/symtab_begin.h>
+#endif
+X(register_nls) X_PUNCT
+X(unregister_nls) X_PUNCT
+X(unload_nls) X_PUNCT
+X(find_nls) X_PUNCT
+X(load_nls) X_PUNCT
+X(load_nls_default) X_PUNCT
+X(utf8_mbtowc) X_PUNCT
+X(utf8_mbstowcs) X_PUNCT
+X(utf8_wctomb) X_PUNCT
+X(utf8_wcstombs) X_PUNCT
+#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,0)
+#include <linux/symtab_end.h>
+};                                           
+#endif
+
+int init_nls(void)
+{
+#ifdef CONFIG_NLS_ISO8859_1
+       init_nls_iso8859_1();
+#endif
+#ifdef CONFIG_NLS_ISO8859_2
+       init_nls_iso8859_2();
+#endif
+#ifdef CONFIG_NLS_ISO8859_3
+       init_nls_iso8859_3();
+#endif
+#ifdef CONFIG_NLS_ISO8859_4
+       init_nls_iso8859_4();
+#endif
+#ifdef CONFIG_NLS_ISO8859_5
+       init_nls_iso8859_5();
+#endif
+#ifdef CONFIG_NLS_ISO8859_6
+       init_nls_iso8859_6();
+#endif
+#ifdef CONFIG_NLS_ISO8859_7
+       init_nls_iso8859_7();
+#endif
+#ifdef CONFIG_NLS_ISO8859_8
+       init_nls_iso8859_8();
+#endif
+#ifdef CONFIG_NLS_ISO8859_9
+       init_nls_iso8859_9();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_437
+       init_nls_cp437();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_737
+       init_nls_cp737();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_775
+       init_nls_cp775();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_850
+       init_nls_cp850();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_852
+       init_nls_cp852();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_855
+       init_nls_cp855();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_857
+       init_nls_cp857();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_860
+       init_nls_cp860();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_861
+       init_nls_cp861();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_862
+       init_nls_cp862();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_863
+       init_nls_cp863();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_864
+       init_nls_cp864();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_865
+       init_nls_cp865();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_866
+       init_nls_cp866();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_869
+       init_nls_cp869();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_874
+       init_nls_cp874();
+#endif
+#ifdef CONFIG_NLS_KOI8_R
+       init_nls_koi8_r();
+#endif
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+       return 0;
+#else
+       return register_symtab(&nls_syms);
+#endif
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls();
+}
+
+
+void cleanup_module(void)
+{
+}
+#endif /* ifdef MODULE */
+
+#endif /* _LINUX_FS_NLS_C */
diff --git a/fs/nls_cp437.c b/fs/nls_cp437.c
new file mode 100644 (file)
index 0000000..4e6a7cb
--- /dev/null
@@ -0,0 +1,452 @@
+/*
+ * linux/fs/nls_cp437.c
+ *
+ * Charset cp437 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00},
+       {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00},
+       {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xa2, 0x00},
+       {0xa3, 0x00}, {0xa5, 0x00}, {0xa7, 0x20}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00},
+       {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0xad, 0x9b, 0x9c, 0x00, 0x9d, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */
+       0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */
+       0x00, 0xa4, 0x95, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x98, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page22[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page23[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp437",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp437(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp437();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp737.c b/fs/nls_cp737.c
new file mode 100644 (file)
index 0000000..252308e
--- /dev/null
@@ -0,0 +1,380 @@
+/*
+ * linux/fs/nls_cp737.c
+ *
+ * Charset cp737 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03}, {0x94, 0x03},
+       {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, {0x98, 0x03},
+       {0x99, 0x03}, {0x9a, 0x03}, {0x9b, 0x03}, {0x9c, 0x03},
+       {0x9d, 0x03}, {0x9e, 0x03}, {0x9f, 0x03}, {0xa0, 0x03},
+       /* 0x90*/
+       {0xa1, 0x03}, {0xa3, 0x03}, {0xa4, 0x03}, {0xa5, 0x03},
+       {0xa6, 0x03}, {0xa7, 0x03}, {0xa8, 0x03}, {0xa9, 0x03},
+       {0xb1, 0x03}, {0xb2, 0x03}, {0xb3, 0x03}, {0xb4, 0x03},
+       {0xb5, 0x03}, {0xb6, 0x03}, {0xb7, 0x03}, {0xb8, 0x03},
+       /* 0xa0*/
+       {0xb9, 0x03}, {0xba, 0x03}, {0xbb, 0x03}, {0xbc, 0x03},
+       {0xbd, 0x03}, {0xbe, 0x03}, {0xbf, 0x03}, {0xc0, 0x03},
+       {0xc1, 0x03}, {0xc3, 0x03}, {0xc2, 0x03}, {0xc4, 0x03},
+       {0xc5, 0x03}, {0xc6, 0x03}, {0xc7, 0x03}, {0xc8, 0x03},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xc9, 0x03}, {0xac, 0x03}, {0xad, 0x03}, {0xae, 0x03},
+       {0xca, 0x03}, {0xaf, 0x03}, {0xcc, 0x03}, {0xcd, 0x03},
+       {0xcb, 0x03}, {0xce, 0x03}, {0x86, 0x03}, {0x88, 0x03},
+       {0x89, 0x03}, {0x8a, 0x03}, {0x8c, 0x03}, {0x8e, 0x03},
+       /* 0xf0*/
+       {0x8f, 0x03}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0xaa, 0x03}, {0xab, 0x03}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, /* 0x80-0x87 */
+       0xeb, 0xec, 0xed, 0x00, 0xee, 0x00, 0xef, 0xf0, /* 0x88-0x8f */
+       0x00, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, /* 0x90-0x97 */
+       0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, /* 0x98-0x9f */
+       0x8f, 0x90, 0x00, 0x91, 0x92, 0x93, 0x94, 0x95, /* 0xa0-0xa7 */
+       0x96, 0x97, 0xf4, 0xf5, 0xe1, 0xe2, 0xe3, 0xe5, /* 0xa8-0xaf */
+       0x00, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, /* 0xb0-0xb7 */
+       0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, /* 0xb8-0xbf */
+       0xa7, 0xa8, 0xaa, 0xa9, 0xab, 0xac, 0xad, 0xae, /* 0xc0-0xc7 */
+       0xaf, 0xe0, 0xe4, 0xe8, 0xe6, 0xe7, 0xe9, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page22[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp737",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp737(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp737();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp775.c b/fs/nls_cp775.c
new file mode 100644 (file)
index 0000000..3f5db55
--- /dev/null
@@ -0,0 +1,380 @@
+/*
+ * linux/fs/nls_cp775.c
+ *
+ * Charset cp775 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x06, 0x01}, {0xfc, 0x00}, {0xe9, 0x00}, {0x01, 0x01},
+       {0xe4, 0x00}, {0x23, 0x01}, {0xe5, 0x00}, {0x07, 0x01},
+       {0x42, 0x01}, {0x13, 0x01}, {0x56, 0x01}, {0x57, 0x01},
+       {0x2b, 0x01}, {0x79, 0x01}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0x4d, 0x01},
+       {0xf6, 0x00}, {0x22, 0x01}, {0xa2, 0x00}, {0x5a, 0x01},
+       {0x5b, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00},
+       {0xa3, 0x00}, {0xd8, 0x00}, {0xd7, 0x00}, {0xa4, 0x00},
+       /* 0xa0*/
+       {0x00, 0x01}, {0x2a, 0x01}, {0xf3, 0x00}, {0x7b, 0x01},
+       {0x7c, 0x01}, {0x7a, 0x01}, {0x1d, 0x20}, {0xa6, 0x00},
+       {0xa9, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0x41, 0x01}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x04, 0x01}, {0x0c, 0x01}, {0x18, 0x01},
+       {0x16, 0x01}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x2e, 0x01}, {0x60, 0x01}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x72, 0x01}, {0x6a, 0x01},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x7d, 0x01},
+       /* 0xd0*/
+       {0x05, 0x01}, {0x0d, 0x01}, {0x19, 0x01}, {0x17, 0x01},
+       {0x2f, 0x01}, {0x61, 0x01}, {0x73, 0x01}, {0x6b, 0x01},
+       {0x7e, 0x01}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xd3, 0x00}, {0xdf, 0x00}, {0x4c, 0x01}, {0x43, 0x01},
+       {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0x44, 0x01},
+       {0x36, 0x01}, {0x37, 0x01}, {0x3b, 0x01}, {0x3c, 0x01},
+       {0x46, 0x01}, {0x12, 0x01}, {0x45, 0x01}, {0x19, 0x20},
+       /* 0xf0*/
+       {0xad, 0x00}, {0xb1, 0x00}, {0x1c, 0x20}, {0xbe, 0x00},
+       {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0x1e, 0x20},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0xb9, 0x00},
+       {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0x00, 0x96, 0x9c, 0x9f, 0x00, 0xa7, 0xf5, /* 0xa0-0xa7 */
+       0x00, 0xa8, 0x00, 0xae, 0xaa, 0xf0, 0xa9, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0xfc, 0x00, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0xfb, 0x00, 0xaf, 0xac, 0xab, 0xf3, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0xe0, 0x00, 0xe5, 0x99, 0x9e, /* 0xd0-0xd7 */
+       0x9d, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x84, 0x86, 0x91, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0xa2, 0x00, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x9b, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0xa0, 0x83, 0x00, 0x00, 0xb5, 0xd0, 0x80, 0x87, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xb6, 0xd1, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0xed, 0x89, 0x00, 0x00, 0xb8, 0xd3, /* 0x10-0x17 */
+       0xb7, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x95, 0x85, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0xa1, 0x8c, 0x00, 0x00, 0xbd, 0xd4, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xe9, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0xea, 0xeb, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0xad, 0x88, 0xe3, 0xe7, 0xee, 0xec, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0xe2, 0x93, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x8b, /* 0x50-0x57 */
+       0x00, 0x00, 0x97, 0x98, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0xbe, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0xc7, 0xd7, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0xc6, 0xd6, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x8d, 0xa5, 0xa3, 0xa4, 0xcf, 0xd8, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0xef, 0x00, 0x00, 0xf2, 0xa6, 0xf7, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page22[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x8a, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0x00, 0xa3, 0x00, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0x00, 0xea, 0x00, 0x00, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp775",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp775(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp775();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp850.c b/fs/nls_cp850.c
new file mode 100644 (file)
index 0000000..2babc77
--- /dev/null
@@ -0,0 +1,344 @@
+/*
+ * linux/fs/nls_cp850.c
+ *
+ * Charset cp850 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00},
+       {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00},
+       {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00},
+       {0xa3, 0x00}, {0xd8, 0x00}, {0xd7, 0x00}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00},
+       {0xbf, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc0, 0x00},
+       {0xa9, 0x00}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0xa2, 0x00}, {0xa5, 0x00}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0xe3, 0x00}, {0xc3, 0x00},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00},
+       /* 0xd0*/
+       {0xf0, 0x00}, {0xd0, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xc8, 0x00}, {0x31, 0x01}, {0xcd, 0x00}, {0xce, 0x00},
+       {0xcf, 0x00}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0xa6, 0x00}, {0xcc, 0x00}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0xd2, 0x00},
+       {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0xfe, 0x00},
+       {0xde, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xd9, 0x00},
+       {0xfd, 0x00}, {0xdd, 0x00}, {0xaf, 0x00}, {0xb4, 0x00},
+       /* 0xf0*/
+       {0xad, 0x00}, {0xb1, 0x00}, {0x17, 0x20}, {0xbe, 0x00},
+       {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00},
+       {0xb0, 0x00}, {0xa8, 0x00}, {0xb7, 0x00}, {0xb9, 0x00},
+       {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0xad, 0xbd, 0x9c, 0xcf, 0xbe, 0xdd, 0xf5, /* 0xa0-0xa7 */
+       0xf9, 0xb8, 0xa6, 0xae, 0xaa, 0xf0, 0xa9, 0xee, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0xfc, 0xef, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */
+       0xf7, 0xfb, 0xa7, 0xaf, 0xac, 0xab, 0xf3, 0xa8, /* 0xb8-0xbf */
+       0xb7, 0xb5, 0xb6, 0xc7, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */
+       0xd4, 0x90, 0xd2, 0xd3, 0xde, 0xd6, 0xd7, 0xd8, /* 0xc8-0xcf */
+       0xd1, 0xa5, 0xe3, 0xe0, 0xe2, 0xe5, 0x99, 0x9e, /* 0xd0-0xd7 */
+       0x9d, 0xeb, 0xe9, 0xea, 0x9a, 0xed, 0xe8, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0xc6, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */
+       0xd0, 0xa4, 0x95, 0xa2, 0x93, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x9b, 0x97, 0xa3, 0x96, 0x81, 0xec, 0xe7, 0x98, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   NULL,   NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp850",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp850(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp850();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp852.c b/fs/nls_cp852.c
new file mode 100644 (file)
index 0000000..1e1a1a9
--- /dev/null
@@ -0,0 +1,344 @@
+/*
+ * linux/fs/nls_cp852.c
+ *
+ * Charset cp852 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0x6f, 0x01}, {0x07, 0x01}, {0xe7, 0x00},
+       {0x42, 0x01}, {0xeb, 0x00}, {0x50, 0x01}, {0x51, 0x01},
+       {0xee, 0x00}, {0x79, 0x01}, {0xc4, 0x00}, {0x06, 0x01},
+       /* 0x90*/
+       {0xc9, 0x00}, {0x39, 0x01}, {0x3a, 0x01}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0x3d, 0x01}, {0x3e, 0x01}, {0x5a, 0x01},
+       {0x5b, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0x64, 0x01},
+       {0x65, 0x01}, {0x41, 0x01}, {0xd7, 0x00}, {0x0d, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0x04, 0x01}, {0x05, 0x01}, {0x7d, 0x01}, {0x7e, 0x01},
+       {0x18, 0x01}, {0x19, 0x01}, {0xac, 0x00}, {0x7a, 0x01},
+       {0x0c, 0x01}, {0x5f, 0x01}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0x1a, 0x01},
+       {0x5e, 0x01}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x7b, 0x01}, {0x7c, 0x01}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x02, 0x01}, {0x03, 0x01},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00},
+       /* 0xd0*/
+       {0x11, 0x01}, {0x10, 0x01}, {0x0e, 0x01}, {0xcb, 0x00},
+       {0x0f, 0x01}, {0x47, 0x01}, {0xcd, 0x00}, {0xce, 0x00},
+       {0x1b, 0x01}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x62, 0x01}, {0x6e, 0x01}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0x43, 0x01},
+       {0x44, 0x01}, {0x48, 0x01}, {0x60, 0x01}, {0x61, 0x01},
+       {0x54, 0x01}, {0xda, 0x00}, {0x55, 0x01}, {0x70, 0x01},
+       {0xfd, 0x00}, {0xdd, 0x00}, {0x63, 0x01}, {0xb4, 0x00},
+       /* 0xf0*/
+       {0xad, 0x00}, {0xdd, 0x02}, {0xdb, 0x02}, {0xc7, 0x02},
+       {0xd8, 0x02}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00},
+       {0xb0, 0x00}, {0xa8, 0x00}, {0xd9, 0x02}, {0x71, 0x01},
+       {0x58, 0x01}, {0x59, 0x01}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0xf5, /* 0xa0-0xa7 */
+       0xf9, 0x00, 0x00, 0xae, 0xaa, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0xf7, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0xb5, 0xb6, 0x00, 0x8e, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */
+       0x00, 0x90, 0x00, 0xd3, 0x00, 0xd6, 0xd7, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0xe0, 0xe2, 0x00, 0x99, 0x9e, /* 0xd0-0xd7 */
+       0x00, 0x00, 0xe9, 0x00, 0x9a, 0xed, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x00, 0xa0, 0x83, 0x00, 0x84, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */
+       0x00, 0x82, 0x00, 0x89, 0x00, 0xa1, 0x8c, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x00, 0xa3, 0x00, 0x81, 0xec, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0xc6, 0xc7, 0xa4, 0xa5, 0x8f, 0x86, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xac, 0x9f, 0xd2, 0xd4, /* 0x08-0x0f */
+       0xd1, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xa8, 0xa9, 0xb7, 0xd8, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x91, 0x92, 0x00, 0x00, 0x95, 0x96, 0x00, /* 0x38-0x3f */
+       0x00, 0x9d, 0x88, 0xe3, 0xe4, 0x00, 0x00, 0xd5, /* 0x40-0x47 */
+       0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x8a, 0x8b, 0x00, 0x00, 0xe8, 0xea, 0x00, 0x00, /* 0x50-0x57 */
+       0xfc, 0xfd, 0x97, 0x98, 0x00, 0x00, 0xb8, 0xad, /* 0x58-0x5f */
+       0xe6, 0xe7, 0xdd, 0xee, 0x9b, 0x9c, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0x85, /* 0x68-0x6f */
+       0xeb, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x8d, 0xab, 0xbd, 0xbe, 0xa6, 0xa7, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page02[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0xf4, 0xfa, 0x00, 0xf2, 0x00, 0xf1, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, page02, NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x8a, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x00, 0x00, 0x00, 0x95, 0x00, 0x97, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x9b, 0x00, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0xa4, 0x00, 0xa6, 0x00, /* 0xa0-0xa7 */
+       0xa8, 0x00, 0xaa, 0x00, 0xac, 0x00, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0x00, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0x00, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0xd1, 0xd2, 0xd3, 0x00, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0x00, 0xe2, 0xe3, 0x00, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0x00, 0xfc, 0x00, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp852",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp852(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp852();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp855.c b/fs/nls_cp855.c
new file mode 100644 (file)
index 0000000..c91696c
--- /dev/null
@@ -0,0 +1,344 @@
+/*
+ * linux/fs/nls_cp855.c
+ *
+ * Charset cp855 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x52, 0x04}, {0x02, 0x04}, {0x53, 0x04}, {0x03, 0x04},
+       {0x51, 0x04}, {0x01, 0x04}, {0x54, 0x04}, {0x04, 0x04},
+       {0x55, 0x04}, {0x05, 0x04}, {0x56, 0x04}, {0x06, 0x04},
+       {0x57, 0x04}, {0x07, 0x04}, {0x58, 0x04}, {0x08, 0x04},
+       /* 0x90*/
+       {0x59, 0x04}, {0x09, 0x04}, {0x5a, 0x04}, {0x0a, 0x04},
+       {0x5b, 0x04}, {0x0b, 0x04}, {0x5c, 0x04}, {0x0c, 0x04},
+       {0x5e, 0x04}, {0x0e, 0x04}, {0x5f, 0x04}, {0x0f, 0x04},
+       {0x4e, 0x04}, {0x2e, 0x04}, {0x4a, 0x04}, {0x2a, 0x04},
+       /* 0xa0*/
+       {0x30, 0x04}, {0x10, 0x04}, {0x31, 0x04}, {0x11, 0x04},
+       {0x46, 0x04}, {0x26, 0x04}, {0x34, 0x04}, {0x14, 0x04},
+       {0x35, 0x04}, {0x15, 0x04}, {0x44, 0x04}, {0x24, 0x04},
+       {0x33, 0x04}, {0x13, 0x04}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x45, 0x04}, {0x25, 0x04}, {0x38, 0x04},
+       {0x18, 0x04}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x39, 0x04}, {0x19, 0x04}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x3a, 0x04}, {0x1a, 0x04},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00},
+       /* 0xd0*/
+       {0x3b, 0x04}, {0x1b, 0x04}, {0x3c, 0x04}, {0x1c, 0x04},
+       {0x3d, 0x04}, {0x1d, 0x04}, {0x3e, 0x04}, {0x1e, 0x04},
+       {0x3f, 0x04}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x1f, 0x04}, {0x4f, 0x04}, {0x80, 0x25},
+       /* 0xe0*/
+       {0x2f, 0x04}, {0x40, 0x04}, {0x20, 0x04}, {0x41, 0x04},
+       {0x21, 0x04}, {0x42, 0x04}, {0x22, 0x04}, {0x43, 0x04},
+       {0x23, 0x04}, {0x36, 0x04}, {0x16, 0x04}, {0x32, 0x04},
+       {0x12, 0x04}, {0x4c, 0x04}, {0x2c, 0x04}, {0x16, 0x21},
+       /* 0xf0*/
+       {0xad, 0x00}, {0x4b, 0x04}, {0x2b, 0x04}, {0x37, 0x04},
+       {0x17, 0x04}, {0x48, 0x04}, {0x28, 0x04}, {0x4d, 0x04},
+       {0x2d, 0x04}, {0x49, 0x04}, {0x29, 0x04}, {0x47, 0x04},
+       {0x27, 0x04}, {0xa7, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0xfd, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0xae, 0x00, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page04[256] = {
+       0x00, 0x85, 0x81, 0x83, 0x87, 0x89, 0x8b, 0x8d, /* 0x00-0x07 */
+       0x8f, 0x91, 0x93, 0x95, 0x97, 0x00, 0x99, 0x9b, /* 0x08-0x0f */
+       0xa1, 0xa3, 0xec, 0xad, 0xa7, 0xa9, 0xea, 0xf4, /* 0x10-0x17 */
+       0xb8, 0xbe, 0xc7, 0xd1, 0xd3, 0xd5, 0xd7, 0xdd, /* 0x18-0x1f */
+       0xe2, 0xe4, 0xe6, 0xe8, 0xab, 0xb6, 0xa5, 0xfc, /* 0x20-0x27 */
+       0xf6, 0xfa, 0x9f, 0xf2, 0xee, 0xf8, 0x9d, 0xe0, /* 0x28-0x2f */
+       0xa0, 0xa2, 0xeb, 0xac, 0xa6, 0xa8, 0xe9, 0xf3, /* 0x30-0x37 */
+       0xb7, 0xbd, 0xc6, 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, /* 0x38-0x3f */
+       0xe1, 0xe3, 0xe5, 0xe7, 0xaa, 0xb5, 0xa4, 0xfb, /* 0x40-0x47 */
+       0xf5, 0xf9, 0x9e, 0xf1, 0xed, 0xf7, 0x9c, 0xde, /* 0x48-0x4f */
+       0x00, 0x84, 0x80, 0x82, 0x86, 0x88, 0x8a, 0x8c, /* 0x50-0x57 */
+       0x8e, 0x90, 0x92, 0x94, 0x96, 0x00, 0x98, 0x9a, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page21[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   NULL,   page04, NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   page21, NULL,   NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x00, 0x81, 0x00, 0x83, 0x00, 0x85, 0x00, 0x87, /* 0x80-0x87 */
+       0x00, 0x89, 0x00, 0x8b, 0x00, 0x8d, 0x00, 0x8f, /* 0x88-0x8f */
+       0x00, 0x91, 0x00, 0x93, 0x00, 0x95, 0x00, 0x97, /* 0x90-0x97 */
+       0x00, 0x99, 0x00, 0x9b, 0x00, 0x9d, 0x00, 0x9f, /* 0x98-0x9f */
+       0x00, 0xa1, 0x00, 0xa3, 0x00, 0xa5, 0x00, 0xa7, /* 0xa0-0xa7 */
+       0x00, 0xa9, 0x00, 0xab, 0x00, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0x00, 0xb6, 0x00, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0x00, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0xd1, 0x00, 0xd3, 0x00, 0xd5, 0x00, 0xd7, /* 0xd0-0xd7 */
+       0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0x00, 0xea, 0x00, 0xec, 0x00, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0x00, 0xf2, 0x00, 0xf4, 0x00, 0xf6, 0x00, /* 0xf0-0xf7 */
+       0xf8, 0x00, 0xfa, 0x00, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp855",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp855(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp855();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp857.c b/fs/nls_cp857.c
new file mode 100644 (file)
index 0000000..362bdc0
--- /dev/null
@@ -0,0 +1,308 @@
+/*
+ * linux/fs/nls_cp857.c
+ *
+ * Charset cp857 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00},
+       {0xee, 0x00}, {0x31, 0x01}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00},
+       {0x30, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00},
+       {0xa3, 0x00}, {0xd8, 0x00}, {0x5e, 0x01}, {0x5f, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0x1e, 0x01}, {0x1f, 0x01},
+       {0xbf, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc0, 0x00},
+       {0xa9, 0x00}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0xa2, 0x00}, {0xa5, 0x00}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0xe3, 0x00}, {0xc3, 0x00},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00},
+       /* 0xd0*/
+       {0xba, 0x00}, {0xaa, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xc8, 0x00}, {0x00, 0x00}, {0xcd, 0x00}, {0xce, 0x00},
+       {0xcf, 0x00}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0xa6, 0x00}, {0xcc, 0x00}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0xd2, 0x00},
+       {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0x00, 0x00},
+       {0xd7, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xd9, 0x00},
+       {0xec, 0x00}, {0xff, 0x00}, {0xaf, 0x00}, {0xb4, 0x00},
+       /* 0xf0*/
+       {0xad, 0x00}, {0xb1, 0x00}, {0x00, 0x00}, {0xbe, 0x00},
+       {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00},
+       {0xb0, 0x00}, {0xa8, 0x00}, {0xb7, 0x00}, {0xb9, 0x00},
+       {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0xad, 0xbd, 0x9c, 0xcf, 0xbe, 0xdd, 0xf5, /* 0xa0-0xa7 */
+       0xf9, 0xb8, 0xd1, 0xae, 0xaa, 0xf0, 0xa9, 0xee, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0xfc, 0xef, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */
+       0xf7, 0xfb, 0xd0, 0xaf, 0xac, 0xab, 0xf3, 0xa8, /* 0xb8-0xbf */
+       0xb7, 0xb5, 0xb6, 0xc7, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */
+       0xd4, 0x90, 0xd2, 0xd3, 0xde, 0xd6, 0xd7, 0xd8, /* 0xc8-0xcf */
+       0x00, 0xa5, 0xe3, 0xe0, 0xe2, 0xe5, 0x99, 0xe8, /* 0xd0-0xd7 */
+       0x9d, 0xeb, 0xe9, 0xea, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0xc6, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0xec, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */
+       0x00, 0xa4, 0x95, 0xa2, 0x93, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x9b, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0xed, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa7, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x98, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x9f, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0x00, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0x00, 0x00, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp857",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp857(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp857();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp860.c b/fs/nls_cp860.c
new file mode 100644 (file)
index 0000000..3752d09
--- /dev/null
@@ -0,0 +1,416 @@
+/*
+ * linux/fs/nls_cp860.c
+ *
+ * Charset cp860 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe3, 0x00}, {0xe0, 0x00}, {0xc1, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xca, 0x00}, {0xe8, 0x00}, {0xcd, 0x00},
+       {0xd4, 0x00}, {0xec, 0x00}, {0xc3, 0x00}, {0xc2, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xc0, 0x00}, {0xc8, 0x00}, {0xf4, 0x00},
+       {0xf5, 0x00}, {0xf2, 0x00}, {0xda, 0x00}, {0xf9, 0x00},
+       {0xcc, 0x00}, {0xd5, 0x00}, {0xdc, 0x00}, {0xa2, 0x00},
+       {0xa3, 0x00}, {0xd9, 0x00}, {0xa7, 0x20}, {0xd3, 0x00},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00},
+       {0xbf, 0x00}, {0xd2, 0x00}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0xad, 0x9b, 0x9c, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */
+       0x91, 0x86, 0x8f, 0x8e, 0x00, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */
+       0x92, 0x90, 0x89, 0x00, 0x98, 0x8b, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0xa5, 0xa9, 0x9f, 0x8c, 0x99, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x9d, 0x96, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0x84, 0x00, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x00, 0x8d, 0xa1, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0xa4, 0x95, 0xa2, 0x93, 0x94, 0x00, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x97, 0xa3, 0x00, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page22[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page23[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, /* 0x80-0x87 */
+       0x00, 0x89, 0x00, 0x8b, 0x8c, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x96, 0x00, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp860",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp860(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp860();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp861.c b/fs/nls_cp861.c
new file mode 100644 (file)
index 0000000..14b4be6
--- /dev/null
@@ -0,0 +1,452 @@
+/*
+ * linux/fs/nls_cp861.c
+ *
+ * Charset cp861 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xd0, 0x00},
+       {0xf0, 0x00}, {0xde, 0x00}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0xfe, 0x00}, {0xfb, 0x00}, {0xdd, 0x00},
+       {0xfd, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00},
+       {0xa3, 0x00}, {0xd8, 0x00}, {0xa7, 0x20}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xc1, 0x00}, {0xcd, 0x00}, {0xd3, 0x00}, {0xda, 0x00},
+       {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0xad, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */
+       0x00, 0xa4, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */
+       0x00, 0x90, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, /* 0xc8-0xcf */
+       0x8b, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */
+       0x9d, 0x00, 0xa7, 0x00, 0x9a, 0x97, 0x8d, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0x00, 0xa1, 0x00, 0x00, /* 0xe8-0xef */
+       0x8c, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x9b, 0x00, 0xa3, 0x96, 0x81, 0x98, 0x95, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page22[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page23[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x8b, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x97, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp861",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp861(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp861();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp862.c b/fs/nls_cp862.c
new file mode 100644 (file)
index 0000000..cbb975e
--- /dev/null
@@ -0,0 +1,488 @@
+/*
+ * linux/fs/nls_cp862.c
+ *
+ * Charset cp862 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xd0, 0x05}, {0xd1, 0x05}, {0xd2, 0x05}, {0xd3, 0x05},
+       {0xd4, 0x05}, {0xd5, 0x05}, {0xd6, 0x05}, {0xd7, 0x05},
+       {0xd8, 0x05}, {0xd9, 0x05}, {0xda, 0x05}, {0xdb, 0x05},
+       {0xdc, 0x05}, {0xdd, 0x05}, {0xde, 0x05}, {0xdf, 0x05},
+       /* 0x90*/
+       {0xe0, 0x05}, {0xe1, 0x05}, {0xe2, 0x05}, {0xe3, 0x05},
+       {0xe4, 0x05}, {0xe5, 0x05}, {0xe6, 0x05}, {0xe7, 0x05},
+       {0xe8, 0x05}, {0xe9, 0x05}, {0xea, 0x05}, {0xa2, 0x00},
+       {0xa3, 0x00}, {0xa5, 0x00}, {0xa7, 0x20}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00},
+       {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0xad, 0x9b, 0x9c, 0x00, 0x9d, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0xa4, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page05[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0xd0-0xd7 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0xd8-0xdf */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0xe0-0xe7 */
+       0x98, 0x99, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page22[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page23[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, NULL,   page03, NULL,   page05, NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp862",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp862(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp862();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp863.c b/fs/nls_cp863.c
new file mode 100644 (file)
index 0000000..10084da
--- /dev/null
@@ -0,0 +1,452 @@
+/*
+ * linux/fs/nls_cp863.c
+ *
+ * Charset cp863 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xc2, 0x00}, {0xe0, 0x00}, {0xb6, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00},
+       {0xee, 0x00}, {0x17, 0x20}, {0xc0, 0x00}, {0xa7, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xc8, 0x00}, {0xca, 0x00}, {0xf4, 0x00},
+       {0xcb, 0x00}, {0xcf, 0x00}, {0xfb, 0x00}, {0xf9, 0x00},
+       {0xa4, 0x00}, {0xd4, 0x00}, {0xdc, 0x00}, {0xa2, 0x00},
+       {0xa3, 0x00}, {0xd9, 0x00}, {0xdb, 0x00}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xa6, 0x00}, {0xb4, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xa8, 0x00}, {0xb8, 0x00}, {0xb3, 0x00}, {0xaf, 0x00},
+       {0xce, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xbe, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0x00, 0x9b, 0x9c, 0x98, 0x00, 0xa0, 0x8f, /* 0xa0-0xa7 */
+       0xa4, 0x00, 0x00, 0xae, 0xaa, 0x00, 0x00, 0xa7, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0xa6, 0xa1, 0xe6, 0x86, 0xfa, /* 0xb0-0xb7 */
+       0xa5, 0x00, 0x00, 0xaf, 0xac, 0xab, 0xad, 0x00, /* 0xb8-0xbf */
+       0x8e, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */
+       0x91, 0x90, 0x92, 0x94, 0x00, 0x00, 0xa8, 0x95, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x9d, 0x00, 0x9e, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x85, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0x00, 0x00, 0x8c, 0x8b, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page22[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page23[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x84, 0x00, 0x86, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x94, 0x95, 0x00, 0x00, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0xa0, 0xa1, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp863",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp863(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp863();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp864.c b/fs/nls_cp864.c
new file mode 100644 (file)
index 0000000..6286d09
--- /dev/null
@@ -0,0 +1,443 @@
+/*
+ * linux/fs/nls_cp864.c
+ *
+ * Charset cp864 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x6a, 0x06}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xb0, 0x00}, {0xb7, 0x00}, {0x19, 0x22}, {0x1a, 0x22},
+       {0x92, 0x25}, {0x00, 0x25}, {0x02, 0x25}, {0x3c, 0x25},
+       {0x24, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x34, 0x25},
+       {0x10, 0x25}, {0x0c, 0x25}, {0x14, 0x25}, {0x18, 0x25},
+       /* 0x90*/
+       {0xb2, 0x03}, {0x1e, 0x22}, {0xc6, 0x03}, {0xb1, 0x00},
+       {0xbd, 0x00}, {0xbc, 0x00}, {0x48, 0x22}, {0xab, 0x00},
+       {0xbb, 0x00}, {0xf7, 0xfe}, {0xf8, 0xfe}, {0x00, 0x00},
+       {0x00, 0x00}, {0xfb, 0xfe}, {0xfc, 0xfe}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0xad, 0x00}, {0x82, 0xfe}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0x84, 0xfe}, {0x00, 0x00}, {0x00, 0x00},
+       {0x8e, 0xfe}, {0x8f, 0xfe}, {0x95, 0xfe}, {0x99, 0xfe},
+       {0x0c, 0x06}, {0x9d, 0xfe}, {0xa1, 0xfe}, {0xa5, 0xfe},
+       /* 0xb0*/
+       {0x60, 0x06}, {0x61, 0x06}, {0x62, 0x06}, {0x63, 0x06},
+       {0x64, 0x06}, {0x65, 0x06}, {0x66, 0x06}, {0x67, 0x06},
+       {0x68, 0x06}, {0x69, 0x06}, {0xd1, 0xfe}, {0x1b, 0x06},
+       {0xb1, 0xfe}, {0xb5, 0xfe}, {0xb9, 0xfe}, {0x1f, 0x06},
+       /* 0xc0*/
+       {0xa2, 0x00}, {0x80, 0xfe}, {0x81, 0xfe}, {0x83, 0xfe},
+       {0x85, 0xfe}, {0xca, 0xfe}, {0x8b, 0xfe}, {0x8d, 0xfe},
+       {0x91, 0xfe}, {0x93, 0xfe}, {0x97, 0xfe}, {0x9b, 0xfe},
+       {0x9f, 0xfe}, {0xa3, 0xfe}, {0xa7, 0xfe}, {0xa9, 0xfe},
+       /* 0xd0*/
+       {0xab, 0xfe}, {0xad, 0xfe}, {0xaf, 0xfe}, {0xb3, 0xfe},
+       {0xb7, 0xfe}, {0xbb, 0xfe}, {0xbf, 0xfe}, {0xc1, 0xfe},
+       {0xc5, 0xfe}, {0xcb, 0xfe}, {0xcf, 0xfe}, {0xa6, 0x00},
+       {0xac, 0x00}, {0xf7, 0x00}, {0xd7, 0x00}, {0xc9, 0xfe},
+       /* 0xe0*/
+       {0x40, 0x06}, {0xd3, 0xfe}, {0xd7, 0xfe}, {0xdb, 0xfe},
+       {0xdf, 0xfe}, {0xe3, 0xfe}, {0xe7, 0xfe}, {0xeb, 0xfe},
+       {0xed, 0xfe}, {0xef, 0xfe}, {0xf3, 0xfe}, {0xbd, 0xfe},
+       {0xcc, 0xfe}, {0xce, 0xfe}, {0xcd, 0xfe}, {0xe1, 0xfe},
+       /* 0xf0*/
+       {0x7d, 0xfe}, {0x51, 0x06}, {0xe5, 0xfe}, {0xe9, 0xfe},
+       {0xec, 0xfe}, {0xf0, 0xfe}, {0xf2, 0xfe}, {0xd0, 0xfe},
+       {0xd5, 0xfe}, {0xf5, 0xfe}, {0xf6, 0xfe}, {0xdd, 0xfe},
+       {0xd9, 0xfe}, {0xf1, 0xfe}, {0xa0, 0x25}, {0x00, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x00, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xa0, 0x00, 0xc0, 0xa3, 0xa4, 0x00, 0xdb, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x97, 0xdc, 0xa1, 0x00, 0x00, /* 0xa8-0xaf */
+       0x80, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x98, 0x95, 0x94, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdd, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page06[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbf, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x60-0x67 */
+       0xb8, 0xb9, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page22[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x82, 0x83, 0x00, 0x00, 0x00, 0x91, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0x85, 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x8c, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x8f, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char pagefe[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xc1, 0xc2, 0xa2, 0xc3, 0xa5, 0xc4, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0xc6, 0x00, 0xc7, 0xa8, 0xa9, /* 0x88-0x8f */
+       0x00, 0xc8, 0x00, 0xc9, 0x00, 0xaa, 0x00, 0xca, /* 0x90-0x97 */
+       0x00, 0xab, 0x00, 0xcb, 0x00, 0xad, 0x00, 0xcc, /* 0x98-0x9f */
+       0x00, 0xae, 0x00, 0xcd, 0x00, 0xaf, 0x00, 0xce, /* 0xa0-0xa7 */
+       0x00, 0xcf, 0x00, 0xd0, 0x00, 0xd1, 0x00, 0xd2, /* 0xa8-0xaf */
+       0x00, 0xbc, 0x00, 0xd3, 0x00, 0xbd, 0x00, 0xd4, /* 0xb0-0xb7 */
+       0x00, 0xbe, 0x00, 0xd5, 0x00, 0xeb, 0x00, 0xd6, /* 0xb8-0xbf */
+       0x00, 0xd7, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0xdf, 0xc5, 0xd9, 0xec, 0xee, 0xed, 0xda, /* 0xc8-0xcf */
+       0xf7, 0xba, 0x00, 0xe1, 0x00, 0xf8, 0x00, 0xe2, /* 0xd0-0xd7 */
+       0x00, 0xfc, 0x00, 0xe3, 0x00, 0xfb, 0x00, 0xe4, /* 0xd8-0xdf */
+       0x00, 0xef, 0x00, 0xe5, 0x00, 0xf2, 0x00, 0xe6, /* 0xe0-0xe7 */
+       0x00, 0xf3, 0x00, 0xe7, 0xf4, 0xe8, 0x00, 0xe9, /* 0xe8-0xef */
+       0xf5, 0xfd, 0xf6, 0xea, 0x00, 0xf9, 0xfa, 0x99, /* 0xf0-0xf7 */
+       0x9a, 0x00, 0x00, 0x9d, 0x9e, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   page03, NULL,   NULL,   page06, NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   page22, NULL,   NULL,   page25, NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   pagefe, NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp864",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp864(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp864();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp865.c b/fs/nls_cp865.c
new file mode 100644 (file)
index 0000000..4edbf42
--- /dev/null
@@ -0,0 +1,452 @@
+/*
+ * linux/fs/nls_cp865.c
+ *
+ * Charset cp865 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00},
+       {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00},
+       {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00},
+       {0xa3, 0x00}, {0xd8, 0x00}, {0xa7, 0x20}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00},
+       {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xa4, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0xad, 0x00, 0x9c, 0xaf, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0xa7, 0x00, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */
+       0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */
+       0x9d, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */
+       0x00, 0xa4, 0x95, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x9b, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x98, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page22[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page23[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp865",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp865(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp865();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp866.c b/fs/nls_cp866.c
new file mode 100644 (file)
index 0000000..e776a23
--- /dev/null
@@ -0,0 +1,380 @@
+/*
+ * linux/fs/nls_cp866.c
+ *
+ * Charset cp866 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x10, 0x04}, {0x11, 0x04}, {0x12, 0x04}, {0x13, 0x04},
+       {0x14, 0x04}, {0x15, 0x04}, {0x16, 0x04}, {0x17, 0x04},
+       {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, {0x1b, 0x04},
+       {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, {0x1f, 0x04},
+       /* 0x90*/
+       {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04},
+       {0x24, 0x04}, {0x25, 0x04}, {0x26, 0x04}, {0x27, 0x04},
+       {0x28, 0x04}, {0x29, 0x04}, {0x2a, 0x04}, {0x2b, 0x04},
+       {0x2c, 0x04}, {0x2d, 0x04}, {0x2e, 0x04}, {0x2f, 0x04},
+       /* 0xa0*/
+       {0x30, 0x04}, {0x31, 0x04}, {0x32, 0x04}, {0x33, 0x04},
+       {0x34, 0x04}, {0x35, 0x04}, {0x36, 0x04}, {0x37, 0x04},
+       {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, {0x3b, 0x04},
+       {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, {0x3f, 0x04},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04},
+       {0x44, 0x04}, {0x45, 0x04}, {0x46, 0x04}, {0x47, 0x04},
+       {0x48, 0x04}, {0x49, 0x04}, {0x4a, 0x04}, {0x4b, 0x04},
+       {0x4c, 0x04}, {0x4d, 0x04}, {0x4e, 0x04}, {0x4f, 0x04},
+       /* 0xf0*/
+       {0x01, 0x04}, {0x51, 0x04}, {0x04, 0x04}, {0x54, 0x04},
+       {0x07, 0x04}, {0x57, 0x04}, {0x0e, 0x04}, {0x5e, 0x04},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x16, 0x21}, {0xa4, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page04[256] = {
+       0x00, 0xf0, 0x00, 0x00, 0xf2, 0x00, 0x00, 0xf4, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, /* 0x08-0x0f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x20-0x27 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x28-0x2f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x30-0x37 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x38-0x3f */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
+       0x00, 0xf1, 0x00, 0x00, 0xf3, 0x00, 0x00, 0xf5, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page21[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page22[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   NULL,   page04, NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   page21, page22, NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0xf0, 0x00, 0xf2, 0x00, 0xf4, 0x00, 0xf6, 0x00, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp866",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp866(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp866();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp869.c b/fs/nls_cp869.c
new file mode 100644 (file)
index 0000000..74330a7
--- /dev/null
@@ -0,0 +1,344 @@
+/*
+ * linux/fs/nls_cp869.c
+ *
+ * Charset cp869 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x86, 0x03}, {0x00, 0x00},
+       {0xb7, 0x00}, {0xac, 0x00}, {0xa6, 0x00}, {0x18, 0x20},
+       {0x19, 0x20}, {0x88, 0x03}, {0x15, 0x20}, {0x89, 0x03},
+       /* 0x90*/
+       {0x8a, 0x03}, {0xaa, 0x03}, {0x8c, 0x03}, {0x00, 0x00},
+       {0x00, 0x00}, {0x8e, 0x03}, {0xab, 0x03}, {0xa9, 0x00},
+       {0x8f, 0x03}, {0xb2, 0x00}, {0xb3, 0x00}, {0xac, 0x03},
+       {0xa3, 0x00}, {0xad, 0x03}, {0xae, 0x03}, {0xaf, 0x03},
+       /* 0xa0*/
+       {0xca, 0x03}, {0x90, 0x03}, {0xcc, 0x03}, {0xcd, 0x03},
+       {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03}, {0x94, 0x03},
+       {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, {0xbd, 0x00},
+       {0x98, 0x03}, {0x99, 0x03}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x9a, 0x03}, {0x9b, 0x03}, {0x9c, 0x03},
+       {0x9d, 0x03}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x9e, 0x03}, {0x9f, 0x03}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0xa0, 0x03}, {0xa1, 0x03},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa3, 0x03},
+       /* 0xd0*/
+       {0xa4, 0x03}, {0xa5, 0x03}, {0xa6, 0x03}, {0xa7, 0x03},
+       {0xa8, 0x03}, {0xa9, 0x03}, {0xb1, 0x03}, {0xb2, 0x03},
+       {0xb3, 0x03}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0xb4, 0x03}, {0xb5, 0x03}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb6, 0x03}, {0xb7, 0x03}, {0xb8, 0x03}, {0xb9, 0x03},
+       {0xba, 0x03}, {0xbb, 0x03}, {0xbc, 0x03}, {0xbd, 0x03},
+       {0xbe, 0x03}, {0xbf, 0x03}, {0xc0, 0x03}, {0xc1, 0x03},
+       {0xc3, 0x03}, {0xc2, 0x03}, {0xc4, 0x03}, {0x84, 0x03},
+       /* 0xf0*/
+       {0xad, 0x00}, {0xb1, 0x00}, {0xc5, 0x03}, {0xc6, 0x03},
+       {0xc7, 0x03}, {0xa7, 0x00}, {0xc8, 0x03}, {0x85, 0x03},
+       {0xb0, 0x00}, {0xa8, 0x00}, {0xc9, 0x03}, {0xcb, 0x03},
+       {0xb0, 0x03}, {0xce, 0x03}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xff, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x8a, 0xf5, /* 0xa0-0xa7 */
+       0xf9, 0x97, 0x00, 0xae, 0x89, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0x99, 0x9a, 0x00, 0x00, 0x00, 0x88, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0xaf, 0x00, 0xab, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0xef, 0xf7, 0x86, 0x00, /* 0x80-0x87 */
+       0x8d, 0x8f, 0x90, 0x00, 0x92, 0x00, 0x95, 0x98, /* 0x88-0x8f */
+       0xa1, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, /* 0x90-0x97 */
+       0xac, 0xad, 0xb5, 0xb6, 0xb7, 0xb8, 0xbd, 0xbe, /* 0x98-0x9f */
+       0xc6, 0xc7, 0x00, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, /* 0xa0-0xa7 */
+       0xd4, 0xd5, 0x91, 0x96, 0x9b, 0x9d, 0x9e, 0x9f, /* 0xa8-0xaf */
+       0xfc, 0xd6, 0xd7, 0xd8, 0xdd, 0xde, 0xe0, 0xe1, /* 0xb0-0xb7 */
+       0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, /* 0xb8-0xbf */
+       0xea, 0xeb, 0xed, 0xec, 0xee, 0xf2, 0xf3, 0xf4, /* 0xc0-0xc7 */
+       0xf6, 0xfa, 0xa0, 0xfb, 0xa2, 0xa3, 0xfd, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, /* 0x10-0x17 */
+       0x8b, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   NULL,   NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x00, 0x9c, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0x00, 0x00, 0x00, 0xf5, 0x00, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp869",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp869(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp869();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_cp874.c b/fs/nls_cp874.c
new file mode 100644 (file)
index 0000000..e02743e
--- /dev/null
@@ -0,0 +1,308 @@
+/*
+ * linux/fs/nls_cp874.c
+ *
+ * Charset cp874 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#ifndef _NLS_CP
+#define _NLS_CP
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x26, 0x20}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x18, 0x20}, {0x19, 0x20}, {0x1c, 0x20},
+       {0x1d, 0x20}, {0x22, 0x20}, {0x13, 0x20}, {0x14, 0x20},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x01, 0x0e}, {0x02, 0x0e}, {0x03, 0x0e},
+       {0x04, 0x0e}, {0x05, 0x0e}, {0x06, 0x0e}, {0x07, 0x0e},
+       {0x08, 0x0e}, {0x09, 0x0e}, {0x0a, 0x0e}, {0x0b, 0x0e},
+       {0x0c, 0x0e}, {0x0d, 0x0e}, {0x0e, 0x0e}, {0x0f, 0x0e},
+       /* 0xb0*/
+       {0x10, 0x0e}, {0x11, 0x0e}, {0x12, 0x0e}, {0x13, 0x0e},
+       {0x14, 0x0e}, {0x15, 0x0e}, {0x16, 0x0e}, {0x17, 0x0e},
+       {0x18, 0x0e}, {0x19, 0x0e}, {0x1a, 0x0e}, {0x1b, 0x0e},
+       {0x1c, 0x0e}, {0x1d, 0x0e}, {0x1e, 0x0e}, {0x1f, 0x0e},
+       /* 0xc0*/
+       {0x20, 0x0e}, {0x21, 0x0e}, {0x22, 0x0e}, {0x23, 0x0e},
+       {0x24, 0x0e}, {0x25, 0x0e}, {0x26, 0x0e}, {0x27, 0x0e},
+       {0x28, 0x0e}, {0x29, 0x0e}, {0x2a, 0x0e}, {0x2b, 0x0e},
+       {0x2c, 0x0e}, {0x2d, 0x0e}, {0x2e, 0x0e}, {0x2f, 0x0e},
+       /* 0xd0*/
+       {0x30, 0x0e}, {0x31, 0x0e}, {0x32, 0x0e}, {0x33, 0x0e},
+       {0x34, 0x0e}, {0x35, 0x0e}, {0x36, 0x0e}, {0x37, 0x0e},
+       {0x38, 0x0e}, {0x39, 0x0e}, {0x3a, 0x0e}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x3f, 0x0e},
+       /* 0xe0*/
+       {0x40, 0x0e}, {0x41, 0x0e}, {0x42, 0x0e}, {0x43, 0x0e},
+       {0x44, 0x0e}, {0x45, 0x0e}, {0x46, 0x0e}, {0x47, 0x0e},
+       {0x48, 0x0e}, {0x49, 0x0e}, {0x4a, 0x0e}, {0x4b, 0x0e},
+       {0x4c, 0x0e}, {0x4d, 0x0e}, {0x4e, 0x0e}, {0x4f, 0x0e},
+       /* 0xf0*/
+       {0x50, 0x0e}, {0x51, 0x0e}, {0x52, 0x0e}, {0x53, 0x0e},
+       {0x54, 0x0e}, {0x55, 0x0e}, {0x56, 0x0e}, {0x57, 0x0e},
+       {0x58, 0x0e}, {0x59, 0x0e}, {0x5a, 0x0e}, {0x5b, 0x0e},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page0e[256] = {
+       0x00, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x00-0x07 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x08-0x0f */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x10-0x17 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0x18-0x1f */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */
+       0xd8, 0xd9, 0xda, 0x00, 0x00, 0x00, 0x00, 0xdf, /* 0x38-0x3f */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x50-0x57 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x91, 0x92, 0x00, 0x00, 0x93, 0x94, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   page0e, NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp874",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp874(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp874();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
+
+#endif /* _NLS_CP */
diff --git a/fs/nls_iso8859_1.c b/fs/nls_iso8859_1.c
new file mode 100644 (file)
index 0000000..3b32a70
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * linux/fs/nls_iso8859-1.c
+ *
+ * Charset iso8859-1 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00},
+       {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00},
+       {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00},
+       {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00},
+       /* 0xc0*/
+       {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00},
+       {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00},
+       {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00},
+       /* 0xd0*/
+       {0xd0, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00},
+       {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00},
+       {0xdc, 0x00}, {0xdd, 0x00}, {0xde, 0x00}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00},
+       {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00},
+       {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00},
+       {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00},
+       /* 0xf0*/
+       {0xf0, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00},
+       {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00},
+       {0xfc, 0x00}, {0xfd, 0x00}, {0xfe, 0x00}, {0xff, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-1",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_1(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_1();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls_iso8859_2.c b/fs/nls_iso8859_2.c
new file mode 100644 (file)
index 0000000..b21961b
--- /dev/null
@@ -0,0 +1,299 @@
+/*
+ * linux/fs/nls_iso8859-2.c
+ *
+ * Charset iso8859-2 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x04, 0x01}, {0xd8, 0x02}, {0x41, 0x01},
+       {0xa4, 0x00}, {0x3d, 0x01}, {0x5a, 0x01}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0x60, 0x01}, {0x5e, 0x01}, {0x64, 0x01},
+       {0x79, 0x01}, {0xad, 0x00}, {0x7d, 0x01}, {0x7b, 0x01},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0x05, 0x01}, {0xdb, 0x02}, {0x42, 0x01},
+       {0xb4, 0x00}, {0x3e, 0x01}, {0x5b, 0x01}, {0xc7, 0x02},
+       {0xb8, 0x00}, {0x61, 0x01}, {0x5f, 0x01}, {0x65, 0x01},
+       {0x7a, 0x01}, {0xdd, 0x02}, {0x7e, 0x01}, {0x7c, 0x01},
+       /* 0xc0*/
+       {0x54, 0x01}, {0xc1, 0x00}, {0xc2, 0x00}, {0x02, 0x01},
+       {0xc4, 0x00}, {0x39, 0x01}, {0x06, 0x01}, {0xc7, 0x00},
+       {0x0c, 0x01}, {0xc9, 0x00}, {0x18, 0x01}, {0xcb, 0x00},
+       {0x1a, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, {0x0e, 0x01},
+       /* 0xd0*/
+       {0x10, 0x01}, {0x43, 0x01}, {0x47, 0x01}, {0xd3, 0x00},
+       {0xd4, 0x00}, {0x50, 0x01}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0x58, 0x01}, {0x6e, 0x01}, {0xda, 0x00}, {0x70, 0x01},
+       {0xdc, 0x00}, {0xdd, 0x00}, {0x62, 0x01}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0x55, 0x01}, {0xe1, 0x00}, {0xe2, 0x00}, {0x03, 0x01},
+       {0xe4, 0x00}, {0x3a, 0x01}, {0x07, 0x01}, {0xe7, 0x00},
+       {0x0d, 0x01}, {0xe9, 0x00}, {0x19, 0x01}, {0xeb, 0x00},
+       {0x1b, 0x01}, {0xed, 0x00}, {0xee, 0x00}, {0x0f, 0x01},
+       /* 0xf0*/
+       {0x11, 0x01}, {0x44, 0x01}, {0x48, 0x01}, {0xf3, 0x00},
+       {0xf4, 0x00}, {0x51, 0x01}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0x59, 0x01}, {0x6f, 0x01}, {0xfa, 0x00}, {0x71, 0x01},
+       {0xfc, 0x00}, {0xfd, 0x00}, {0x63, 0x01}, {0xd9, 0x02},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
+       0xb0, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0x00, 0xc7, /* 0xc0-0xc7 */
+       0x00, 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0xce, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0x00, 0x00, 0xda, 0x00, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */
+       0x00, 0xe1, 0xe2, 0x00, 0xe4, 0x00, 0x00, 0xe7, /* 0xe0-0xe7 */
+       0x00, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0xee, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0xfa, 0x00, 0xfc, 0xfd, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0xc3, 0xe3, 0xa1, 0xb1, 0xc6, 0xe6, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0xcf, 0xef, /* 0x08-0x0f */
+       0xd0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xca, 0xea, 0xcc, 0xec, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0xc5, 0xe5, 0x00, 0x00, 0xa5, 0xb5, 0x00, /* 0x38-0x3f */
+       0x00, 0xa3, 0xb3, 0xd1, 0xf1, 0x00, 0x00, 0xd2, /* 0x40-0x47 */
+       0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xd5, 0xf5, 0x00, 0x00, 0xc0, 0xe0, 0x00, 0x00, /* 0x50-0x57 */
+       0xd8, 0xf8, 0xa6, 0xb6, 0x00, 0x00, 0xaa, 0xba, /* 0x58-0x5f */
+       0xa9, 0xb9, 0xde, 0xfe, 0xab, 0xbb, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd9, 0xf9, /* 0x68-0x6f */
+       0xdb, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0xac, 0xbc, 0xaf, 0xbf, 0xae, 0xbe, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page02[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0xa2, 0xff, 0x00, 0xb2, 0x00, 0xbd, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, page02, NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0x00, 0xb2, 0x00, 0xb4, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-2",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_2(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_2();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls_iso8859_3.c b/fs/nls_iso8859_3.c
new file mode 100644 (file)
index 0000000..d5d7f7f
--- /dev/null
@@ -0,0 +1,299 @@
+/*
+ * linux/fs/nls_iso8859-3.c
+ *
+ * Charset iso8859-3 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x26, 0x01}, {0xd8, 0x02}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0x00, 0x00}, {0x24, 0x01}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0x30, 0x01}, {0x5e, 0x01}, {0x1e, 0x01},
+       {0x34, 0x01}, {0xad, 0x00}, {0x00, 0x00}, {0x7b, 0x01},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0x27, 0x01}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0xb4, 0x00}, {0xb5, 0x00}, {0x25, 0x01}, {0xb7, 0x00},
+       {0xb8, 0x00}, {0x31, 0x01}, {0x5f, 0x01}, {0x1f, 0x01},
+       {0x35, 0x01}, {0xbd, 0x00}, {0x00, 0x00}, {0x7c, 0x01},
+       /* 0xc0*/
+       {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0x00, 0x00},
+       {0xc4, 0x00}, {0x0a, 0x01}, {0x08, 0x01}, {0xc7, 0x00},
+       {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00},
+       /* 0xd0*/
+       {0x00, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00},
+       {0xd4, 0x00}, {0x20, 0x01}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0x1c, 0x01}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00},
+       {0xdc, 0x00}, {0x6c, 0x01}, {0x5c, 0x01}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0x00, 0x00},
+       {0xe4, 0x00}, {0x0b, 0x01}, {0x09, 0x01}, {0xe7, 0x00},
+       {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00},
+       {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00},
+       /* 0xf0*/
+       {0x00, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00},
+       {0xf4, 0x00}, {0x21, 0x01}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0x1d, 0x01}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00},
+       {0xfc, 0x00}, {0x6d, 0x01}, {0x5d, 0x01}, {0xd9, 0x02},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xa0, 0x00, 0x00, 0xa3, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
+       0xb0, 0x00, 0xb2, 0xb3, 0xb4, 0xb5, 0x00, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0x00, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0x00, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0x00, 0x00, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0xc6, 0xe6, 0xc5, 0xe5, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0xd8, 0xf8, 0xab, 0xbb, /* 0x18-0x1f */
+       0xd5, 0xf5, 0x00, 0x00, 0xa6, 0xb6, 0xa1, 0xb1, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0xa9, 0xb9, 0x00, 0x00, 0xac, 0xbc, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0xde, 0xfe, 0xaa, 0xba, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0xdd, 0xfd, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0xaf, 0xbf, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page02[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0xa2, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, page02, NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0x00, 0xb2, 0xb3, 0xb4, 0xb5, 0x00, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xbe, 0x00, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-3",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_3(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_3();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls_iso8859_4.c b/fs/nls_iso8859_4.c
new file mode 100644 (file)
index 0000000..f03aaaa
--- /dev/null
@@ -0,0 +1,299 @@
+/*
+ * linux/fs/nls_iso8859-4.c
+ *
+ * Charset iso8859-4 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x04, 0x01}, {0x38, 0x01}, {0x56, 0x01},
+       {0xa4, 0x00}, {0x28, 0x01}, {0x3b, 0x01}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0x60, 0x01}, {0x12, 0x01}, {0x22, 0x01},
+       {0x66, 0x01}, {0xad, 0x00}, {0x7d, 0x01}, {0xaf, 0x00},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0x05, 0x01}, {0xdb, 0x02}, {0x57, 0x01},
+       {0xb4, 0x00}, {0x29, 0x01}, {0x3c, 0x01}, {0xc7, 0x02},
+       {0xb8, 0x00}, {0x61, 0x01}, {0x13, 0x01}, {0x23, 0x01},
+       {0x67, 0x01}, {0x4a, 0x01}, {0x7e, 0x01}, {0x4b, 0x01},
+       /* 0xc0*/
+       {0x00, 0x01}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00},
+       {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0x2e, 0x01},
+       {0x0c, 0x01}, {0xc9, 0x00}, {0x18, 0x01}, {0xcb, 0x00},
+       {0x16, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, {0x2a, 0x01},
+       /* 0xd0*/
+       {0x10, 0x01}, {0x45, 0x01}, {0x4c, 0x01}, {0x36, 0x01},
+       {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0xd8, 0x00}, {0x72, 0x01}, {0xda, 0x00}, {0xdb, 0x00},
+       {0xdc, 0x00}, {0x68, 0x01}, {0x6a, 0x01}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0x01, 0x01}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00},
+       {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0x2f, 0x01},
+       {0x0d, 0x01}, {0xe9, 0x00}, {0x19, 0x01}, {0xeb, 0x00},
+       {0x17, 0x01}, {0xed, 0x00}, {0xee, 0x00}, {0x2b, 0x01},
+       /* 0xf0*/
+       {0x11, 0x01}, {0x46, 0x01}, {0x4d, 0x01}, {0x37, 0x01},
+       {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0xf8, 0x00}, {0x73, 0x01}, {0xfa, 0x00}, {0xfb, 0x00},
+       {0xfc, 0x00}, {0x69, 0x01}, {0x6b, 0x01}, {0xd9, 0x02},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0x00, /* 0xc0-0xc7 */
+       0x00, 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0xce, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0x00, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */
+       0x00, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0x00, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0xee, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0x00, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0xc0, 0xe0, 0x00, 0x00, 0xa1, 0xb1, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0x00, 0x00, /* 0x08-0x0f */
+       0xd0, 0xf0, 0xaa, 0xba, 0x00, 0x00, 0xcc, 0xec, /* 0x10-0x17 */
+       0xca, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0xab, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0xa5, 0xb5, 0xcf, 0xef, 0x00, 0x00, 0xc7, 0xe7, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0xf3, /* 0x30-0x37 */
+       0xa2, 0x00, 0x00, 0xa6, 0xb6, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xf1, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0xbd, 0xbf, 0xd2, 0xf2, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0xb3, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0xa9, 0xb9, 0x00, 0x00, 0x00, 0x00, 0xac, 0xbc, /* 0x60-0x67 */
+       0xdd, 0xfd, 0xde, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0xd9, 0xf9, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0xbe, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page02[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0xff, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, page02, NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0x00, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0x00, 0xb2, 0x00, 0xb4, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-4",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_4(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_4();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls_iso8859_5.c b/fs/nls_iso8859_5.c
new file mode 100644 (file)
index 0000000..94bece0
--- /dev/null
@@ -0,0 +1,303 @@
+/*
+ * linux/fs/nls_iso8859-5.c
+ *
+ * Charset iso8859-5 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x01, 0x04}, {0x02, 0x04}, {0x03, 0x04},
+       {0x04, 0x04}, {0x05, 0x04}, {0x06, 0x04}, {0x07, 0x04},
+       {0x08, 0x04}, {0x09, 0x04}, {0x0a, 0x04}, {0x0b, 0x04},
+       {0x0c, 0x04}, {0xad, 0x00}, {0x0e, 0x04}, {0x0f, 0x04},
+       /* 0xb0*/
+       {0x10, 0x04}, {0x11, 0x04}, {0x12, 0x04}, {0x13, 0x04},
+       {0x14, 0x04}, {0x15, 0x04}, {0x16, 0x04}, {0x17, 0x04},
+       {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, {0x1b, 0x04},
+       {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, {0x1f, 0x04},
+       /* 0xc0*/
+       {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04},
+       {0x24, 0x04}, {0x25, 0x04}, {0x26, 0x04}, {0x27, 0x04},
+       {0x28, 0x04}, {0x29, 0x04}, {0x2a, 0x04}, {0x2b, 0x04},
+       {0x2c, 0x04}, {0x2d, 0x04}, {0x2e, 0x04}, {0x2f, 0x04},
+       /* 0xd0*/
+       {0x30, 0x04}, {0x31, 0x04}, {0x32, 0x04}, {0x33, 0x04},
+       {0x34, 0x04}, {0x35, 0x04}, {0x36, 0x04}, {0x37, 0x04},
+       {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, {0x3b, 0x04},
+       {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, {0x3f, 0x04},
+       /* 0xe0*/
+       {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04},
+       {0x44, 0x04}, {0x45, 0x04}, {0x46, 0x04}, {0x47, 0x04},
+       {0x48, 0x04}, {0x49, 0x04}, {0x4a, 0x04}, {0x4b, 0x04},
+       {0x4c, 0x04}, {0x4d, 0x04}, {0x4e, 0x04}, {0x4f, 0x04},
+       /* 0xf0*/
+       {0x16, 0x21}, {0x51, 0x04}, {0x52, 0x04}, {0x53, 0x04},
+       {0x54, 0x04}, {0x55, 0x04}, {0x56, 0x04}, {0x57, 0x04},
+       {0x58, 0x04}, {0x59, 0x04}, {0x5a, 0x04}, {0x5b, 0x04},
+       {0x5c, 0x04}, {0xa7, 0x00}, {0x5e, 0x04}, {0x5f, 0x04},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page04[256] = {
+       0x00, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x00-0x07 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0x00, 0xae, 0xaf, /* 0x08-0x0f */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x10-0x17 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0x18-0x1f */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0x38-0x3f */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
+       0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x50-0x57 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0xfe, 0xff, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page21[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   NULL,   page04, NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   page21, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-5",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_5(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_5();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls_iso8859_6.c b/fs/nls_iso8859_6.c
new file mode 100644 (file)
index 0000000..050aee9
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+ * linux/fs/nls_iso8859-6.c
+ *
+ * Charset iso8859-6 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x60, 0x06}, {0x61, 0x06}, {0x62, 0x06}, {0x63, 0x06},
+       {0x64, 0x06}, {0x65, 0x06}, {0x66, 0x06}, {0x67, 0x06},
+       {0x68, 0x06}, {0x69, 0x06}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0xa4, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x0c, 0x06}, {0xad, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xb0*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x1b, 0x06},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x1f, 0x06},
+       /* 0xc0*/
+       {0x00, 0x00}, {0x21, 0x06}, {0x22, 0x06}, {0x23, 0x06},
+       {0x24, 0x06}, {0x25, 0x06}, {0x26, 0x06}, {0x27, 0x06},
+       {0x28, 0x06}, {0x29, 0x06}, {0x2a, 0x06}, {0x2b, 0x06},
+       {0x2c, 0x06}, {0x2d, 0x06}, {0x2e, 0x06}, {0x2f, 0x06},
+       /* 0xd0*/
+       {0x30, 0x06}, {0x31, 0x06}, {0x32, 0x06}, {0x33, 0x06},
+       {0x34, 0x06}, {0x35, 0x06}, {0x36, 0x06}, {0x37, 0x06},
+       {0x38, 0x06}, {0x39, 0x06}, {0x3a, 0x06}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xe0*/
+       {0x40, 0x06}, {0x41, 0x06}, {0x42, 0x06}, {0x43, 0x06},
+       {0x44, 0x06}, {0x45, 0x06}, {0x46, 0x06}, {0x47, 0x06},
+       {0x48, 0x06}, {0x49, 0x06}, {0x4a, 0x06}, {0x4b, 0x06},
+       {0x4c, 0x06}, {0x4d, 0x06}, {0x4e, 0x06}, {0x4f, 0x06},
+       /* 0xf0*/
+       {0x50, 0x06}, {0x51, 0x06}, {0x52, 0x06}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page06[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbf, /* 0x18-0x1f */
+       0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */
+       0xd8, 0xd9, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
+       0xf0, 0xf1, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x60-0x67 */
+       0x38, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   NULL,   NULL,   NULL,   page06, NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-6",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_6(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_6();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls_iso8859_7.c b/fs/nls_iso8859_7.c
new file mode 100644 (file)
index 0000000..3790378
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ * linux/fs/nls_iso8859-7.c
+ *
+ * Charset iso8859-7 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0xbd, 0x02}, {0xbc, 0x02}, {0xa3, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0xa6, 0x00}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0xa9, 0x00}, {0x00, 0x00}, {0xab, 0x00},
+       {0xac, 0x00}, {0xad, 0x00}, {0x00, 0x00}, {0x15, 0x20},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0x84, 0x03}, {0x85, 0x03}, {0x86, 0x03}, {0xb7, 0x00},
+       {0x88, 0x03}, {0x89, 0x03}, {0x8a, 0x03}, {0xbb, 0x00},
+       {0x8c, 0x03}, {0xbd, 0x00}, {0x8e, 0x03}, {0x8f, 0x03},
+       /* 0xc0*/
+       {0x90, 0x03}, {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03},
+       {0x94, 0x03}, {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03},
+       {0x98, 0x03}, {0x99, 0x03}, {0x9a, 0x03}, {0x9b, 0x03},
+       {0x9c, 0x03}, {0x9d, 0x03}, {0x9e, 0x03}, {0x9f, 0x03},
+       /* 0xd0*/
+       {0xa0, 0x03}, {0xa1, 0x03}, {0x00, 0x00}, {0xa3, 0x03},
+       {0xa4, 0x03}, {0xa5, 0x03}, {0xa6, 0x03}, {0xa7, 0x03},
+       {0xa8, 0x03}, {0xa9, 0x03}, {0xaa, 0x03}, {0xab, 0x03},
+       {0xac, 0x03}, {0xad, 0x03}, {0xae, 0x03}, {0xaf, 0x03},
+       /* 0xe0*/
+       {0xb0, 0x03}, {0xb1, 0x03}, {0xb2, 0x03}, {0xb3, 0x03},
+       {0xb4, 0x03}, {0xb5, 0x03}, {0xb6, 0x03}, {0xb7, 0x03},
+       {0xb8, 0x03}, {0xb9, 0x03}, {0xba, 0x03}, {0xbb, 0x03},
+       {0xbc, 0x03}, {0xbd, 0x03}, {0xbe, 0x03}, {0xbf, 0x03},
+       /* 0xf0*/
+       {0xc0, 0x03}, {0xc1, 0x03}, {0xc2, 0x03}, {0xc3, 0x03},
+       {0xc4, 0x03}, {0xc5, 0x03}, {0xc6, 0x03}, {0xc7, 0x03},
+       {0xc8, 0x03}, {0xc9, 0x03}, {0xca, 0x03}, {0xcb, 0x03},
+       {0xcc, 0x03}, {0xcd, 0x03}, {0xce, 0x03}, {0x00, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xa0, 0x00, 0x00, 0xa3, 0x00, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0x00, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0xbb, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page02[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0xa2, 0xa1, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0xb5, 0xb6, 0x00, /* 0x80-0x87 */
+       0xb8, 0xb9, 0xba, 0x00, 0xbc, 0x00, 0xbe, 0xbf, /* 0x88-0x8f */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x90-0x97 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x98-0x9f */
+       0xd0, 0xd1, 0x00, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xa0-0xa7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xa8-0xaf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xb0-0xb7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xb8-0xbf */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xc0-0xc7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   page02, page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-7",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_7(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_7();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls_iso8859_8.c b/fs/nls_iso8859_8.c
new file mode 100644 (file)
index 0000000..b639b73
--- /dev/null
@@ -0,0 +1,303 @@
+/*
+ * linux/fs/nls_iso8859-8.c
+ *
+ * Charset iso8859-8 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x00, 0x00}, {0xa2, 0x00}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0xa9, 0x00}, {0xd7, 0x00}, {0xab, 0x00},
+       {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0x3e, 0x20},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00},
+       {0xb8, 0x00}, {0xb9, 0x00}, {0xf7, 0x00}, {0xbb, 0x00},
+       {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0x00, 0x00},
+       /* 0xc0*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xd0*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x17, 0x20},
+       /* 0xe0*/
+       {0xd0, 0x05}, {0xd1, 0x05}, {0xd2, 0x05}, {0xd3, 0x05},
+       {0xd4, 0x05}, {0xd5, 0x05}, {0xd6, 0x05}, {0xd7, 0x05},
+       {0xd8, 0x05}, {0xd9, 0x05}, {0xda, 0x05}, {0xdb, 0x05},
+       {0xdc, 0x05}, {0xdd, 0x05}, {0xde, 0x05}, {0xdf, 0x05},
+       /* 0xf0*/
+       {0xe0, 0x05}, {0xe1, 0x05}, {0xe2, 0x05}, {0xe3, 0x05},
+       {0xe4, 0x05}, {0xe5, 0x05}, {0xe6, 0x05}, {0xe7, 0x05},
+       {0xe8, 0x05}, {0xe9, 0x05}, {0xea, 0x05}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xa0, 0x00, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0xae, 0x00, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0x00, 0xbb, 0xbc, 0xbd, 0xbe, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page05[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xd0-0xd7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xd8-0xdf */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xe0-0xe7 */
+       0xf8, 0xf9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page20[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   NULL,   NULL,   page05, NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-8",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_8(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_8();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls_iso8859_9.c b/fs/nls_iso8859_9.c
new file mode 100644 (file)
index 0000000..aef5b41
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+ * linux/fs/nls_iso8859-9.c
+ *
+ * Charset iso8859-9 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00},
+       {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00},
+       {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00},
+       {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00},
+       /* 0xc0*/
+       {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00},
+       {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00},
+       {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00},
+       /* 0xd0*/
+       {0x1e, 0x01}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00},
+       {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00},
+       {0xdc, 0x00}, {0x30, 0x01}, {0x5e, 0x01}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00},
+       {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00},
+       {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00},
+       {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00},
+       /* 0xf0*/
+       {0x1f, 0x01}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00},
+       {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00},
+       {0xfc, 0x00}, {0x31, 0x01}, {0x5f, 0x01}, {0xff, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xf0, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0xdd, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xfe, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, page01, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-9",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_9(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_9();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls_koi8_r.c b/fs/nls_koi8_r.c
new file mode 100644 (file)
index 0000000..8d08ba3
--- /dev/null
@@ -0,0 +1,375 @@
+/*
+ * linux/fs/nls_koi8-r.c
+ *
+ * Charset koi8-r translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x25}, {0x02, 0x25}, {0x0c, 0x25}, {0x10, 0x25},
+       {0x14, 0x25}, {0x18, 0x25}, {0x1c, 0x25}, {0x24, 0x25},
+       {0x2c, 0x25}, {0x34, 0x25}, {0x3c, 0x25}, {0x80, 0x25},
+       {0x84, 0x25}, {0x88, 0x25}, {0x8c, 0x25}, {0x90, 0x25},
+       /* 0x90*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x20, 0x23},
+       {0xa0, 0x25}, {0x19, 0x22}, {0x1a, 0x22}, {0x48, 0x22},
+       {0x64, 0x22}, {0x65, 0x22}, {0xa0, 0x00}, {0x21, 0x23},
+       {0xb0, 0x00}, {0xb2, 0x00}, {0xb7, 0x00}, {0xf7, 0x00},
+       /* 0xa0*/
+       {0x50, 0x25}, {0x51, 0x25}, {0x52, 0x25}, {0x51, 0x04},
+       {0x53, 0x25}, {0x54, 0x25}, {0x55, 0x25}, {0x56, 0x25},
+       {0x57, 0x25}, {0x58, 0x25}, {0x59, 0x25}, {0x5a, 0x25},
+       {0x5b, 0x25}, {0x5c, 0x25}, {0x5d, 0x25}, {0x5e, 0x25},
+       /* 0xb0*/
+       {0x5f, 0x25}, {0x60, 0x25}, {0x61, 0x25}, {0x01, 0x04},
+       {0x62, 0x25}, {0x63, 0x25}, {0x64, 0x25}, {0x65, 0x25},
+       {0x66, 0x25}, {0x67, 0x25}, {0x68, 0x25}, {0x69, 0x25},
+       {0x6a, 0x25}, {0x6b, 0x25}, {0x6c, 0x25}, {0xa9, 0x00},
+       /* 0xc0*/
+       {0x4e, 0x04}, {0x30, 0x04}, {0x31, 0x04}, {0x46, 0x04},
+       {0x34, 0x04}, {0x35, 0x04}, {0x44, 0x04}, {0x33, 0x04},
+       {0x45, 0x04}, {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04},
+       {0x3b, 0x04}, {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04},
+       /* 0xd0*/
+       {0x3f, 0x04}, {0x4f, 0x04}, {0x40, 0x04}, {0x41, 0x04},
+       {0x42, 0x04}, {0x43, 0x04}, {0x36, 0x04}, {0x32, 0x04},
+       {0x4c, 0x04}, {0x4b, 0x04}, {0x37, 0x04}, {0x48, 0x04},
+       {0x4d, 0x04}, {0x49, 0x04}, {0x47, 0x04}, {0x4a, 0x04},
+       /* 0xe0*/
+       {0x2e, 0x04}, {0x10, 0x04}, {0x11, 0x04}, {0x26, 0x04},
+       {0x14, 0x04}, {0x15, 0x04}, {0x24, 0x04}, {0x13, 0x04},
+       {0x25, 0x04}, {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04},
+       {0x1b, 0x04}, {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04},
+       /* 0xf0*/
+       {0x1f, 0x04}, {0x2f, 0x04}, {0x20, 0x04}, {0x21, 0x04},
+       {0x22, 0x04}, {0x23, 0x04}, {0x16, 0x04}, {0x12, 0x04},
+       {0x2c, 0x04}, {0x2b, 0x04}, {0x17, 0x04}, {0x28, 0x04},
+       {0x2d, 0x04}, {0x29, 0x04}, {0x27, 0x04}, {0x2a, 0x04},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x9c, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page04[256] = {
+       0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, /* 0x10-0x17 */
+       0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, /* 0x18-0x1f */
+       0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe, /* 0x20-0x27 */
+       0xfb, 0xfd, 0xff, 0xf9, 0xf8, 0xfc, 0xe0, 0xf1, /* 0x28-0x2f */
+       0xc1, 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, 0xd6, 0xda, /* 0x30-0x37 */
+       0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, /* 0x38-0x3f */
+       0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde, /* 0x40-0x47 */
+       0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1, /* 0x48-0x4f */
+       0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page22[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x95, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x98, 0x99, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page23[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x93, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page25[256] = {
+       0x80, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x85, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xa0, 0xa1, 0xa2, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, /* 0x50-0x57 */
+       0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, /* 0x58-0x5f */
+       0xb1, 0xb2, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, /* 0x60-0x67 */
+       0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
+
+       0x8b, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x8d, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       0x8f, 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   NULL,   page04, NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
+       0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "koi8-r",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_koi8_r(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_koi8_r();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
index 3778eeb48e54eac01333b55c69827869f6e03003..53d7f9d635b9f4c9abe1ecad408251a71087d00f 100644 (file)
@@ -107,21 +107,6 @@ strncasecmp(const char *s1, const char *s2, int len)
        return result;
 }
 
-static int
-compare_filename(const struct smb_server *server,
-                const char *s1, int len, struct smb_dirent *entry)
-{
-       if (len != entry->len)
-       {
-               return 1;
-       }
-       if (server->case_handling == CASE_DEFAULT)
-       {
-               return strncasecmp(s1, entry->name, len);
-       }
-       return strncmp(s1, entry->name, len);
-}
-
 struct smb_inode_info *
 smb_find_inode(struct smb_server *server, ino_t ino)
 {
@@ -507,9 +492,33 @@ smb_invalidate_all_inodes(struct smb_server *server)
        return;
 }
 
-/* We will search the inode that belongs to this name, currently by a
-   complete linear search through the inodes belonging to this
-   filesystem. This has to be fixed. */
+static int
+compare_filename(const struct smb_server *server,
+                const char *s1, int len, struct smb_dirent *entry)
+{
+       if (len != entry->len)
+       {
+#if 0
+               /* Check whether the entry is about to be removed */
+               if (!entry->len)
+                       printk("SMBFS: dead entry %s\n", entry->name);
+#endif
+               return 1;
+       }
+       if (server->case_handling == CASE_DEFAULT)
+       {
+               return strncasecmp(s1, entry->name, len);
+       }
+       return strncmp(s1, entry->name, len);
+}
+
+/*
+ * Search for the smb_inode_info that belongs to this name,
+ * currently by a complete linear search through the inodes
+ * belonging to this filesystem.
+ *
+ * Note that this returns files as well as directories.
+ */
 static struct smb_inode_info *
 smb_find_dir_inode(struct inode *parent, const char *name, int len)
 {
index 60956c16d1e86ea108ef023ff6f316c9f7125ccb..1cccb52b894b9c43b51ff18ab1fd507f8e5dff78 100644 (file)
@@ -95,7 +95,6 @@ smb_put_inode(struct inode *inode)
 {
        struct smb_server *server = SMB_SERVER(inode);
        struct smb_inode_info *info = SMB_INOP(inode);
-       struct smb_dirent *finfo;
        __u32 mtime = inode->i_mtime;
 
        if (inode->i_count > 1) {
@@ -107,6 +106,12 @@ smb_put_inode(struct inode *inode)
        if (S_ISDIR(inode->i_mode))
        {
                smb_invalid_dir_cache(inode->i_ino);
+       } else
+       {
+               /*
+                * Clear the length so the info structure can't be found.
+                */
+               info->finfo.len = 0;
        }
        clear_inode(inode);
 
@@ -116,13 +121,13 @@ smb_put_inode(struct inode *inode)
         */
        inode->i_count++;
        if (info) {
-               finfo = &info->finfo;
-               if (finfo->opened != 0)
+               if (info->finfo.opened != 0)
                {
-                       if (smb_proc_close(server, finfo->fileid, mtime))
+                       if (smb_proc_close(server, info->finfo.fileid, mtime))
                        {
                                /* We can't do anything but complain. */
-                               printk("smb_put_inode: could not close\n");
+                               printk("smb_put_inode: could not close %s\n",
+                                       info->finfo.name);
                        }
                }
                smb_free_inode_info(info);
index ed7358baa198249ce02cca5808223ba3655caef1..5e936d7ffc0428c83f44b4ade0eb21c7624fc272 100644 (file)
@@ -570,6 +570,8 @@ smb_proc_open(struct smb_server *server,
                        smb_unlock_server(server);
                        return error;
                }
+               /* N.B. Packet may change after request */
+               buf = server->packet;
                p = smb_setup_header(server, SMBopen, 2, 0);
                WSET(buf, smb_vwv0, 0x40);      /* read only */
                WSET(buf, smb_vwv1, o_attr);
@@ -589,6 +591,8 @@ smb_proc_open(struct smb_server *server,
        }
        /* We should now have data in vwv[0..6]. */
 
+       /* N.B. Packet may change after request */
+       buf = server->packet;
        entry->fileid = WVAL(buf, smb_vwv0);
        entry->attr = WVAL(buf, smb_vwv1);
        entry->f_ctime = entry->f_atime =
@@ -646,7 +650,7 @@ smb_proc_read(struct smb_server *server, struct smb_dirent *finfo,
                smb_unlock_server(server);
                return error;
        }
-       returned_count = WVAL(buf, smb_vwv0);
+       returned_count = WVAL(server->packet, smb_vwv0);
 
        smb_decode_data(SMB_BUF(server->packet), data, &data_len, fs);
 
@@ -682,7 +686,7 @@ smb_proc_write(struct smb_server *server, struct smb_dirent *finfo,
 
        if ((res = smb_request_ok(server, SMBwrite, 1, 0)) >= 0)
        {
-               res = WVAL(buf, smb_vwv0);
+               res = WVAL(server->packet, smb_vwv0);
        }
        smb_unlock_server(server);
 
@@ -718,7 +722,7 @@ smb_proc_create(struct inode *dir, const char *name, int len,
                smb_unlock_server(server);
                return error;
        }
-       fileid = WVAL(buf, smb_vwv0);
+       fileid = WVAL(server->packet, smb_vwv0);
        smb_unlock_server(server);
 
        smb_proc_close(server, fileid, CURRENT_TIME);
@@ -1345,6 +1349,10 @@ smb_proc_readdir(struct smb_server *server, struct inode *dir, int fpos,
                                              entry);
 }
 
+/*
+ * This version uses the core protocol to get the attribute info.
+ * It works OK with Win 3.11, 95 and NT 3.51, but NOT with NT 4 (bad mtime).
+ */
 static int
 smb_proc_getattr_core(struct inode *dir, const char *name, int len,
                      struct smb_dirent *entry)
@@ -1356,7 +1364,7 @@ smb_proc_getattr_core(struct inode *dir, const char *name, int len,
 
        smb_lock_server(server);
 
-       DDPRINTK("smb_proc_getattr: %s\n", name);
+       DDPRINTK("smb_proc_getattr_core: %s\n", name);
 
       retry:
        buf = server->packet;
@@ -1374,15 +1382,105 @@ smb_proc_getattr_core(struct inode *dir, const char *name, int len,
                smb_unlock_server(server);
                return result;
        }
+       /* N.B. Packet may change after request */
+       buf = server->packet;
        entry->attr = WVAL(buf, smb_vwv0);
        entry->f_ctime = entry->f_atime =
            entry->f_mtime = local2utc(DVAL(buf, smb_vwv1));
 
+       DDPRINTK("smb_proc_getattr_core: mtime=%ld\n", entry->f_mtime);
+
        entry->f_size = DVAL(buf, smb_vwv3);
        smb_unlock_server(server);
        return 0;
 }
 
+/*
+ * This version uses the trans2 findfirst to get the attribute info.
+ * It works fine with NT 3.51 and NT 4 (any SP), but not with Win95 (ERRerror).
+ */
+static int
+smb_proc_getattr_ff(struct inode *dir, const char *name, int len,
+                   struct smb_dirent *entry)
+{
+       unsigned char *resp_data = NULL;
+       unsigned char *resp_param = NULL;
+       int resp_data_len = 0;
+       int resp_param_len = 0;
+
+       char param[SMB_MAXPATHLEN + 1 + 12];
+       int mask_len;
+       unsigned char *mask = &(param[12]);
+
+       int result;
+       char *p;
+       struct smb_server *server = SMB_SERVER(dir);
+
+       mask_len = smb_encode_path(server, mask,
+                                  SMB_INOP(dir), name, len) - mask;
+
+       mask[mask_len] = 0;
+
+       DDPRINTK("smb_proc_getattr_ff: mask=%s\n", mask);
+
+       smb_lock_server(server);
+
+      retry:
+
+       WSET(param, 0, aSYSTEM | aHIDDEN | aDIR);
+       WSET(param, 2, 1);      /* max count */
+       WSET(param, 4, 2 + 1);  /* close on end + close after this call */
+       WSET(param, 6, 1);      /* info level */
+       DSET(param, 8, 0);
+
+       result = smb_trans2_request(server, TRANSACT2_FINDFIRST,
+                                   0, NULL, 12 + mask_len + 1, param,
+                                   &resp_data_len, &resp_data,
+                                   &resp_param_len, &resp_param);
+
+       if (result < 0)
+       {
+               if (smb_retry(server))
+               {
+                       DPRINTK("smb_proc_getattr_ff: error=%d, retrying\n",
+                                result);
+                       goto retry;
+               }
+               goto out;
+       }
+       if (server->rcls != 0)
+       {
+               result = -smb_errno(server->rcls, server->err);
+               if (result != -ENOENT)
+                       DPRINTK("smb_proc_getattr_ff: rcls=%d, err=%d\n",
+                                server->rcls, server->err);
+               goto out;
+       }
+       /* Make sure we got enough data ... */
+       result = -EINVAL;      /* WVAL(resp_param, 2) is ff_searchcount */
+       if (resp_data_len < 22 || WVAL(resp_param, 2) != 1)
+       {
+               DPRINTK("smb_proc_getattr_ff: bad result, len=%d, count=%d\n",
+                        resp_data_len, WVAL(resp_param, 2));
+               goto out;
+       }
+       /* Decode the response (info level 1, as in smb_decode_long_dirent) */
+       p = resp_data;
+       entry->f_ctime = date_dos2unix(WVAL(p, 2), WVAL(p, 0));
+       entry->f_atime = date_dos2unix(WVAL(p, 6), WVAL(p, 4));
+       entry->f_mtime = date_dos2unix(WVAL(p, 10), WVAL(p, 8));
+       entry->f_size = DVAL(p, 12);
+       entry->attr = WVAL(p, 20);
+
+       DDPRINTK("smb_proc_getattr_ff: attr=%x\n", entry->attr);
+
+       result = 0;
+
+out:
+       smb_unlock_server(server);
+       return result;
+}
+
 int
 smb_proc_getattr(struct inode *dir, const char *name, int len,
                 struct smb_dirent *entry)
@@ -1391,7 +1489,17 @@ smb_proc_getattr(struct inode *dir, const char *name, int len,
         int result;
 
        smb_init_dirent(server, entry);
-        result = smb_proc_getattr_core(dir, name, len, entry);
+       /* Use trans2 for NT, use core protocol for others (Win95/3.11/...).
+        * We distinguish NT from Win95 by looking at the capabilities,
+        * in the same way as in Samba 1.9.18p2's reply.c.
+        */
+       if ((server->protocol >= PROTOCOL_LANMAN2)
+           && (server->blkmode & (CAP_NT_SMBS | CAP_STATUS32)))
+               result = smb_proc_getattr_ff(dir, name, len, entry);
+       else
+               result = smb_proc_getattr_core(dir, name, len, entry);
+
        smb_finish_dirent(server, entry);
 
        entry->len = len;
@@ -1612,12 +1720,12 @@ smb_proc_reconnect(struct smb_server *server)
                word passlen = strlen(server->m.password);
                word userlen = strlen(server->m.username);
 
+#ifdef DEBUG_SMB_PASSWORD
                DPRINTK("smb_proc_connect: password = %s\n",
                        server->m.password);
+#endif                 
                DPRINTK("smb_proc_connect: usernam = %s\n",
                        server->m.username);
-               DPRINTK("smb_proc_connect: blkmode = %d\n",
-                       WVAL(server->packet, smb_vwv5));
 
                if (server->protocol >= PROTOCOL_NT1)
                {
@@ -1634,6 +1742,8 @@ smb_proc_reconnect(struct smb_server *server)
                        server->blkmode = WVAL(server->packet, smb_vwv5);
                        server->sesskey = DVAL(server->packet, smb_vwv6);
                }
+               DPRINTK("smb_proc_connect: blkmode (capabilities) = %x\n",
+                       server->blkmode);
 
                if (server->max_xmit < given_max_xmit)
                {
index 354757b9ac7e3696ddd92ca11b7a0a06d4bc8e7e..df903636f434c765c36a2954195c6e8e52e8740f 100644 (file)
@@ -8,8 +8,8 @@
 # Note 2! The CFLAGS definitions are now in the main makefile...
 
 O_TARGET := vfat.o
-O_OBJS   := 
-OX_OBJS  := namei.o
+O_OBJS   := namei.o
+OX_OBJS  := vfatfs_syms.o
 M_OBJS   := $(O_TARGET)
 
 include $(TOPDIR)/Rules.make
index 93bc04521479a94926abd3ce2469b06723a7528e..ba8556cc7d17b8eea6272f272db59a0e04c1a54b 100644 (file)
  *    the problem, send a script that demonstrates it.
  */
 
+#include <linux/config.h>
+#define __NO_VERSION__
 #include <linux/module.h>
 
 #include <linux/sched.h>
 #include <linux/msdos_fs.h>
+#include <linux/nls.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/stat.h>
 #include <linux/mm.h>
-
-#include <asm/segment.h>
+#include <linux/malloc.h>
 
 #include "../fat/msbuffer.h"
-#include "../fat/tables.h"
 
 #if 0
 # define PRINTK(x) printk x
@@ -83,6 +84,7 @@ static int parse_options(char *options,       struct fat_mount_options *opts)
 
        opts->unicode_xlate = opts->posixfs = 0;
        opts->numtail = 1;
+       opts->utf8 = 0;
 
        if (!options) return 1;
        save = 0;
@@ -94,7 +96,13 @@ static int parse_options(char *options,      struct fat_mount_options *opts)
                        savep = value;
                        *value++ = 0;
                }
-               if (!strcmp(this_char,"uni_xlate")) {
+               if (!strcmp(this_char,"utf8")) {
+                       if (value) {
+                               ret = 0;
+                       } else {
+                               opts->utf8 = 1;
+                       }
+               } else if (!strcmp(this_char,"uni_xlate")) {
                        if (value) {
                                ret = 0;
                        } else {
@@ -124,6 +132,9 @@ static int parse_options(char *options,     struct fat_mount_options *opts)
                        return 0;
                }
        }
+       if (opts->unicode_xlate) {
+               opts->utf8 = 0;
+       }
        return 1;
 }
 
@@ -134,6 +145,8 @@ struct super_block *vfat_read_super(struct super_block *sb,void *data,
   
        MOD_INC_USE_COUNT;
        
+       MSDOS_SB(sb)->options.isvfat = 1;
+
        sb->s_op = &vfat_sops;
        res = fat_read_super(sb, data, silent);
        if (res == NULL) {
@@ -145,7 +158,6 @@ struct super_block *vfat_read_super(struct super_block *sb,void *data,
        if (!parse_options((char *) data, &(MSDOS_SB(sb)->options))) {
                MOD_DEC_USE_COUNT;
        } else {
-               MSDOS_SB(sb)->options.isvfat = 1;
                MSDOS_SB(sb)->options.dotsOK = 0;
        }
 
@@ -220,7 +232,6 @@ static const char *reserved_names[] = {
 /* Characters that are undesirable in an MS-DOS file name */
 
 static char bad_chars[] = "*?<>|\":/\\";
-static char bad_if_strict[] = "+=,; []";
 static char replace_chars[] = "[];,+=";
 
 static int vfat_find(struct inode *dir,const char *name,int len,
@@ -260,8 +271,8 @@ static int vfat_valid_longname(const char *name, int len, int dot_dirs,
        return 0;
 }
 
-static int vfat_valid_shortname(char conv,const char *name,int len,
-                                int dot_dirs)
+static int vfat_valid_shortname(const char *name,int len,
+                               int dot_dirs, int utf8)
 {
        const char *walk, **reserved;
        unsigned char c;
@@ -278,17 +289,17 @@ static int vfat_valid_shortname(char conv,const char *name,int len,
        for (walk = name; len && walk-name < 8;) {
                c = *walk++;
                len--;
-               if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL;
-               if (conv == 'x' && strchr(replace_chars,c)) return -EINVAL;
-               if (conv == 's' && strchr(bad_if_strict,c)) return -EINVAL;
-               if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL;
+               if (utf8 && (c & 0x80)) return -EINVAL;
+               if (strchr(bad_chars,c)) return -EINVAL;
+               if (strchr(replace_chars,c)) return -EINVAL;
+               if (c >= 'A' && c <= 'Z') return -EINVAL;
                if (c < ' ' || c == ':' || c == '\\') return -EINVAL;
                if ((walk == name) && (c == 0xE5)) c = 0x05;
                if (c == '.') break;
                space = c == ' ';
        }
        if (space) return -EINVAL;
-       if ((conv == 's' || conv == 'x') && len && c != '.') {
+       if (len && c != '.') {
                c = *walk++;
                len--;
                if (c != '.') return -EINVAL;
@@ -299,18 +310,17 @@ static int vfat_valid_shortname(char conv,const char *name,int len,
                while (len > 0 && walk-name < (MSDOS_NAME+1)) {
                        c = *walk++;
                        len--;
-                       if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL;
-                       if (conv == 's' && strchr(bad_if_strict,c))
-                               return -EINVAL;
-                       if (conv == 'x' && strchr(replace_chars,c))
+                       if (utf8 && (c & 0x80)) return -EINVAL;
+                       if (strchr(bad_chars,c)) return -EINVAL;
+                       if (strchr(replace_chars,c))
                                return -EINVAL;
                        if (c < ' ' || c == ':' || c == '\\' || c == '.')
                                return -EINVAL;
-                       if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL;
+                       if (c >= 'A' && c <= 'Z') return -EINVAL;
                        space = c == ' ';
                }
                if (space) return -EINVAL;
-               if ((conv == 's' || conv == 'x') && len) return -EINVAL;
+               if (len) return -EINVAL;
        }
        for (reserved = reserved_names; *reserved; reserved++)
                if (!strncmp(name,*reserved,8)) return -EINVAL;
@@ -323,8 +333,8 @@ static int vfat_valid_shortname(char conv,const char *name,int len,
  * returned.  The formatted short filename is returned in 'res'.
  */
 
-static int vfat_format_name(char conv,const char *name,int len,char *res,
-  int dot_dirs)
+static int vfat_format_name(const char *name,int len,char *res,
+  int dot_dirs,int utf8)
 {
        char *walk;
        const char **reserved;
@@ -344,17 +354,17 @@ static int vfat_format_name(char conv,const char *name,int len,char *res,
        for (walk = res; len && walk-res < 8; walk++) {
                c = *name++;
                len--;
-               if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL;
-               if (conv == 's' && strchr(bad_if_strict,c)) return -EINVAL;
-               if (conv == 'x' && strchr(replace_chars,c)) return -EINVAL;
-               if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL;
+               if (utf8 && (c & 0x80)) return -EINVAL;
+               if (strchr(bad_chars,c)) return -EINVAL;
+               if (strchr(replace_chars,c)) return -EINVAL;
+               if (c >= 'A' && c <= 'Z') return -EINVAL;
                if (c < ' ' || c == ':' || c == '\\') return -EINVAL;
                if (c == '.') break;
                space = c == ' ';
                *walk = c >= 'a' && c <= 'z' ? c-32 : c;
        }
        if (space) return -EINVAL;
-       if ((conv == 's' || conv == 'x') && len && c != '.') {
+       if (len && c != '.') {
                c = *name++;
                len--;
                if (c != '.') return -EINVAL;
@@ -365,19 +375,18 @@ static int vfat_format_name(char conv,const char *name,int len,char *res,
                while (len > 0 && walk-res < MSDOS_NAME) {
                        c = *name++;
                        len--;
-                       if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL;
-                       if (conv == 's' && strchr(bad_if_strict,c))
-                               return -EINVAL;
-                       if (conv == 'x' && strchr(replace_chars,c))
+                       if (utf8 && (c & 0x80)) return -EINVAL;
+                       if (strchr(bad_chars,c)) return -EINVAL;
+                       if (strchr(replace_chars,c))
                                return -EINVAL;
                        if (c < ' ' || c == ':' || c == '\\' || c == '.')
                                return -EINVAL;
-                       if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL;
+                       if (c >= 'A' && c <= 'Z') return -EINVAL;
                        space = c == ' ';
                        *walk++ = c >= 'a' && c <= 'z' ? c-32 : c;
                }
                if (space) return -EINVAL;
-               if ((conv == 's' || conv == 'x') && len) return -EINVAL;
+               if (len) return -EINVAL;
        }
        while (walk-res < MSDOS_NAME) *walk++ = ' ';
        for (reserved = reserved_names; *reserved; reserved++)
@@ -392,7 +401,7 @@ static char skip_chars[] = ".:\"?<>| ";
  * shortname does not exist
  */
 static int vfat_create_shortname(struct inode *dir, const char *name,
-     int len, char *name_res)
+     int len, char *name_res, int utf8)
 {
        const char *ip, *ext_start, *end;
        char *p;
@@ -411,16 +420,25 @@ static int vfat_create_shortname(struct inode *dir, const char *name,
        if (len && name[len-1]==' ') return -EINVAL;
        if (len <= 12) {
                /* Do a case insensitive search if the name would be a valid
-                * shortname if is were all capitalized */
+                * shortname if is were all capitalized.  However, do not
+                * allow spaces in short names because Win95 scandisk does
+                * not like that */
+               res = 0;
                for (i = 0, p = msdos_name, ip = name; i < len; i++, p++, ip++)
                {
+                       if (*ip == ' ') {
+                               res = -EINVAL;
+                               break;
+                       }
                        if (*ip >= 'A' && *ip <= 'Z') {
                                *p = *ip + 32;
                        } else {
                                *p = *ip;
                        }
                }
-               res = vfat_format_name('x', msdos_name, len, name_res, 1);
+               if (res == 0) {
+                       res = vfat_format_name(msdos_name, len, name_res, 1, utf8);
+               }
                if (res > -1) {
                        PRINTK(("vfat_create_shortname 1\n"));
                        res = vfat_find(dir, msdos_name, len, 0, 0, 0, &sinfo);
@@ -468,7 +486,10 @@ static int vfat_create_shortname(struct inode *dir, const char *name,
 
        for (baselen = i = 0, p = base, ip = name; i < sz && baselen < 8; i++)
        {
-               if (!strchr(skip_chars, *ip)) {
+               if (utf8 && (*ip & 0x80)) {
+                       *p++ = '_';
+                       baselen++;
+               } else if (!strchr(skip_chars, *ip)) {
                        if (*ip >= 'A' && *ip <= 'Z') {
                                *p = *ip + 32;
                        } else {
@@ -488,7 +509,10 @@ static int vfat_create_shortname(struct inode *dir, const char *name,
        if (ext_start) {
                extlen = 0;
                for (p = ext, ip = ext_start; extlen < 3 && ip < end; ip++) {
-                       if (!strchr(skip_chars, *ip)) {
+                       if (utf8 && (*ip & 0x80)) {
+                               *p++ = '_';
+                               extlen++;
+                       } else if (!strchr(skip_chars, *ip)) {
                                if (*ip >= 'A' && *ip <= 'Z') {
                                        *p = *ip + 32;
                                } else {
@@ -535,7 +559,7 @@ static int vfat_create_shortname(struct inode *dir, const char *name,
                totlen = baselen + sz + 1 + extlen + (extlen > 0);
                res = vfat_find(dir, msdos_name, totlen, 0, 0, 0, &sinfo);
        }
-       res = vfat_format_name('x', msdos_name, totlen, name_res, 1);
+       res = vfat_format_name(msdos_name, totlen, name_res, 1, utf8);
        return res;
 }
 
@@ -584,7 +608,9 @@ static loff_t vfat_find_free_slots(struct inode *dir,int slots)
                        ino = fat_get_entry(dir,&curr,&bh,&de);
                }
 
-               if (dir->i_ino == MSDOS_ROOT_INO) return -ENOSPC;
+               if ((dir->i_ino == MSDOS_ROOT_INO) &&
+                   (MSDOS_SB(sb)->fat_bits != 32)) 
+                       return -ENOSPC;
                if ((res = fat_add_cluster(dir)) < 0) return res;
                ino = fat_get_entry(dir,&curr,&bh,&de);
        }
@@ -593,7 +619,8 @@ static loff_t vfat_find_free_slots(struct inode *dir,int slots)
 
 /* Translate a string, including coded sequences into Unicode */
 static int
-xlate_to_uni(const char *name, int len, char *outname, int *outlen, int escape)
+xlate_to_uni(const char *name, int len, char *outname, int *outlen,
+            int escape, int utf8, struct nls_table *nls)
 {
        int i;
        const unsigned char *ip;
@@ -601,22 +628,43 @@ xlate_to_uni(const char *name, int len, char *outname, int *outlen, int escape)
        int fill;
        unsigned char c1, c2, c3;
 
-       op = outname;
-       for (i = 0, ip = name, op = outname, *outlen = 0;
-            i < len && *outlen <= 260; i++, *outlen += 1)
-       {
-               if (escape && (i < len - 4) && 
-                   (*ip == ':') &&
-                   ((c1 = fat_code2uni[ip[1]]) != 255) &&
-                   ((c2 = fat_code2uni[ip[2]]) != 255) &&
-                   ((c3 = fat_code2uni[ip[3]]) != 255)) {
-                       *op++ = (c1 << 4) + (c2 >> 2);
-                       *op++ = ((c2 & 0x3) << 6) + c3;
-                       ip += 4;
+       if (utf8) {
+               *outlen = utf8_mbstowcs((__u16 *) outname, name, PAGE_SIZE);
+               if (name[len-1] == '.')
+                       *outlen-=2;
+               op = &outname[*outlen * sizeof(__u16)];
+       } else {
+               if (name[len-1] == '.') 
+                       len--;
+               op = outname;
+               if (nls) {
+                       /* XXX: i is incorrectly computed. */
+                       for (i = 0, ip = name, op = outname, *outlen = 0;
+                            i < len && *outlen <= 260; i++, *outlen += 1)
+                       {
+                               if (escape && (*ip == ':')) {
+                                       if (i > len - 4) return -EINVAL;
+                                       c1 = fat_esc2uni[ip[1]];
+                                       c2 = fat_esc2uni[ip[2]];
+                                       c3 = fat_esc2uni[ip[3]];
+                                       if (c1 == 255 || c2 == 255 || c3 == 255)
+                                               return -EINVAL;
+                                       *op++ = (c1 << 4) + (c2 >> 2);
+                                       *op++ = ((c2 & 0x3) << 6) + c3;
+                                       ip += 4;
+                               } else {
+                                       *op++ = nls->charset2uni[*ip].uni1;
+                                       *op++ = nls->charset2uni[*ip].uni2;
+                                       ip++;
+                               }
+                       }
                } else {
-                       *op++ = fat_a2uni[*ip].uni1;
-                       *op++ = fat_a2uni[*ip].uni2;
-                       ip++;
+                       for (i = 0, ip = name, op = outname, *outlen = 0;
+                            i < len && *outlen <= 260; i++, *outlen += 1)
+                       {
+                               *op++ = *ip++;
+                               *op++ = 0;
+                       }
                }
        }
        if (*outlen > 260)
@@ -641,7 +689,8 @@ xlate_to_uni(const char *name, int len, char *outname, int *outlen, int escape)
 
 static int
 vfat_fill_long_slots(struct msdos_dir_slot *ds, const char *name, int len,
-                    char *msdos_name, int *slots, int uni_xlate)
+                    char *msdos_name, int *slots,
+                    int uni_xlate, int utf8, struct nls_table *nls)
 {
        struct msdos_dir_slot *ps;
        struct msdos_dir_entry *de;
@@ -655,10 +704,11 @@ vfat_fill_long_slots(struct msdos_dir_slot *ds, const char *name, int len,
        int i;
        loff_t offset;
 
+       if (name[len-1] == '.') len--;
        if(!(page = __get_free_page(GFP_KERNEL)))
                return -ENOMEM;
        uniname = (char *) page;
-       res = xlate_to_uni(name, len, uniname, &unilen, uni_xlate);
+       res = xlate_to_uni(name, len, uniname, &unilen, uni_xlate, utf8, nls);
        if (res < 0) {
                free_page(page);
                return res;
@@ -678,8 +728,7 @@ vfat_fill_long_slots(struct msdos_dir_slot *ds, const char *name, int len,
                ps->attr = ATTR_EXT;
                ps->reserved = 0;
                ps->alias_checksum = cksum;
-               ps->start[0] = 0;
-               ps->start[1] = 0;
+               ps->start = 0;
                PRINTK(("vfat_fill_long_slots 5: uniname=%s\n",uniname));
                offset = (slot - 1) * 26;
                ip = &uniname[offset];
@@ -716,11 +765,14 @@ static int vfat_build_slots(struct inode *dir,const char *name,int len,
 {
        struct msdos_dir_entry *de;
        char msdos_name[MSDOS_NAME];
-       int res, xlate;
+       int res, xlate, utf8;
+       struct nls_table *nls;
 
        PRINTK(("Entering vfat_build_slots: name=%s, len=%d\n", name, len));
        de = (struct msdos_dir_entry *) ds;
        xlate = MSDOS_SB(dir->i_sb)->options.unicode_xlate;
+       utf8 = MSDOS_SB(dir->i_sb)->options.utf8;
+       nls = MSDOS_SB(dir->i_sb)->nls_io;
 
        *slots = 1;
        *is_long = 0;
@@ -730,13 +782,13 @@ static int vfat_build_slots(struct inode *dir,const char *name,int len,
                strncpy(de->name, MSDOS_DOT, MSDOS_NAME);
        } else {
                PRINTK(("vfat_build_slots 4\n"));
-               res = vfat_valid_shortname('x', name, len, 1);
+               res = vfat_valid_shortname(name, len, 1, utf8);
                if (res > -1) {
                        PRINTK(("vfat_build_slots 5a\n"));
-                       res = vfat_format_name('x', name, len, de->name, 1);
+                       res = vfat_format_name(name, len, de->name, 1, utf8);
                        PRINTK(("vfat_build_slots 5b\n"));
                } else {
-                       res = vfat_create_shortname(dir, name, len, msdos_name);
+                       res = vfat_create_shortname(dir, name, len, msdos_name, utf8);
                        if (res < 0) {
                                return res;
                        }
@@ -749,7 +801,7 @@ static int vfat_build_slots(struct inode *dir,const char *name,int len,
                        *is_long = 1;
 
                        return vfat_fill_long_slots(ds, name, len, msdos_name,
-                                                   slots, xlate);
+                                                   slots, xlate, utf8, nls);
                }
        }
        return 0;
@@ -775,8 +827,11 @@ static int vfat_readdir_cb(
                          vf->name, vf->len, name, name_len);
 #endif
 
+       /* Filenames cannot end in '.' or we treat like it has none */
        if (vf->len != name_len) {
-               return 0;
+               if ((vf->len != name_len + 1) || (vf->name[name_len] != '.')) {
+                       return 0;
+               }
        }
 
        s1 = name; s2 = vf->name;
@@ -809,12 +864,17 @@ static int vfat_find(struct inode *dir,const char *name,int len,
        struct msdos_dir_entry *de;
        struct msdos_dir_slot *ps;
        loff_t offset;
-       struct msdos_dir_slot ds[MSDOS_SLOTS];
+       struct msdos_dir_slot *ds;
        int is_long;
        int slots, slot;
        int res;
 
        PRINTK(("Entering vfat_find\n"));
+
+       ds = (struct msdos_dir_slot *)
+           kmalloc(sizeof(struct msdos_dir_slot)*MSDOS_SLOTS, GFP_KERNEL);
+       if (ds == NULL) return -ENOMEM;
+
        fil.f_pos = 0;
        vf.name = name;
        vf.len = len;
@@ -823,10 +883,11 @@ static int vfat_find(struct inode *dir,const char *name,int len,
        vf.posix = MSDOS_SB(sb)->options.posixfs;
        res = fat_readdirx(dir,&fil,(void *)&vf,vfat_readdir_cb,NULL,1,find_long,0);
        PRINTK(("vfat_find: Debug 1\n"));
-       if (res < 0) return res;
+       if (res < 0) goto cleanup;
        if (vf.found) {
                if (new_filename) {
-                       return -EEXIST;
+                       res = -EEXIST;
+                       goto cleanup;
                }
                sinfo_out->longname_offset = vf.offset;
                sinfo_out->shortname_offset = vf.short_offset;
@@ -836,15 +897,18 @@ static int vfat_find(struct inode *dir,const char *name,int len,
                sinfo_out->ino = vf.ino;
 
                PRINTK(("vfat_find: Debug 2\n"));
-               return 0;
+               res = 0;
+               goto cleanup;
        }
 
        PRINTK(("vfat_find: Debug 3\n"));
-       if (!vf.found && !new_filename)
-               return -ENOENT;
+       if (!vf.found && !new_filename) {
+               res = -ENOENT;
+               goto cleanup;
+       }
        
        res = vfat_build_slots(dir, name, len, ds, &slots, &is_long);
-       if (res < 0) return res;
+       if (res < 0) goto cleanup;
 
        de = (struct msdos_dir_entry *) ds;
 
@@ -854,7 +918,8 @@ static int vfat_find(struct inode *dir,const char *name,int len,
                if (is_long) slots++;
                offset = vfat_find_free_slots(dir, slots);
                if (offset < 0) {
-                       return offset;
+                       res = offset;
+                       goto cleanup;
                }
 
                PRINTK(("vfat_find: create file 2\n"));
@@ -865,7 +930,8 @@ static int vfat_find(struct inode *dir,const char *name,int len,
                        sinfo_out->ino = fat_get_entry(dir,&offset,&bh,&de);
                        if (sinfo_out->ino < 0) {
                                PRINTK(("vfat_find: problem\n"));
-                               return sinfo_out->ino;
+                               res = sinfo_out->ino;
+                               goto cleanup;
                        }
                        memcpy(de, ps, sizeof(struct msdos_dir_slot));
                        fat_mark_buffer_dirty(sb, bh, 1);
@@ -877,12 +943,12 @@ static int vfat_find(struct inode *dir,const char *name,int len,
 
                PRINTK(("vfat_find: create file 5\n"));
 
-               memset(de->unused, 0, sizeof(de->unused));
                fat_date_unix2dos(dir->i_mtime,&de->time,&de->date);
                de->ctime_ms = 0;
                de->ctime = de->time;
                de->adate = de->cdate = de->date;
                de->start = 0;
+               de->starthi = 0;
                de->size = 0;
                de->attr = is_dir ? ATTR_DIR : ATTR_ARCH;
                de->lcase = CASE_LOWER_BASE | CASE_LOWER_EXT;
@@ -900,10 +966,15 @@ static int vfat_find(struct inode *dir,const char *name,int len,
                sinfo_out->total_slots = slots;
                sinfo_out->shortname_offset = offset - sizeof(struct msdos_dir_slot);
                sinfo_out->longname_offset = offset - sizeof(struct msdos_dir_slot) * slots;
+               res = 0;
                return 0;
+       } else {
+               res = -ENOENT;
        }
 
-       return -ENOENT;
+cleanup:
+       kfree(ds);
+       return res;
 }
 
 int vfat_lookup(struct inode *dir,const char *name,int len,
@@ -1051,10 +1122,10 @@ static int vfat_create_a_dotdir(struct inode *dir,struct inode *parent,
        dir->i_atime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        dir->i_dirt = 1;
        memcpy(de->name,name,MSDOS_NAME);
-       memset(de->unused, 0, sizeof(de->unused));
        de->lcase = 0;
        de->attr = ATTR_DIR;
        de->start = 0;
+       de->starthi = 0;
        fat_date_unix2dos(dir->i_mtime,&de->time,&de->date);
        de->ctime_ms = 0;
        de->ctime = de->time;
@@ -1069,10 +1140,12 @@ static int vfat_create_a_dotdir(struct inode *dir,struct inode *parent,
        if (isdot) {
                dot->i_size = dir->i_size;
                MSDOS_I(dot)->i_start = MSDOS_I(dir)->i_start;
+               MSDOS_I(dot)->i_logstart = MSDOS_I(dir)->i_logstart;
                dot->i_nlink = dir->i_nlink;
        } else {
                dot->i_size = parent->i_size;
                MSDOS_I(dot)->i_start = MSDOS_I(parent)->i_start;
+               MSDOS_I(dot)->i_logstart = MSDOS_I(parent)->i_logstart;
                dot->i_nlink = parent->i_nlink;
        }
 
@@ -1261,10 +1334,8 @@ static int vfat_rmdirx(struct inode *dir,const char *name,int len)
                if (res > 0) {
                        res = 0;
                }
-       } else {
-               printk("Problem in vfat_rmdirx\n");
+               dir->i_version = ++event;
        }
-       dir->i_version = ++event;
 
 rmdir_done:
        fat_brelse(sb, bh);
@@ -1294,19 +1365,15 @@ static int vfat_unlinkx(
        struct slot_info sinfo;
 
        bh = NULL;
-       if ((res = vfat_find(dir,name,len,1,0,0,&sinfo)) < 0)
-               goto unlink_done;
+       res = vfat_find(dir,name,len,1,0,0,&sinfo);
 
        if (res >= 0 && sinfo.total_slots > 0) {
                res = vfat_remove_entry(dir,&sinfo,&bh,&de,0,nospc);
                if (res > 0) {
                        res = 0;
                }
-       } else {
-               printk("Problem in vfat_unlinkx: res=%d, total_slots=%d\n",res, sinfo.total_slots);
        }
 
-unlink_done:
        fat_brelse(sb, bh);
        return res;
 }
@@ -1350,7 +1417,16 @@ int vfat_unlink(struct inode *dir,const char *name,int len)
        return res;
 }
 
+/***** Unlink, as called for uvfatfs */
+int vfat_unlink_uvfat(struct inode *dir,const char *name,int len)
+{
+       int res;
 
+       res = vfat_unlinkx (dir,name,len,0);
+       iput(dir);
+       return res;
+}
 int vfat_rename(struct inode *old_dir,const char *old_name,int old_len,
        struct inode *new_dir,const char *new_name,int new_len,int must_be_dir)
 {
@@ -1469,6 +1545,7 @@ int vfat_rename(struct inode *old_dir,const char *old_name,int old_len,
        new_de->cdate = old_de->cdate;
        new_de->adate = old_de->adate;
        new_de->start = old_de->start;
+       new_de->starthi = old_de->starthi;
        new_de->size = old_de->size;
 
        if (!(new_inode = iget(new_dir->i_sb,new_ino))) goto rename_done;
@@ -1518,8 +1595,10 @@ int vfat_rename(struct inode *old_dir,const char *old_name,int old_len,
                        res = -EIO;
                        goto rename_done;
                }
-               dotdot_de->start = MSDOS_I(dotdot_inode)->i_start =
-                   MSDOS_I(new_dir)->i_start;
+               MSDOS_I(dotdot_inode)->i_start = MSDOS_I(new_dir)->i_start;
+               MSDOS_I(dotdot_inode)->i_logstart = MSDOS_I(new_dir)->i_logstart;
+               dotdot_de->start = CT_LE_W(MSDOS_I(new_dir)->i_logstart);
+               dotdot_de->starthi = CT_LE_W((MSDOS_I(new_dir)->i_logstart) >> 16);
                dotdot_inode->i_dirt = 1;
                fat_mark_buffer_dirty(sb, dotdot_bh, 1);
                old_dir->i_nlink--;
@@ -1575,36 +1654,6 @@ void vfat_read_inode(struct inode *inode)
        fat_read_inode(inode, &vfat_dir_inode_operations);
 }
 
-
-
-
-static struct file_system_type vfat_fs_type = {
-       vfat_read_super, "vfat", 1, NULL
-};
-
-static struct symbol_table vfat_syms = {
-#include <linux/symtab_begin.h>
-       X(vfat_create),
-       X(vfat_unlink),
-       X(vfat_mkdir),
-       X(vfat_rmdir),
-       X(vfat_rename),
-       X(vfat_put_super),
-       X(vfat_read_super),
-       X(vfat_read_inode),
-       X(vfat_lookup),
-#include <linux/symtab_end.h>
-};                                           
-
-int init_vfat_fs(void)
-{
-       int status;
-
-       if ((status = register_filesystem(&vfat_fs_type)) == 0)
-               status = register_symtab(&vfat_syms);
-       return status;
-}
-
 #ifdef MODULE
 int init_module(void)
 {
diff --git a/fs/vfat/vfatfs_syms.c b/fs/vfat/vfatfs_syms.c
new file mode 100644 (file)
index 0000000..e5f48af
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * linux/fs/msdos/vfatfs_syms.c
+ *
+ * Exported kernel symbols for the VFAT filesystem.
+ * These symbols are used by dmsdos.
+ */
+
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
+#include <linux/module.h>
+
+#include <linux/mm.h>
+#include <linux/msdos_fs.h>
+
+struct file_system_type vfat_fs_type = {
+       vfat_read_super, "vfat", 1, NULL
+};
+
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+#define X(sym) EXPORT_SYMBOL(sym);
+#define X_PUNCT ;
+#else
+#define X_PUNCT ,
+static struct symbol_table vfat_syms = {
+#include <linux/symtab_begin.h>
+#endif
+X(vfat_create) X_PUNCT
+X(vfat_unlink) X_PUNCT
+X(vfat_unlink_uvfat) X_PUNCT
+X(vfat_mkdir) X_PUNCT
+X(vfat_rmdir) X_PUNCT
+X(vfat_rename) X_PUNCT
+X(vfat_put_super) X_PUNCT
+X(vfat_read_super) X_PUNCT
+X(vfat_read_inode) X_PUNCT
+X(vfat_lookup) X_PUNCT
+#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,0)
+#include <linux/symtab_end.h>
+};                                           
+#endif
+
+int init_vfat_fs(void)
+{
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+       return register_filesystem(&vfat_fs_type);
+#else
+       int status;
+
+       if ((status = register_filesystem(&vfat_fs_type)) == 0)
+               status = register_symtab(&vfat_syms);
+       return status;
+#endif
+}
+
index 03239cfc3ceb7828bf2a12cdf9f95dbfca65451f..483ead22d015222a30e7dd143a34b92f79dec704 100644 (file)
@@ -19,6 +19,7 @@ struct iso_volume_descriptor {
 
 /* volume descriptor types */
 #define ISO_VD_PRIMARY 1
+#define ISO_VD_SUPPLEMENTARY 2
 #define ISO_VD_END 255
 
 #define ISO_STANDARD_ID "CD001"
@@ -59,6 +60,43 @@ struct iso_primary_descriptor {
        char unused5                    [ISODCL (1396, 2048)];
 };
 
+/* Almost the same as the primary descriptor but two fields are specified */
+struct iso_supplementary_descriptor {
+       char type                       [ISODCL (  1,   1)]; /* 711 */
+       char id                         [ISODCL (  2,   6)];
+       char version                    [ISODCL (  7,   7)]; /* 711 */
+       char flags                      [ISODCL (  8,   8)]; /* 853 */
+       char system_id                  [ISODCL (  9,  40)]; /* achars */
+       char volume_id                  [ISODCL ( 41,  72)]; /* dchars */
+       char unused2                    [ISODCL ( 73,  80)];
+       char volume_space_size          [ISODCL ( 81,  88)]; /* 733 */
+       char escape                     [ISODCL ( 89, 120)]; /* 856 */
+       char volume_set_size            [ISODCL (121, 124)]; /* 723 */
+       char volume_sequence_number     [ISODCL (125, 128)]; /* 723 */
+       char logical_block_size         [ISODCL (129, 132)]; /* 723 */
+       char path_table_size            [ISODCL (133, 140)]; /* 733 */
+       char type_l_path_table          [ISODCL (141, 144)]; /* 731 */
+       char opt_type_l_path_table      [ISODCL (145, 148)]; /* 731 */
+       char type_m_path_table          [ISODCL (149, 152)]; /* 732 */
+       char opt_type_m_path_table      [ISODCL (153, 156)]; /* 732 */
+       char root_directory_record      [ISODCL (157, 190)]; /* 9.1 */
+       char volume_set_id              [ISODCL (191, 318)]; /* dchars */
+       char publisher_id               [ISODCL (319, 446)]; /* achars */
+       char preparer_id                [ISODCL (447, 574)]; /* achars */
+       char application_id             [ISODCL (575, 702)]; /* achars */
+       char copyright_file_id          [ISODCL (703, 739)]; /* 7.5 dchars */
+       char abstract_file_id           [ISODCL (740, 776)]; /* 7.5 dchars */
+       char bibliographic_file_id      [ISODCL (777, 813)]; /* 7.5 dchars */
+       char creation_date              [ISODCL (814, 830)]; /* 8.4.26.1 */
+       char modification_date          [ISODCL (831, 847)]; /* 8.4.26.1 */
+       char expiration_date            [ISODCL (848, 864)]; /* 8.4.26.1 */
+       char effective_date             [ISODCL (865, 881)]; /* 8.4.26.1 */
+       char file_structure_version     [ISODCL (882, 882)]; /* 711 */
+       char unused4                    [ISODCL (883, 883)];
+       char application_data           [ISODCL (884, 1395)];
+       char unused5                    [ISODCL (1396, 2048)];
+};
+
 
 #define HS_STANDARD_ID "CDROM"
 
@@ -142,11 +180,13 @@ extern int isonum_733(char *);
 extern int iso_date(char *, int);
 
 extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *);
-extern int get_rock_ridge_filename(struct iso_directory_record *, char ** name, int * len, struct inode *);
+extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *);
 
 extern char * get_rock_ridge_symlink(struct inode *);
 extern int find_rock_ridge_relocation(struct iso_directory_record *, struct inode *);
 
+int get_joliet_filename(struct iso_directory_record *, struct inode *, unsigned char *);
+
 /* The stuff that follows may be totally unneeded. I have not checked to see 
  which prototypes we are still using.  */
 
index d8065500ffe1a7d03b81ccadfe5997817fb3b07f..3f808d2e3bb51d59f16b665a88c757b35225fb5b 100644 (file)
@@ -1,13 +1,22 @@
 #ifndef _ISO_FS_I
 #define _ISO_FS_I
 
+struct extent_str
+{
+       struct extent_str *next;
+       unsigned int extent[2];
+       unsigned int extent_size[2];
+};
+
 /*
  * iso fs inode data in memory
  */
 struct iso_inode_info {
-       unsigned int i_first_extent;
+       struct extent_str *i_first_extent;
        unsigned int i_backlink;
        unsigned char i_file_format;
+       unsigned long i_next_section_ino;
+       off_t i_section_size;
 };
 
 #endif
index 25ebdb8ab447d63d9267921af08d29f82666fc27..35bd29203c9ade1723dfdb5d98a417378f948c3e 100644 (file)
@@ -5,26 +5,29 @@
  * iso9660 super-block data in memory
  */
 struct isofs_sb_info {
-                       unsigned long s_ninodes;
-                       unsigned long s_nzones;
-                       unsigned long s_firstdatazone;
-                       unsigned long s_log_zone_size;
-                       unsigned long s_max_size;
-
-                       unsigned char s_high_sierra; /* A simple flag */
-                       unsigned char s_mapping;
-                       unsigned char s_conversion;
-                       unsigned char s_rock;
-                       unsigned char s_name_check; /* r = relaxed, s = strict */
-                       unsigned char s_cruft; /* Broken disks with high
-                                                 byte of length containing
-                                                 junk */
-                       unsigned char s_unhide;
-                       unsigned char s_nosuid;
-                       unsigned char s_nodev;
-                       mode_t s_mode;
-                       gid_t s_gid;
-                       uid_t s_uid;
+       unsigned long s_ninodes;
+       unsigned long s_nzones;
+       unsigned long s_firstdatazone;
+       unsigned long s_log_zone_size;
+       unsigned long s_max_size;
+       
+       unsigned char s_high_sierra; /* A simple flag */
+       unsigned char s_mapping;
+       unsigned char s_conversion;
+       unsigned char s_rock;
+       unsigned char s_joliet_level;
+       unsigned char s_utf8;
+       unsigned char s_name_check; /* r = relaxed, s = strict */
+       unsigned char s_cruft; /* Broken disks with high
+                                 byte of length containing
+                                 junk */
+       unsigned char s_unhide;
+       unsigned char s_nosuid;
+       unsigned char s_nodev;
+       mode_t s_mode;
+       gid_t s_gid;
+       uid_t s_uid;
+       struct nls_table *s_nls_iocharset; /* Native language support table */
 };
 
 #endif
index c442b1138949f7b1aa11f0748f92c712e9b9ea3b..b4b92afed2dc2e06cf7baa38a43316d95e164699 100644 (file)
@@ -109,6 +109,7 @@ int Using_Versions; /* gcc will handle this global (used as a flag) correctly */
 
 /* insert new symbol table */
 extern int register_symtab_from(struct symbol_table *, long *);
+extern void *get_module_symbol(char *, char *);
 #ifdef MODULE
 #define register_symtab(symtab) register_symtab_from(symtab, &mod_use_count_)
 #else
diff --git a/include/linux/modversions.h b/include/linux/modversions.h
new file mode 100644 (file)
index 0000000..1103f93
--- /dev/null
@@ -0,0 +1,30 @@
+#ifdef MODVERSIONS
+#undef  CONFIG_MODVERSIONS
+#define CONFIG_MODVERSIONS
+#ifndef _set_ver
+#define _set_ver(sym,vers) sym ## _R ## vers
+#endif
+#include <linux/modules/b1capi.ver>
+#include <linux/modules/b1pci.ver>
+#include <linux/modules/capidrv.ver>
+#include <linux/modules/capiutil.ver>
+#include <linux/modules/fatfs_syms.ver>
+#include <linux/modules/firewall.ver>
+#include <linux/modules/isdn_syms.ver>
+#include <linux/modules/ksyms.ver>
+#include <linux/modules/md.ver>
+#include <linux/modules/misc.ver>
+#include <linux/modules/msdosfs_syms.ver>
+#include <linux/modules/netsyms.ver>
+#include <linux/modules/nls.ver>
+#include <linux/modules/p8022.ver>
+#include <linux/modules/p8022tr.ver>
+#include <linux/modules/ppp.ver>
+#include <linux/modules/procfs_syms.ver>
+#include <linux/modules/psnap.ver>
+#include <linux/modules/scsi_syms.ver>
+#include <linux/modules/serial.ver>
+#include <linux/modules/slhc.ver>
+#include <linux/modules/vfatfs_syms.ver>
+#undef  CONFIG_MODVERSIONS
+#endif
index 63a630472e966cb90dd6c13eb349021d63134f75..33d11fcf15316f3cdb9620c69ad419ffe3f4f05b 100644 (file)
@@ -7,6 +7,8 @@
 #include <linux/fs.h>
 #include <linux/stat.h>
 #include <linux/fd.h>
+#include <linux/config.h>
+#include <asm/byteorder.h>
 
 #define MSDOS_ROOT_INO  1 /* == MINIX_ROOT_INO */
 #define SECTOR_SIZE     512 /* sector size (bytes) */
 
 #define MSDOS_FAT12 4078 /* maximum number of clusters in a 12 bit FAT */
 
+#define EOF_FAT12 0xFF8                /* standard EOF */
+#define EOF_FAT16 0xFFF8
+#define EOF_FAT32 0xFFFFFF8
+
 /*
  * Inode flags
  */
@@ -77,8 +83,8 @@
 /*
  * ioctl commands
  */
-#define        VFAT_IOCTL_READDIR_BOTH         _IOR('r', 1, long)
-#define        VFAT_IOCTL_READDIR_SHORT        _IOW('r', 2, long)
+#define        VFAT_IOCTL_READDIR_BOTH         _IOR('r', 1, struct dirent [2])
+#define        VFAT_IOCTL_READDIR_SHORT        _IOR('r', 2, struct dirent [2])
 
 /*
  * Conversion from and to little-endian byte order. (no-op on i386/i486)
@@ -93,7 +99,7 @@
 #define CT_LE_L(v) (v)
 
 
-struct msdos_boot_sector {
+struct fat_boot_sector {
        __s8    ignored[3];     /* Boot strap short or near jump */
        __s8    system_id[8];   /* Name - can be used to special case
                                   partition manager volumes */
@@ -109,6 +115,24 @@ struct msdos_boot_sector {
        __u16   heads;          /* number of heads */
        __u32   hidden;         /* hidden sectors (unused) */
        __u32   total_sect;     /* number of sectors (if sectors == 0) */
+
+       /* The following fields are only used by FAT32 */
+       __u32   fat32_length;   /* sectors/FAT */
+       __u16   flags;          /* bit 8: fat mirroring, low 4: active fat */
+       __u8    version[2];     /* major, minor filesystem version */
+       __u32   root_cluster;   /* first cluster in root directory */
+       __u16   info_sector;    /* filesystem info sector */
+       __u16   backup_boot;    /* backup boot sector */
+       __u16   reserved2[6];   /* Unused */
+};
+
+struct fat_boot_fsinfo {
+       __u32   reserved1;      /* Nothing as far as I can tell */
+       __u32   signature;      /* 0x61417272L */
+       __u32   free_clusters;  /* Free cluster count.  -1 if unknown */
+       __u32   next_cluster;   /* Most recently allocated cluster.
+                                * Unused under Linux. */
+       __u32   reserved2[4];
 };
 
 struct msdos_dir_entry {
@@ -119,7 +143,7 @@ struct msdos_dir_entry {
        __u16   ctime;          /* Creation time */
        __u16   cdate;          /* Creation date */
        __u16   adate;          /* Last access date */
-       __u8    unused[2];
+       __u16   starthi;        /* High 16 bits of cluster in FAT32 */
        __u16   time,date,start;/* time, date and first cluster */
        __u32   size;           /* file size (in bytes) */
 };
@@ -132,7 +156,7 @@ struct msdos_dir_slot {
        __u8    reserved;       /* always 0 */
        __u8    alias_checksum; /* checksum for 8.3 alias */
        __u8    name5_10[12];   /* 6 more characters in name */
-       __u8    start[2];       /* starting cluster number */
+       __u16   start;          /* starting cluster number, 0 in long slots */
        __u8    name11_12[4];   /* last 2 characters in name */
 };
 
@@ -185,6 +209,7 @@ extern int fat_scan(struct inode *dir,const char *name,struct buffer_head **res_
                    struct msdos_dir_entry **res_de,int *ino,char scantype);
 extern int fat_parent_ino(struct inode *dir,int locked);
 extern int fat_subdirs(struct inode *dir);
+void fat_clusters_flush(struct super_block *sb);
 
 /* fat.c */
 extern int fat_access(struct super_block *sb,int nr,int new_value);
@@ -254,13 +279,32 @@ extern int msdos_rename(struct inode *old_dir,const char *old_name,int old_len,
                        struct inode *new_dir,const char *new_name,int new_len,
                        int must_be_dir);
 
+/* nls.c */
+extern int init_fat_nls(void);
+extern struct fat_nls_table *fat_load_nls(int codepage);
+
+/* tables.c */
+extern unsigned char fat_uni2esc[];
+extern unsigned char fat_esc2uni[];
+
 /* fatfs_syms.c */
 extern int init_fat_fs(void);
+extern void cleanup_fat_fs(void);
+
+/* nls.c */
+extern int fat_register_nls(struct fat_nls_table * fmt);
+extern int fat_unregister_nls(struct fat_nls_table * fmt);
+extern struct fat_nls_table *fat_find_nls(int codepage);
+extern struct fat_nls_table *fat_load_nls(int codepage);
+extern void fat_unload_nls(int codepage);
+extern int init_fat_nls(void);
+
 
 /* vfat/namei.c - these are for dmsdos */
 extern int vfat_create(struct inode *dir,const char *name,int len,int mode,
                       struct inode **result);
 extern int vfat_unlink(struct inode *dir,const char *name,int len);
+extern int vfat_unlink_uvfat(struct inode *dir,const char *name,int len);
 extern int vfat_mkdir(struct inode *dir,const char *name,int len,int mode);
 extern int vfat_rmdir(struct inode *dir,const char *name,int len);
 extern int vfat_rename(struct inode *old_dir,const char *old_name,int old_len,
@@ -273,6 +317,10 @@ extern void vfat_read_inode(struct inode *inode);
 extern int vfat_lookup(struct inode *dir,const char *name,int len,
                       struct inode **result);
 
+/* vfat/vfatfs_syms.c */
+extern struct file_system_type vfat_fs_type;
+
+
 #endif /* __KERNEL__ */
 
 #endif
index cc9d9ac85ebe4f0815c6f9043f46851c4ee9e582..530930e539d16e8d7e289bd75770e929eac17a8f 100644 (file)
@@ -26,6 +26,7 @@ struct msdos_inode_info {
        */
        struct pipe_inode_info reserved;
        int i_start;    /* first cluster or 0 */
+       int i_logstart; /* logical first cluster */
        int i_attrs;    /* unused attribute bits */
        int i_busy;     /* file is either deleted but still open, or
                           inconsistent (mkdir) */
index bf5ea6345c5545591615306c7fd71d651f164064..0c290d5896e5aec3bf45b177a88b1e19eec616d9 100644 (file)
@@ -9,6 +9,8 @@ struct fat_mount_options {
        uid_t fs_uid;
        gid_t fs_gid;
        unsigned short fs_umask;
+       unsigned short codepage;  /* Codepage for shortname conversions */
+       char *iocharset;          /* Charset used for filename input/display */
        unsigned char name_check; /* r = relaxed, n = normal, s = strict */
        unsigned char conversion; /* b = binary, t = text, a = auto */
        unsigned quiet:1,         /* set = fake successful chmods and chowns */
@@ -16,11 +18,17 @@ struct fat_mount_options {
                 sys_immutable:1, /* set = system files are immutable */
                 dotsOK:1,        /* set = hidden and system files are named '.filename' */
                 isvfat:1,        /* 0=no vfat long filename support, 1=vfat support */
+                utf8:1,          /* Use of UTF8 character set (Default) */
                 unicode_xlate:1, /* create escape sequences for unhandled Unicode */
                 posixfs:1,       /* Allow names like makefile and Makefile to coexist */
-                numtail:1;       /* Does first alias have a numeric '~1' type tail? */
+                numtail:1,       /* Does first alias have a numeric '~1' type tail? */
+                fat32:1;         /* Is this a FAT32 partition? */
 };
 
+struct vfat_unicode {
+       unsigned char uni1;
+       unsigned char uni2;
+};
 
 struct msdos_sb_info {
        unsigned short cluster_size; /* sectors/cluster */
@@ -29,11 +37,15 @@ struct msdos_sb_info {
        unsigned short dir_start,dir_entries; /* root dir start & entries */
        unsigned short data_start;   /* first data sector */
        unsigned long clusters;      /* number of clusters */
+       unsigned long root_cluster;  /* first cluster of the root directory */
+       unsigned long fsinfo_offset; /* FAT32 fsinfo offset from start of disk */
        struct wait_queue *fat_wait;
        int fat_lock;
        int prev_free;               /* previously returned free cluster number */
        int free_clusters;           /* -1 if undefined */
        struct fat_mount_options options;
+       struct nls_table *nls_disk;  /* Codepage used on disk */
+       struct nls_table *nls_io;    /* Charset used for input and display */
 };
 
 #endif
diff --git a/include/linux/nls.h b/include/linux/nls.h
new file mode 100644 (file)
index 0000000..37bb7f2
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Native language support structures and functions
+ */
+#ifndef _LINUX_NLS_H
+#define _LINUX_NLS_H
+
+struct nls_unicode {
+       unsigned char uni1;
+       unsigned char uni2;
+};
+
+struct nls_table {
+       char *charset;
+       unsigned char **page_uni2charset;
+       struct nls_unicode *charset2uni;
+
+       void (*inc_use_count) (void);
+       void (*dec_use_count) (void);
+       struct nls_table *next;
+};
+
+/* nls.c */
+extern int init_nls(void);
+extern int register_nls(struct nls_table *);
+extern int unregister_nls(struct nls_table *);
+extern struct nls_table *find_nls(char *);
+extern struct nls_table *load_nls(char *);
+extern void unload_nls(struct nls_table *);
+extern struct nls_table *load_nls_default(void);
+
+extern int utf8_mbtowc(__u16 *, const __u8 *, int);
+extern int utf8_mbstowcs(__u16 *, const __u8 *, int);
+extern int utf8_wctomb(__u8 *, __u16, int);
+extern int utf8_wcstombs(__u8 *, const __u16 *, int);
+
+extern int init_nls_iso8859_1(void);
+extern int init_nls_iso8859_2(void);
+extern int init_nls_iso8859_3(void);
+extern int init_nls_iso8859_4(void);
+extern int init_nls_iso8859_5(void);
+extern int init_nls_iso8859_6(void);
+extern int init_nls_iso8859_7(void);
+extern int init_nls_iso8859_8(void);
+extern int init_nls_iso8859_9(void);
+extern int init_nls_cp437(void);
+extern int init_nls_cp737(void);
+extern int init_nls_cp775(void);
+extern int init_nls_cp850(void);
+extern int init_nls_cp852(void);
+extern int init_nls_cp855(void);
+extern int init_nls_cp857(void);
+extern int init_nls_cp860(void);
+extern int init_nls_cp861(void);
+extern int init_nls_cp862(void);
+extern int init_nls_cp863(void);
+extern int init_nls_cp864(void);
+extern int init_nls_cp865(void);
+extern int init_nls_cp866(void);
+extern int init_nls_cp869(void);
+extern int init_nls_cp874(void);
+
+#endif /* _LINUX_NLS_H */
index 176e88c862b06c58507f3e325d2015a5285e1a61..0c31e72a5d1bc401468322b343c6aa52721cbeab 100644 (file)
 #define TRANSACT2_FINDNOTIFYNEXT  12
 #define TRANSACT2_MKDIR           13
 
+
+/* Capabilities.  See ftp://ftp.microsoft.com/developr/drg/cifs/cifs6.txt */
+#define CAP_RAW_MODE         0x0001
+#define CAP_MPX_MODE         0x0002
+#define CAP_UNICODE          0x0004
+#define CAP_LARGE_FILES      0x0008
+#define CAP_NT_SMBS          0x0010
+#define CAP_RPC_REMOTE_APIS  0x0020
+#define CAP_STATUS32         0x0040
+#define CAP_LEVEL_II_OPLOCKS 0x0080
+#define CAP_LOCK_AND_READ    0x0100
+#define CAP_NT_FIND          0x0200
+#define CAP_DFS              0x1000
+#define CAP_LARGE_READX      0x4000
+
 #endif /* _SMBNO_H_ */
index 4e66eaad10135766baa010c7a4f506fb05e2b0af..a9750b55712defbb42790fbaabe6db5f7313c031 100644 (file)
@@ -569,8 +569,8 @@ static void parse_root_dev(char * line)
                { "hdd",     0x1640 },
                { "hde",     0x2100 },
                { "hdf",     0x2140 },
-               { "hdg",     0x2100 },
-               { "hdh",     0x2140 },
+               { "hdg",     0x2200 },
+               { "hdh",     0x2240 },
                { "sda",     0x0800 },
                { "sdb",     0x0810 },
                { "sdc",     0x0820 },
index 646c75a5b2d3157cdde8940ba42ddbde32dbc43a..b3b55d6409846ea295a15b139875976d37ca6aaa 100644 (file)
@@ -87,6 +87,7 @@ struct symbol_table symbol_table = {
 
        /* stackable module support */
        X(register_symtab_from),
+       X(get_module_symbol),
 #ifdef CONFIG_KERNELD
        X(kerneld_send),
 #endif
index c5dc3deb0598c8f4325855742488d46cac23c6e7..147da31b6238fefe309dd7d4aa19e63847a11edb 100644 (file)
@@ -596,6 +596,36 @@ int get_ksyms_list(char *buf, char **start, off_t offset, int length)
        return len;
 }
 
+/*
+ * Gets the address for a symbol in the given module.  If modname is
+ * NULL, it looks for the name in any registered symbol table.  If the
+ * modname is an empty string, it looks for the symbol in kernel exported
+ * symbol tables.
+ */
+void *get_module_symbol(char *modname, char *symname)
+{
+       struct module *mp;
+       struct internal_symbol *sym;
+       int i;
+
+       for (mp = module_list; mp; mp = mp->next) {
+               if (((modname == NULL) || (strcmp(mp->name, modname) == 0)) &&
+                       (mp->state == MOD_RUNNING) &&
+                   (mp->symtab != NULL) &&
+                   (mp->symtab->n_symbols > 0)) {
+                       for (i = mp->symtab->n_symbols,
+                               sym = mp->symtab->symbol;
+                               i > 0; --i, ++sym) {
+
+                               if (strcmp(sym->name, symname) == 0) {
+                                       return sym->addr;
+                               }
+                       }
+               }
+       }
+       return NULL;
+}
+
 /*
  * Rules:
  * - The new symbol table should be statically allocated, or else you _have_
index 9d2693bd7f99ab488d322cea8d1ea85a2077332a..72e203d5d875bc48628a3200e4564d9bfbb1497a 100644 (file)
@@ -10,6 +10,7 @@
  */
 #include <stdarg.h>
 
+#include <linux/config.h> /* CONFIG_SCSI_GDTH */
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
index dd653740e39677c81e7ea855431b32278b089690..b74185a8775422bf5e0bca45ea119689bad56512 100644 (file)
@@ -9,6 +9,7 @@
  * most "normal" filesystems (but you don't /have/ to use this:
  * the NFS filesystem does this differently, for example)
  */
+#include <linux/config.h> /* CONFIG_READA_SMALL */
 #include <linux/stat.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index b1872f532fb8a652506f75eac230df0380ceb6d5..4f83db95a24a3dd6bea47cf2937b96de75f0ad60 100644 (file)
@@ -1533,6 +1533,8 @@ static int ax25_accept(struct socket *sock, struct socket *newsock, int flags)
 
        newsk = skb->sk;
        newsk->pair = NULL;
+       newsk->socket = newsock;
+       newsk->sleep = &newsock->wait;
        sti();
 
        /* Now attach up the new socket */
index d947e4d4d3efab66c9e721261234a11441f35b75..3d1ac2cfb96f633613184a68723f2e227b1b7ad0 100644 (file)
@@ -4,9 +4,9 @@
 bool 'IP: forwarding/gatewaying' CONFIG_IP_FORWARD
 bool 'IP: multicasting' CONFIG_IP_MULTICAST
 bool 'IP: syn cookies' CONFIG_SYN_COOKIES
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-  bool 'IP: rst cookies' CONFIG_RST_COOKIES
-fi
+#if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+#  bool 'IP: rst cookies' CONFIG_RST_COOKIES
+#fi
 if [ "$CONFIG_FIREWALL" = "y" ]; then
   bool 'IP: firewalling' CONFIG_IP_FIREWALL
   if [ "$CONFIG_IP_FIREWALL" = "y" ]; then
index 24438b5b2dd66c4cfdd75a0ade42e5daca310182..a23cb14f46980338ddeef8259ea76124ea591774 100644 (file)
@@ -425,6 +425,7 @@ static void raw_close(struct sock *sk, unsigned long timeout)
                mroute_socket=NULL;
        }
 #endif 
+       sk->dead=1;
        destroy_sock(sk);
 }
 
index 79976f4e245a3da2b4677b677019fa99b01a088b..9bb558d900251352d900ca325cbc69562d8fb5d1 100644 (file)
@@ -908,6 +908,8 @@ static int nr_accept(struct socket *sock, struct socket *newsock, int flags)
 
        newsk = skb->sk;
        newsk->pair = NULL;
+       newsk->socket = newsock;
+       newsk->sleep = &newsock->wait;
        sti();
 
        /* Now attach up the new socket */